includes/namespaces/default.php
changeset 832 7152ca0a0ce9
parent 801 eb8b23f11744
child 866 0a691138a1e5
equal deleted inserted replaced
831:45e887f23282 832:7152ca0a0ce9
   351                   'current_link' => makeUrlNS($this->namespace, $this->page_id),
   351                   'current_link' => makeUrlNS($this->namespace, $this->page_id),
   352                   'restore_link' => makeUrlNS($this->namespace, $this->page_id, 'do=edit&revid='.$this->revision_id),
   352                   'restore_link' => makeUrlNS($this->namespace, $this->page_id, 'do=edit&revid='.$this->revision_id),
   353                   'restore_onclick' => 'ajaxEditor(\''.$this->revision_id.'\'); return false;',
   353                   'restore_onclick' => 'ajaxEditor(\''.$this->revision_id.'\'); return false;',
   354                 )) . '
   354                 )) . '
   355             </div>';
   355             </div>';
       
   356       $q = $db->sql_query('SELECT page_format FROM ' . table_prefix . "logs WHERE log_id = {$this->revision_id};");
       
   357       if ( !$q )
       
   358         $db->_die();
       
   359       
       
   360       list($page_format) = $db->fetchrow_num();
       
   361       $db->free_result();
       
   362     }
       
   363     else
       
   364     {
       
   365       $pathskey = $paths->nslist[ $this->namespace ] . $paths->page_id;
       
   366       $page_format = $paths->pages[$pathskey]['page_format'];
   356     }
   367     }
   357     
   368     
   358     if ( $redir_enabled )
   369     if ( $redir_enabled )
   359     {
   370     {
   360       echo $redir_html;
   371       echo $redir_html;
   366       eval($cmd);
   377       eval($cmd);
   367     }
   378     }
   368     
   379     
   369     if ( $incl_inner_headers )
   380     if ( $incl_inner_headers )
   370     {
   381     {
   371       $text = '?>' . RenderMan::render($text);
   382       if ( $page_format === 'wikitext' )
       
   383       {
       
   384         $text = '?>' . RenderMan::render($text);
       
   385       }
       
   386       else
       
   387       {
       
   388         // Page format is XHTML. This means we want to disable functionality that MCE takes care of, while still retaining
       
   389         // the ability to wikilink, the ability to use images, etc. Basically, RENDER_INLINEONLY disables all behavior in
       
   390         // the rendering engine/Text_Wiki that conflicts with MCE.
       
   391         $text = '?>' . RenderMan::render($text, RENDER_WIKI_DEFAULT | RENDER_INLINEONLY);
       
   392       }
   372     }
   393     }
   373     else
   394     else
   374     {
   395     {
   375       $text = '?>' . $text;
   396       $text = '?>' . $text;
   376       $text = preg_replace('/<nowiki>(.*?)<\/nowiki>/s', '\\1', $text);
   397       $text = preg_replace('/<nowiki>(.*?)<\/nowiki>/s', '\\1', $text);