aboutsummaryrefslogtreecommitdiffstats
path: root/include/text.php
diff options
context:
space:
mode:
authorMario Vavti <mario@mariovavti.com>2016-06-17 10:04:27 +0200
committerMario Vavti <mario@mariovavti.com>2016-06-17 10:04:27 +0200
commit0324bc5cf0fe6a758070cdc74897836758187b30 (patch)
treec7e8fc672f83950aa61dd97b5fb0d22a108097b8 /include/text.php
parent5b479d63d62ef893360fd210947012310e8f9755 (diff)
parentf6d76282549c562120417cbdd111109add4f7672 (diff)
downloadvolse-hubzilla-0324bc5cf0fe6a758070cdc74897836758187b30.tar.gz
volse-hubzilla-0324bc5cf0fe6a758070cdc74897836758187b30.tar.bz2
volse-hubzilla-0324bc5cf0fe6a758070cdc74897836758187b30.zip
Merge branch 'dev' into sabre32
Diffstat (limited to 'include/text.php')
-rw-r--r--include/text.php5
1 files changed, 5 insertions, 0 deletions
diff --git a/include/text.php b/include/text.php
index 59190a9ca..50a3d8892 100644
--- a/include/text.php
+++ b/include/text.php
@@ -2899,6 +2899,11 @@ function text_highlight($s,$lang) {
$tag_added = false;
$s = trim(html_entity_decode($s,ENT_COMPAT));
$s = str_replace(" ","\t",$s);
+
+ // The highlighter library insists on an opening php tag for php code blocks. If
+ // it isn't present, nothing is highlighted. So we're going to see if it's present.
+ // If not, we'll add it, and then quietly remove it after we get the processed output back.
+
if($lang === 'php') {
if(strpos('<?php',$s) !== 0) {
$s = '<?php' . "\n" . $s;