includes/render.php
changeset 382 2ccb55995aef
parent 377 bb3e6c3bd4f4
child 387 92664d2efab8
equal deleted inserted replaced
381:b4751b55ee92 382:2ccb55995aef
   215   public static function next_gen_wiki_format($text, $plaintext = false, $filter_links = true, $do_params = false)
   215   public static function next_gen_wiki_format($text, $plaintext = false, $filter_links = true, $do_params = false)
   216   {
   216   {
   217     global $db, $session, $paths, $template, $plugins; // Common objects
   217     global $db, $session, $paths, $template, $plugins; // Common objects
   218     global $lang;
   218     global $lang;
   219     
   219     
       
   220     profiler_log("RenderMan: starting wikitext render");
       
   221     
   220     $random_id = md5( time() . mt_rand() );
   222     $random_id = md5( time() . mt_rand() );
   221     
   223     
   222     // Strip out <nowiki> sections and PHP code
   224     // Strip out <nowiki> sections and PHP code
   223     
   225     
   224     $php = preg_match_all('#<\?php(.*?)\?>#is', $text, $phpsec);
   226     $php = preg_match_all('#<\?php(.*?)\?>#is', $text, $phpsec);
   336     // Reinsert PHP
   338     // Reinsert PHP
   337     for($i=0;$i<$php;$i++)
   339     for($i=0;$i<$php;$i++)
   338     {
   340     {
   339       $result = str_replace('{PHP:'.$random_id.':'.$i.'}', '<?php'.$phpsec[1][$i].'?>', $result);
   341       $result = str_replace('{PHP:'.$random_id.':'.$i.'}', '<?php'.$phpsec[1][$i].'?>', $result);
   340     }
   342     }
       
   343     
       
   344     profiler_log("RenderMan: finished wikitext render");
   341     
   345     
   342     return $result;
   346     return $result;
   343     
   347     
   344   }
   348   }
   345   
   349