ILIAS  trunk Revision v13.0_alpha-62-g3b72d83f2e5
ilWikiUtil Class Reference

Utility class for wiki. More...

+ Collaboration diagram for ilWikiUtil:

Static Public Member Functions

static replaceInternalLinks (string $s, int $a_wiki_id, bool $a_offline=false, string $lang="-")
 This one is based on Mediawiki Parser->replaceInternalLinks since we display images in another way, only text links are processed. More...
 
static collectInternalLinks (string $s, int $a_wiki_id, bool $a_collect_non_ex=false, string $mode=IL_WIKI_MODE_COLLECT)
 Collect internal wiki links of a string. More...
 
static wfUrlProtocols ()
 From mediawiki GlobalFunctions.php. More...
 
static wfUrlencode (string $s)
 
static makeDbTitle (string $a_par)
 
static makeUrlTitle (string $a_par)
 
static splitTrail (string $trail)
 
static sendNotification (string $a_action, int $a_type, int $a_wiki_ref_id, int $a_page_id, ?string $a_comment=null)
 

Static Protected Member Functions

static processInternalLinks (string $s, int $a_wiki_id, string $a_mode=IL_WIKI_MODE_REPLACE, bool $a_collect_non_ex=false, bool $a_offline=false, string $lang="-")
 Process internal links (internal) More...
 
static removeUnsafeCharacters (string $a_str)
 
static makeLink (object $nt, int $a_wiki_id, string $text='', string $query='', string $trail='', string $prefix='', bool $a_offline=false, string $lang="-")
 Make a wiki link, the following formats are supported: More...
 

Private Attributes

const string MAIL_BLOCK_BORDER = "\n---\n"
 

Detailed Description

Utility class for wiki.

Author
Alexander Killing killi.nosp@m.ng@l.nosp@m.eifos.nosp@m..de

Definition at line 48 of file class.ilWikiUtil.php.

Member Function Documentation

◆ collectInternalLinks()

static ilWikiUtil::collectInternalLinks ( string  $s,
int  $a_wiki_id,
bool  $a_collect_non_ex = false,
string  $mode = IL_WIKI_MODE_COLLECT 
)
static

Collect internal wiki links of a string.

Definition at line 75 of file class.ilWikiUtil.php.

80 : array {
82
83 $log->debug("collect interna links wiki id: " . $a_wiki_id . ", collect nonex: " . $a_collect_non_ex);
84
86 $s,
87 $a_wiki_id,
88 $mode,
89 $a_collect_non_ex
90 );
91 $log->debug("content: " . $s);
92 $log->debug("found: " . print_r($result, true));
93 return $result;
94 }
static getLogger(string $a_component_id)
Get component logger.
static processInternalLinks(string $s, int $a_wiki_id, string $a_mode=IL_WIKI_MODE_REPLACE, bool $a_collect_non_ex=false, bool $a_offline=false, string $lang="-")
Process internal links (internal)
$log
Definition: ltiauth.php:50

Referenced by WikiUtilTest\processInternalLinksCollect(), and WikiUtilTest\processInternalLinksExtCollect().

+ Here is the caller graph for this function:

◆ makeDbTitle()

◆ makeLink()

static ilWikiUtil::makeLink ( object  $nt,
int  $a_wiki_id,
string  $text = '',
string  $query = '',
string  $trail = '',
string  $prefix = '',
bool  $a_offline = false,
string  $lang = "-" 
)
staticprotected

Make a wiki link, the following formats are supported:

[[Page Title]] [[Page Title|Presentation Text]] [[Page Title::Anchor]] [[Page Title::Anchor|Presentation Text]] [[#Anchor|Presentation Text]] (link to anchor on same wiki page)

Definition at line 312 of file class.ilWikiUtil.php.

321 : string {
322 global $DIC;
323 $request = $DIC
324 ->wiki()
325 ->internal()
326 ->gui()
327 ->request();
328 $page_repo = $DIC->wiki()->internal()->repo()->page();
329
330 $ilCtrl = $DIC->ctrl();
331
332 if (!is_object($nt)) {
333 # Fail gracefully
334 $retVal = "<!-- ERROR -->{$prefix}{$text}{$trail}";
335 } else {
336 // remove anchor from text, define anchor
337 $anc = "";
338 if ($nt->mFragment != "") {
339 if (substr($text, strlen($text) - strlen("#" . $nt->mFragment)) === "#" . $nt->mFragment) {
340 $text = substr($text, 0, strlen($text) - strlen("#" . $nt->mFragment));
341 }
342 $anc = "#copganc_" . $nt->mFragment;
343 }
344
345 # Separate the link trail from the rest of the link
346 // outcommented due to bug #14590
347 // list( $inside, $trail ) = ilWikiUtil::splitTrail( $trail );
348
349 $retVal = '***' . $text . "***" . $trail;
350 $url_title = self::makeUrlTitle($nt->mTextform);
351 $db_title = self::makeDbTitle($nt->mTextform);
352 if ($db_title != "") {
353 $pg_exists = $page_repo->existsByTitle($a_wiki_id, $db_title, $lang);
354 } else {
355 // links on same page (only anchor used)
356 $pg_exists = true;
357 }
358
359 //var_dump($nt);
360 //var_dump($inside);
361 //var_dump($trail);
362 $wiki_link_class = (!$pg_exists)
363 ? ' class="ilc_link_IntLink ilWikiPageMissing" '
364 : ' class="ilc_link_IntLink" ';
365
366 if (!$a_offline) {
367 if ($url_title != "") {
368 $ilCtrl->setParameterByClass("ilobjwikigui", "wpg_id", null);
369 $ilCtrl->setParameterByClass("ilwikipagegui", "wpg_id", null);
370 $ilCtrl->setParameterByClass("ilobjwikigui", "page", $url_title);
371 $retVal = '<a ' . $wiki_link_class . ' href="' .
372 $ilCtrl->getLinkTargetByClass("ilobjwikigui", "gotoPage") . $anc .
373 '">' . $text . '</a>' . $trail;
374 $ilCtrl->setParameterByClass(
375 "ilobjwikigui",
376 "page",
377 $request->getPage()
378 );
379 } else {
380 $retVal = '<a ' . $wiki_link_class . ' href="' .
381 $anc .
382 '">' . $text . '</a>' . $trail;
383 }
384 } else {
385 if ($pg_exists) {
386 if ($db_title != "") {
387 $pg_id = ilWikiPage::getPageIdForTitle($a_wiki_id, $db_title);
388 $retVal = '<a ' . $wiki_link_class . ' href="' .
389 "wpg_" . $pg_id . ".html" . $anc .
390 '">' . $text . '</a>' . $trail;
391 } else {
392 $retVal = '<a ' . $wiki_link_class . ' href="' .
393 $anc .
394 '">' . $text . '</a>' . $trail;
395 }
396 } else {
397 $retVal = $text . $trail;
398 }
399 }
400 }
401 return $retVal;
402 }
static getPageIdForTitle(int $a_wiki_id, string $a_title, string $lang="-")
Get wiki page object for id and title.
static makeUrlTitle(string $a_par)
static makeDbTitle(string $a_par)
$request
@ilCtrl_Calls ilObjLearningSequenceContentGUI: ilObjLearningSequenceConditionsGUI
Definition: ltiauth.php:39
global $DIC
Definition: shib_login.php:26
$text
Definition: xapiexit.php:21

◆ makeUrlTitle()

◆ processInternalLinks()

static ilWikiUtil::processInternalLinks ( string  $s,
int  $a_wiki_id,
string  $a_mode = IL_WIKI_MODE_REPLACE,
bool  $a_collect_non_ex = false,
bool  $a_offline = false,
string  $lang = "-" 
)
staticprotected

Process internal links (internal)

Returns
array|false|string

Definition at line 101 of file class.ilWikiUtil.php.

108 : array|bool|string {
109 global $DIC;
110 $page_repo = $DIC->wiki()->internal()->repo()->page();
111
112 $collect = array();
113 // both from mediawiki DefaulSettings.php
114 $wgLegalTitleChars = " %!\"$&'()*,\\-.\\/0-9:;=?@A-Z\\\\^_`a-z~\\x80-\\xFF+";
115
116 // dummies for wiki globals
117 $GLOBALS["wgContLang"] = new class () {
118 public function getNsIndex($a_p): bool
119 {
120 return false;
121 }
122 public function lc($a_key): bool
123 {
124 return false;
125 }
126 };
127 $GLOBALS["wgInterWikiCache"] = false;
128
129 # the % is needed to support urlencoded titles as well
130 //$tc = Title::legalChars().'#%';
131 $tc = $wgLegalTitleChars . '#%';
132
133 //$sk = $this->mOptions->getSkin();
134
135 #split the entire text string on occurences of [[
136 $a = explode('[[', ' ' . $s);
137 #get the first element (all text up to first [[), and remove the space we added
138 $s = array_shift($a);
139 $s = substr($s, 1);
140
141 # Match a link having the form [[namespace:link|alternate]]trail
142 $e1 = "/^([{$tc}]+)(?:\\|(.+?))?]](.*)\$/sD";
143
144 # Match cases where there is no "]]", which might still be images
145 // static $e1_img = FALSE;
146 // if ( !$e1_img ) { $e1_img = "/^([{$tc}]+)\\|(.*)\$/sD"; }
147
148 # Match the end of a line for a word that's not followed by whitespace,
149 # e.g. in the case of 'The Arab al[[Razi]]', 'al' will be matched
150 // $e2 = wfMsgForContent( 'linkprefix' );
151
152 /* $useLinkPrefixExtension = $wgContLang->linkPrefixExtension();
153 if( is_null( $this->mTitle ) ) {
154 throw new MWException( __METHOD__.": \$this->mTitle is null\n" );
155 }
156 $nottalk = !$this->mTitle->isTalkPage();*/
157 $nottalk = true;
158
159 /* if ( $useLinkPrefixExtension ) {
160 $m = array();
161 if ( preg_match( $e2, $s, $m ) ) {
162 $first_prefix = $m[2];
163 } else {
164 $first_prefix = false;
165 }
166 } else {*/
167 $prefix = '';
168 // }
169
170 $useSubpages = false;
171
172 # Loop for each link
173 for ($k = 0; isset($a[$k]); $k++) {
174 $line = $a[$k];
175
176
177 $might_be_img = false;
178
179 //wfProfileIn( "$fname-e1" );
180 if (preg_match($e1, $line, $m)) { # page with normal text or alt
181 $text = $m[2];
182 # If we get a ] at the beginning of $m[3] that means we have a link that's something like:
183 # [[Image:Foo.jpg|[http://example.com desc]]] <- having three ] in a row fucks up,
184 # the real problem is with the $e1 regex
185 # See bug 1300.
186 #
187 # Still some problems for cases where the ] is meant to be outside punctuation,
188 # and no image is in sight. See bug 2095.
189 #
190 if ($text !== '' &&
191 strpos($m[3], ']') === 0 &&
192 strpos($text, '[') !== false
193 ) {
194 $text .= ']'; # so that replaceExternalLinks($text) works later
195 $m[3] = substr($m[3], 1);
196 }
197 # fix up urlencoded title texts
198 if (strpos($m[1], '%') !== false) {
199 # Should anchors '#' also be rejected?
200 $m[1] = str_replace(array('<', '>'), array('&lt;', '&gt;'), urldecode($m[1]));
201 }
202 $trail = $m[3];
203 /* } elseif( preg_match($e1_img, $line, $m) ) { # Invalid, but might be an image with a link in its caption
204 $might_be_img = true;
205 $text = $m[2];
206 if ( strpos( $m[1], '%' ) !== false ) {
207 $m[1] = urldecode($m[1]);
208 }
209 $trail = "";*/
210 } else { # Invalid form; output directly
211 $s .= $prefix . '[[' . $line ;
212 //wfProfileOut( "$fname-e1" );
213 continue;
214 }
215 //wfProfileOut( "$fname-e1" );
216 //wfProfileIn( "$fname-misc" );
217
218 # Don't allow internal links to pages containing
219 # PROTO: where PROTO is a valid URL protocol; these
220 # should be external links.
221 if (preg_match('/^\b%na' . self::wfUrlProtocols() . 'me/', $m[1])) {
222 $s .= $prefix . '[[' . $line ;
223 continue;
224 }
225
226 # Make subpage if necessary
227 /* if( $useSubpages ) {
228 $link = $this->maybeDoSubpageLink( $m[1], $text );
229 } else {*/
230 $link = $m[1];
231 // }
232
233 $noforce = (strpos($m[1], ':') !== 0);
234 if (!$noforce) {
235 # Strip off leading ':'
236 $link = substr($link, 1);
237 }
238
239 // wfProfileOut( "$fname-misc" );
240 // wfProfileIn( "$fname-title" );
241
242 $nt = Title::newFromText($link);
243
244 if (!$nt) {
245 $s .= $prefix . '[[' . $line;
246 continue;
247 }
248
249 $wasblank = ('' == $text);
250 if ($wasblank) {
251 $text = $link;
252 }
253
254 // Media wiki performs an intermediate step here (Parser->makeLinkHolder)
255 if ($a_mode === IL_WIKI_MODE_REPLACE) {
256 $s .= self::makeLink(
257 $nt,
258 $a_wiki_id,
259 $text,
260 '',
261 $trail,
262 $prefix,
263 $a_offline,
264 $lang
265 );
266 }
267 if ($a_mode === IL_WIKI_MODE_EXT_COLLECT) {
268 if (is_object($nt)) {
269 $url_title = self::makeUrlTitle($nt->mTextform);
270 $db_title = self::makeDbTitle($nt->mTextform);
271 [$inside, $trail] = self::splitTrail($trail);
272 $collect[] = array("nt" => $nt, "text" => $text,
273 "trail" => $trail, "db_title" => $db_title,
274 "url_title" => $url_title);
275 }
276 } else {
277 $db_title = self::makeDbTitle($nt->mTextform);
278
279 if (($a_collect_non_ex || $page_repo->existsByTitle($a_wiki_id, $db_title, $lang))
280 &&
281 !in_array($db_title, $collect)) {
282 $collect[] = $db_title;
283 }
284 }
285 }
286
287 //wfProfileOut( $fname );
288
289 if ($a_mode === IL_WIKI_MODE_COLLECT ||
290 $a_mode === IL_WIKI_MODE_EXT_COLLECT) {
291 return $collect;
292 } else {
293 return $s;
294 }
295 }
static newFromText($text, $defaultNamespace=NS_MAIN)
Create a new Title from text, such as what one would find in a link.
Definition: Title.php:109
const IL_WIKI_MODE_COLLECT
if(!defined('UTF8_REPLACEMENT')) const IL_WIKI_MODE_REPLACE
Wiki link / page title handling:
const IL_WIKI_MODE_EXT_COLLECT
static splitTrail(string $trail)
static makeLink(object $nt, int $a_wiki_id, string $text='', string $query='', string $trail='', string $prefix='', bool $a_offline=false, string $lang="-")
Make a wiki link, the following formats are supported:
form(?array $class_path, string $cmd, string $submit_caption="")
$a
thx to https://mlocati.github.io/php-cs-fixer-configurator for the examples
$GLOBALS["DIC"]
Definition: wac.php:66

◆ removeUnsafeCharacters()

static ilWikiUtil::removeUnsafeCharacters ( string  $a_str)
staticprotected

Definition at line 297 of file class.ilWikiUtil.php.

299 : string {
300 return str_replace(array("\x00", "\n", "\r", "\\", "'", '"', "\x1a"), "", $a_str);
301 }

◆ replaceInternalLinks()

static ilWikiUtil::replaceInternalLinks ( string  $s,
int  $a_wiki_id,
bool  $a_offline = false,
string  $lang = "-" 
)
static

This one is based on Mediawiki Parser->replaceInternalLinks since we display images in another way, only text links are processed.

Definition at line 56 of file class.ilWikiUtil.php.

61 : string {
63 $s,
64 $a_wiki_id,
66 false,
67 $a_offline,
68 $lang
69 );
70 }

Referenced by ilWikiPageGUI\postOutputProcessing(), and WikiUtilTest\processInternalLinksReplace().

+ Here is the caller graph for this function:

◆ sendNotification()

static ilWikiUtil::sendNotification ( string  $a_action,
int  $a_type,
int  $a_wiki_ref_id,
int  $a_page_id,
?string  $a_comment = null 
)
static

Definition at line 473 of file class.ilWikiUtil.php.

479 : void {
480 global $DIC;
481
483 $log->debug("start... vvvvvvvvvvvvvvvvvvvvvvvvvvv");
484
485 $ilUser = $DIC->user();
486 $ilObjDataCache = $DIC["ilObjDataCache"];
487 $ilAccess = $DIC->access();
488
489 if ($a_wiki_ref_id === 0) {
490 return;
491 }
492
493 $wiki_id = $ilObjDataCache->lookupObjId($a_wiki_ref_id);
494 $wiki = new ilObjWiki($a_wiki_ref_id, true);
495 $page = new ilWikiPage($a_page_id);
496
497 // #11138
498 $ignore_threshold = ($a_action === "comment");
499
500 // 1st update will be converted to new - see below
501 if ($a_action === "new") {
502 return;
503 }
504
505 $log->debug("-- get notifications");
506 if ($a_type == ilNotification::TYPE_WIKI_PAGE) {
507 $users = ilNotification::getNotificationsForObject($a_type, $a_page_id, null, $ignore_threshold);
508 $wiki_users = ilNotification::getNotificationsForObject(ilNotification::TYPE_WIKI, $wiki_id, $a_page_id, $ignore_threshold);
509 $users = array_merge($users, $wiki_users);
510 if (!count($users)) {
511 $log->debug("no notifications... ^^^^^^^^^^^^^^^^^^");
512 return;
513 }
514 } else {
515 $users = ilNotification::getNotificationsForObject(ilNotification::TYPE_WIKI, $wiki_id, $a_page_id, $ignore_threshold);
516 $log->debug("--->" . print_r($users));
517 if (!count($users)) {
518 $log->debug("no notifications... ^^^^^^^^^^^^^^^^^^");
519 return;
520 }
521 }
524
525 // #15192 - should always be present
526 if ($a_page_id) {
527 // #18804 - see ilWikiPageGUI::preview()
528 $link = ilLink::_getLink(null, "wiki", [], "wpage_" . $a_page_id . "_" . $a_wiki_ref_id);
529 } else {
530 $link = ilLink::_getLink($a_wiki_ref_id);
531 }
532
533 $log->debug("-- prepare content");
534 $pgui = new ilWikiPageGUI($page->getId());
535 $pgui->setRawPageContent(true);
536 $pgui->setAbstractOnly(true);
537 $pgui->setFileDownloadLink(".");
538 $pgui->setFullscreenLink(".");
539 $pgui->setSourcecodeDownloadScript(".");
540 $snippet = $pgui->showPage();
541 $snippet = ilPageObject::truncateHTML($snippet, 500, "...");
542
543 // making things more readable
544 $snippet = str_replace(['<br/>', '<br />', '</p>', '</div>'], "\n", $snippet);
545
546 $snippet = trim(strip_tags($snippet));
547
548 // "fake" new (to enable snippet - if any)
549 $hist = $page->getHistoryEntries();
550 $current_version = array_shift($hist);
551 $current_version = $current_version["nr"] ?? 0;
552 if (!$current_version && $a_action !== "comment") {
554 $a_action = "new";
555 }
556
557 $log->debug("-- sending mails");
558 $mails = [];
559 foreach (array_unique($users) as $idx => $user_id) {
560 if ($user_id != $ilUser->getId() &&
561 $ilAccess->checkAccessOfUser($user_id, 'read', '', $a_wiki_ref_id)) {
562 // use language of recipient to compose message
564 $ulng->loadLanguageModule('wiki');
565
566 if ($a_action === "comment") {
567 $subject = sprintf($ulng->txt('wiki_notification_comment_subject'), $wiki->getTitle(), $page->getTitle());
568 $message = sprintf($ulng->txt('wiki_change_notification_salutation'), ilObjUser::_lookupFullname($user_id)) . "\n\n";
569
570 $message .= $ulng->txt('wiki_notification_' . $a_action) . ":\n\n";
571 $message .= $ulng->txt('wiki') . ": " . $wiki->getTitle() . "\n";
572 $message .= $ulng->txt('page') . ": " . $page->getTitle() . "\n";
573 $message .= $ulng->txt('wiki_commented_by') . ": " . ilUserUtil::getNamePresentation($ilUser->getId()) . "\n";
574
575 // include comment/note text
576 if ($a_comment) {
577 $message .= "\n" . $ulng->txt('comment') . ":\n\"" . trim($a_comment) . "\"\n";
578 }
579
580 $message .= "\n" . $ulng->txt('wiki_change_notification_page_link') . ": " . $link;
581 } else {
582 $subject = sprintf($ulng->txt('wiki_change_notification_subject'), $wiki->getTitle(), $page->getTitle());
583 $message = sprintf($ulng->txt('wiki_change_notification_salutation'), ilObjUser::_lookupFullname($user_id)) . "\n\n";
584
585 if ($a_type == ilNotification::TYPE_WIKI_PAGE) {
586 // update/delete
587 $message .= $ulng->txt('wiki_change_notification_page_body_' . $a_action) . ":\n\n";
588 $message .= $ulng->txt('wiki') . ": " . $wiki->getTitle() . "\n";
589 $message .= $ulng->txt('page') . ": " . $page->getTitle() . "\n";
590 $message .= $ulng->txt('wiki_changed_by') . ": " . ilUserUtil::getNamePresentation($ilUser->getId()) . "\n";
591
592 if ($snippet) {
593 $message .= "\n" . $ulng->txt('content') . "\n" .
594 self::MAIL_BLOCK_BORDER . "\n" .
595 $snippet . "\n" .
596 self::MAIL_BLOCK_BORDER . "\n";
597 }
598
599 // include comment/note text
600 if ($a_comment) {
601 $message .= "\n" . $ulng->txt('comment') . ":\n\"" . trim($a_comment) . "\"\n";
602 }
603
604 $message .= "\n" . $ulng->txt('wiki_change_notification_page_link') . ": " . $link;
605 } else {
606 // new
607 $message .= $ulng->txt('wiki_change_notification_body_' . $a_action) . ":\n\n";
608 $message .= $ulng->txt('wiki') . ": " . $wiki->getTitle() . "\n";
609 $message .= $ulng->txt('page') . ": " . $page->getTitle() . "\n";
610 $message .= $ulng->txt('wiki_changed_by') . ": " . ilUserUtil::getNamePresentation($ilUser->getId()) . "\n\n";
611
612 if ($snippet) {
613 $message .= $ulng->txt('content') . "\n" .
614 self::MAIL_BLOCK_BORDER . "\n" .
615 $snippet . "\n" .
616 self::MAIL_BLOCK_BORDER . "\n\n";
617 }
618
619 $message .= $ulng->txt('wiki_change_notification_link') . ": " . $link;
620 }
621 }
622
623 $mail_obj = new ilMail(ANONYMOUS_USER_ID);
624 $mail_obj->appendInstallationSignature(true);
625 $log->debug("before enqueue ($user_id)");
626 /*
627 $mail_obj->enqueue(
628 ilObjUser::_lookupLogin($user_id),
629 "",
630 "",
631 $subject,
632 $message,
633 array()
634 );*/
636 $mails[] = new ilMailValueObject(
637 '',
639 '',
640 '',
641 $subject,
642 $message,
643 MailAttachments::empty(),
644 false,
645 false
646 );
647 $log->debug("after enqueue");
648 } else {
649 unset($users[$idx]);
650 }
651 }
652 if (count($mails) > 0) {
653 $processor = new ilMassMailTaskProcessor();
654 $processor->run(
655 $mails,
657 "",
658 []
659 );
660 }
661 $log->debug("end... ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^");
662 }
static _getLanguageOfUser(int $a_usr_id)
Get language object of user.
static _getInstallationSignature()
static updateNotificationTime(int $type, int $id, array $user_ids, ?int $page_id=null, bool $activate_new_entries=true)
Update the last mail timestamp for given object and users.
static getNotificationsForObject(int $type, int $id, ?int $page_id=null, bool $ignore_threshold=false)
Get all users/recipients for given object.
static _lookupFullname(int $a_user_id)
static _lookupLogin(int $a_user_id)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static truncateHTML(string $a_text, int $a_length=100, string $a_ending='...', bool $a_exact=false, bool $a_consider_html=true)
Truncate (html) string.
static getNamePresentation( $a_user_id, bool $a_user_image=false, bool $a_profile_link=false, string $a_profile_back_link='', bool $a_force_first_lastname=false, bool $a_omit_login=false, bool $a_sortable=true, bool $a_return_data_array=false, $a_ctrl_path=null)
Default behaviour is:
Class ilWikiPage GUI class.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
const ANONYMOUS_USER_ID
Definition: constants.php:27

◆ splitTrail()

static ilWikiUtil::splitTrail ( string  $trail)
static

Definition at line 455 of file class.ilWikiUtil.php.

457 : array {
458 $regex = '/^([a-z]+)(.*)$/sD';
459
460 $inside = '';
461 if ('' != $trail) {
462 $m = array();
463
464 if (preg_match($regex, $trail, $m)) {
465 $inside = $m[1];
466 $trail = $m[2];
467 }
468 }
469
470 return array( $inside, $trail );
471 }

◆ wfUrlencode()

static ilWikiUtil::wfUrlencode ( string  $s)
static

Definition at line 433 of file class.ilWikiUtil.php.

435 : string {
436 $s = urlencode($s);
437 return $s;
438 }

Referenced by Title\secureAndSplit().

+ Here is the caller graph for this function:

◆ wfUrlProtocols()

static ilWikiUtil::wfUrlProtocols ( )
static

From mediawiki GlobalFunctions.php.

Returns
string

Definition at line 408 of file class.ilWikiUtil.php.

408 : string
409 {
410 $wgUrlProtocols = array(
411 'http://',
412 'https://',
413 'ftp://',
414 'irc://',
415 'gopher://',
416 'telnet://', // Well if we're going to support the above.. -ævar
417 'nntp://', // @bug 3808 RFC 1738
418 'worldwind://',
419 'mailto:',
420 'news:'
421 );
422
423 // Support old-style $wgUrlProtocols strings, for backwards compatibility
424 // with LocalSettings files from 1.5
425 $protocols = array();
426 foreach ($wgUrlProtocols as $protocol) {
427 $protocols[] = preg_quote($protocol, '/');
428 }
429
430 return implode('|', $protocols);
431 }

Field Documentation

◆ MAIL_BLOCK_BORDER

const string ilWikiUtil::MAIL_BLOCK_BORDER = "\n---\n"
private

Definition at line 50 of file class.ilWikiUtil.php.


The documentation for this class was generated from the following file: