From: <var...@us...> - 2012-11-23 20:46:49
|
Revision: 8532 http://phpwiki.svn.sourceforge.net/phpwiki/?rev=8532&view=rev Author: vargenau Date: 2012-11-23 20:46:41 +0000 (Fri, 23 Nov 2012) Log Message: ----------- highlight_string does not return <font> in PHP 5 Modified Paths: -------------- trunk/lib/plugin/PhpHighlight.php Modified: trunk/lib/plugin/PhpHighlight.php =================================================================== --- trunk/lib/plugin/PhpHighlight.php 2012-11-23 20:17:48 UTC (rev 8531) +++ trunk/lib/plugin/PhpHighlight.php 2012-11-23 20:46:41 UTC (rev 8532) @@ -91,8 +91,7 @@ $this->set_colors($string, $comment, $keyword, $bg, $default, $html); if ($wrap) { - /* Wrap with "<?php\n" and "\n?>" required by - * highlight_string(): */ + /* Wrap with "<?php\n" and "\n?>" required by highlight_string(): */ $source = "<?php\n" . $source . "\n?>"; } else { $source = str_replace(array('< ?php', '? >'), @@ -101,23 +100,18 @@ $str = highlight_string($source, true); - if ($wrap) + if ($wrap) { /* Remove "<?php\n" and "\n?>" again: */ $str = str_replace(array('<?php<br />', '?>'), '', $str); + } - /* We might have made some empty font tags. */ + /* Remove empty span tags. */ foreach (array($string, $comment, $keyword, $bg, $default, $html) as $color) { - $search = "<font color=\"$color\"></font>"; - $str = str_replace($search, '', $str); - } - /* Remove also empty span tags. */ - foreach (array($string, $comment, $keyword, $bg, $default, $html) as $color) { $search = "<span style=\"color: $color\"></span>"; $str = str_replace($search, '', $str); } - /* restore default colors in case of multiple invocations of - this plugin on one page */ + /* restore default colors in case of multiple invocations of this plugin on one page */ $this->restore_colors(); return new RawXml($str); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <var...@us...> - 2012-11-28 11:04:46
|
Revision: 8569 http://phpwiki.svn.sourceforge.net/phpwiki/?rev=8569&view=rev Author: vargenau Date: 2012-11-28 11:04:40 +0000 (Wed, 28 Nov 2012) Log Message: ----------- Add error message: Please provide source code to PhpHighlight plugin Modified Paths: -------------- trunk/lib/plugin/PhpHighlight.php Modified: trunk/lib/plugin/PhpHighlight.php =================================================================== --- trunk/lib/plugin/PhpHighlight.php 2012-11-28 10:48:55 UTC (rev 8568) +++ trunk/lib/plugin/PhpHighlight.php 2012-11-28 11:04:40 UTC (rev 8569) @@ -86,6 +86,10 @@ extract($this->getArgs($argstr, $request)); $source =& $this->source; + if (empty($source)) { + return HTML::div(array('class' => "error"), + "Please provide source code to PhpHighlight plugin"); + } $this->sanify_colors($string, $comment, $keyword, $bg, $default, $html); $this->set_colors($string, $comment, $keyword, $bg, $default, $html); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <var...@us...> - 2014-06-11 16:02:44
|
Revision: 8887 http://sourceforge.net/p/phpwiki/code/8887 Author: vargenau Date: 2014-06-11 16:02:40 +0000 (Wed, 11 Jun 2014) Log Message: ----------- Avoid backslash Modified Paths: -------------- trunk/lib/plugin/PhpHighlight.php Modified: trunk/lib/plugin/PhpHighlight.php =================================================================== --- trunk/lib/plugin/PhpHighlight.php 2014-06-11 16:01:40 UTC (rev 8886) +++ trunk/lib/plugin/PhpHighlight.php 2014-06-11 16:02:40 UTC (rev 8887) @@ -79,7 +79,7 @@ /* Remove empty span tags. */ foreach (array($string, $comment, $keyword, $bg, $default, $html) as $color) { - $search = "<span style=\"color: $color\"></span>"; + $search = '<span style="color: '.$color.'></span>'; $str = str_replace($search, '', $str); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |