From a806ad27d8fac246101a5d0ebc40b8352ee3e4cc Mon Sep 17 00:00:00 2001 From: vargenau Date: Wed, 28 Nov 2012 09:55:05 +0000 Subject: [PATCH] Add {} git-svn-id: svn://svn.code.sf.net/p/phpwiki/code/trunk@8564 96ab9672-09ca-45d6-a79d-3d69d39ca109 --- lib/plugin/SyntaxHighlighter.php | 26 +++++++++++++++++++------- 1 file changed, 19 insertions(+), 7 deletions(-) diff --git a/lib/plugin/SyntaxHighlighter.php b/lib/plugin/SyntaxHighlighter.php index 0a4421bbd..106451ff4 100644 --- a/lib/plugin/SyntaxHighlighter.php +++ b/lib/plugin/SyntaxHighlighter.php @@ -100,7 +100,9 @@ class WikiPlugin_SyntaxHighlighter // It is important that you close any pipes before calling // proc_close in order to avoid a deadlock $return_value = proc_close($process); - if (empty($buf)) printXML($this->error($stderr)); + if (empty($buf)) { + printXML($this->error($stderr)); + } return $buf; } } @@ -114,21 +116,31 @@ class WikiPlugin_SyntaxHighlighter } if (!empty($source)) { $args = ""; - if (defined('HIGHLIGHT_DATA_DIR')) + if (defined('HIGHLIGHT_DATA_DIR')) { $args .= " --data-dir " . HIGHLIGHT_DATA_DIR; - if ($number != 0) $args .= " -l"; - if ($wrap != 0) $args .= " -V"; + } + if ($number != 0) { + $args .= " -l"; + } + if ($wrap != 0) { + $args .= " -V"; + } $html = HTML(); if (!empty($color) and !preg_match('/^[\w-]+$/', $color)) { $html->pushContent($this->error(fmt("invalid %s ignored", 'color'))); $color = false; } - if (!empty($color)) $args .= " --style $color --inline-css"; - if (!empty($style)) $args .= " -F $style"; + if (!empty($color)) { + $args .= " --style $color --inline-css"; + } + if (!empty($style)) { + $args .= " -F $style"; + } $commandLine = HIGHLIGHT_EXE . "$args -q -X -f -S $syntax"; $code = $this->newFilterThroughCmd($source, $commandLine); - if (empty($code)) + if (empty($code)) { return $this->error(fmt("Couldn't start commandline '%s'", $commandLine)); + } $pre = HTML::pre(HTML::raw($code)); $html->pushContent($pre); return HTML($html); -- 2.45.0