includes/wikiengine/Render/Xhtml/Wikilink.php
changeset 21 663fcf528726
parent 1 fe660c52c48f
child 67 f6454d5fec7a
equal deleted inserted replaced
20:40105681f495 21:663fcf528726
    55     */
    55     */
    56 
    56 
    57     function token($options)
    57     function token($options)
    58     {
    58     {
    59         global $session;
    59         global $session;
    60         if($session->sid_super) $as = htmlspecialchars(urlSeparator).'auth='.$session->sid_super;
    60         if ( $session->sid_super )
    61         else $as = '';
    61         {
       
    62           $as = htmlspecialchars(urlSeparator) . 'auth='.$session->sid_super;
       
    63         }
       
    64         else
       
    65         {
       
    66           $as = '';
       
    67         }
    62         // make nice variable names (page, anchor, text)
    68         // make nice variable names (page, anchor, text)
    63         extract($options);
    69         extract($options);
    64 
    70 
    65         // is there a "page existence" callback?
    71         // is there a "page existence" callback?
    66         // we need to access it directly instead of through
    72         // we need to access it directly instead of through
    69         if (isset($this->conf['exists_callback'])) {
    75         if (isset($this->conf['exists_callback'])) {
    70             $callback =& $this->conf['exists_callback'];
    76             $callback =& $this->conf['exists_callback'];
    71         } else {
    77         } else {
    72         	$callback = false;
    78         	$callback = false;
    73         }
    79         }
       
    80         
       
    81         $page = sanitize_page_id( $page );
    74 
    82 
    75         if ($callback) {
    83         if ($callback) {
    76             // use the callback function
    84             // use the callback function
    77             $exists = call_user_func($callback, $page);
    85             $exists = call_user_func($callback, $page);
    78         } else {
    86         } else {
    90         // convert *after* checking against page names so as not to mess
    98         // convert *after* checking against page names so as not to mess
    91         // up what the user typed and what we're checking.
    99         // up what the user typed and what we're checking.
    92         //$page = $this->urlEncode($page);
   100         //$page = $this->urlEncode($page);
    93         $anchor = $this->urlEncode($anchor);
   101         $anchor = $this->urlEncode($anchor);
    94         $text = $this->textEncode($text);
   102         $text = $this->textEncode($text);
    95 
   103         
    96         // does the page exist?
   104         // does the page exist?
    97         if ($exists) {
   105         if ($exists) {
    98 
   106 
    99             // PAGE EXISTS.
   107             // PAGE EXISTS.
   100 
   108