--- old/wp-content/plugins/phphlstring/php_hl_string.php 2019-11-25 05:34:19.887690704 +0900
+++ wp-content/plugins/phphlstring_0.9.9/php_hl_string.php 2019-11-25 05:28:47.537690790 +0900
@@ -3,7 +3,7 @@
Plugin Name: PHP Highligh String
Plugin URI: http://www.chameleonic.org/plugin/
Description: PHPのコードを見やすく色分けしながら、行番号をつけます。使い方は、[code lang="php" -1]コード[/code ]のようにbbCode風の専用タグを書きます。
-Version: 0.9.9
+Version: 0.9.9b
Author: chameleon
Author URI: http://www.chameleonic.org/
*/
@@ -24,7 +24,7 @@
*/
//PEARに依存する。
-$pear_dir = ABSPATH . 'wp-content/plugins/phphlstring/PEAR';
+$pear_dir = ABSPATH . 'wp-content/plugins/phphlstring_0.9.9/PEAR';
if(is_dir($pear_dir))
ini_set("include_path", ini_get("include_path") . PATH_SEPARATOR . $pear_dir);
@@ -88,9 +88,18 @@
function first($content)
{
- $content = preg_replace('#\[code\](.*?)\[/code\]#sie', '$this->do_hlight(\'\\1\', false, false, $content);', $content);
- $content = preg_replace('#\[code lang="(.*?)"\](.*?)\[/code\]#sie', '$this->do_hlight(\'\\2\',\'\\1\',false,$content);', $content);
- $content = preg_replace('#\[code lang="(.*?)"\s*?-([0-9]*?)\](.*?)\[/code\]#sie', '$this->do_hlight(\'\\3\',\'\\1\',\'\\2\',$content);', $content);
+ $content = preg_replace_callback(
+ '#\[code\](.*?)\[/code\]#si',
+ function($m){return $this->do_hlight($m[1], false, false, $content);},
+ $content);
+ $content = preg_replace_callback(
+ '#\[code lang="(.*?)"\](.*?)\[/code\]#si',
+ function($m){return $this->do_hlight($m[2],$m[1],false,$content);},
+ $content);
+ $content = preg_replace_callback(
+ '#\[code lang="(.*?)"\s*?-([0-9]*?)\](.*?)\[/code\]#si',
+ function($m){return $this->do_hlight($m[3],$m[1],$m[2],$content);},
+ $content);
return $content;
}
@@ -107,7 +116,7 @@
function do_hlight($txt, $lang = false, $sl, $content)
{
//fixed for PHP--------------------
- $txt=eregi_replace('<?','<',$txt);
+ $txt=preg_replace('#<?#i','<',$txt);
//---------------------------------
if(!($sl==false)){
$options = array('numbers' => HL_NUMBERS_LI, 'tabsize' => 4,);
@@ -142,9 +151,18 @@
function first_pre($content)
{
- $content = preg_replace('#\[code\](.*?)\[/code\]#sie', '$this->do_blocks(\'\\1\',false, $content);', $content);
- $content = preg_replace('#\[code lang=\\\"(.*?)\\\"\](.*?)\[/code\]#sie', '$this->do_blocks(\'\\2\', \'\\1\', $content);', $content);
- $content = preg_replace('#\[code lang=\\\"(.*?)\\\"\s*?-([0-9]*?)\](.*?)\[/code\]#sie', '$this->do_blocks_extend(\'\\3\', \'\\1\',\'\\2\', $content);', $content);
+ $content = preg_replace_callback(
+ '#\[code\](.*?)\[/code\]#si',
+ function($m){return $this->do_blocks($m[1],false, $content);},
+ $content);
+ $content = preg_replace_callback(
+ '#\[code lang=\\\"(.*?)\\\"\](.*?)\[/code\]#si',
+ function($m){return $this->do_blocks($m[2], $m[1], $content);},
+ $content);
+ $content = preg_replace_callback(
+ '#\[code lang=\\\"(.*?)\\\"\s*?-([0-9]*?)\](.*?)\[/code\]#si',
+ function($m){return $this->do_blocks_extend($m[3],$m[1],$m[2], $content);},
+ $content);
return $content;
}
--- old/wp-content/plugins/phphlstring/PEAR/Text/Highlighter.php 2005-08-14 20:36:08.000000000 +0900
+++ wp-content/plugins/phphlstring_0.9.9/PEAR/Text/Highlighter.php 2019-11-24 22:42:12.468698227 +0900
@@ -199,7 +199,7 @@
return PEAR::raiseError('Highlighter for ' . $lang . ' not found');
}
- $obj =& new $classname($options);
+ $obj = new $classname($options);
return $obj;
}
@@ -353,7 +353,7 @@
{
if (!($this->_renderer)) {
include_once('Text/Highlighter/Renderer/Html.php');
- $this->_renderer =& new Text_Highlighter_Renderer_Html($this->_options);
+ $this->_renderer = new Text_Highlighter_Renderer_Html($this->_options);
}
$this->_str = $str;
$this->_state = -1;