iliaa           Sun Jun 19 17:22:39 2005 EDT

  Modified files:              
    /livedocs   style_mapping.php 
  Log:
  Fix bug #33390
  
  
http://cvs.php.net/diff.php/livedocs/style_mapping.php?r1=1.26&r2=1.27&ty=u
Index: livedocs/style_mapping.php
diff -u livedocs/style_mapping.php:1.26 livedocs/style_mapping.php:1.27
--- livedocs/style_mapping.php:1.26     Fri Jun 17 22:16:06 2005
+++ livedocs/style_mapping.php  Sun Jun 19 17:22:39 2005
@@ -18,7 +18,7 @@
 // | Helper functions for formatting elements                             |
 // +----------------------------------------------------------------------+
 //
-// $Id: style_mapping.php,v 1.26 2005/06/18 02:16:06 iliaa Exp $
+// $Id: style_mapping.php,v 1.27 2005/06/19 21:22:39 iliaa Exp $
 
 // almost XPATH.. ;-)
 $map = array(
@@ -334,7 +334,7 @@
 function format_listing($node) 
 {
        $content = trim($node->content);
-       if (substr($content, 0, 5) == '<?php') {
+       if (!strncasecmp($content, '<?php', 5)) {
                $node->attributes['role'] = 'php';
        }
        if (!isset($node->attributes['role'])) {
@@ -346,8 +346,12 @@
                        $content = highlight_php_code($content);
                        break;
                case 'note':
-                       $content = 
preg_replace_callback('!(\<(\?|\?php).+?\?\>)!msU', 'highlight_php_code', 
$content);
-                       $node->attributes['role'] = 'php';
+                       if (preg_match('!<\?(?:\s|=|php)!i', $content)) {
+                               $content = highlight_php_code($content);
+                               $node->attributes['role'] = 'php';
+                       } else {
+                               $content = 
'<pre>'.htmlspecialchars($content).'</pre>';
+                       }
                        break;
 
                case 'asp':

Reply via email to