From 6c21f36d778d714fbdfbe20e8642c489f955d140 Mon Sep 17 00:00:00 2001 From: mappu Date: Sun, 23 Apr 2017 18:42:09 +1200 Subject: [PATCH] fix [entry] tag targets --- lib/CProject.php | 7 +++++++ lib/util.php | 1 - 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/lib/CProject.php b/lib/CProject.php index 64b09ad..5ad7594 100644 --- a/lib/CProject.php +++ b/lib/CProject.php @@ -83,6 +83,13 @@ class CProject { if (preg_match('~Tags: ([^\\n]+)~', $this->longdesc, $matches)) { $this->tags = array_map('trim', explode(',', $matches[1])); } + + // Find `entry` tags + $this->longdesc = preg_replace( + '~\\[entry=([^\\]]+?)\\](.+?)\\[/entry\\]~m', + '[url='.BASEURL.'\\1/]\\2[/url]', // hesc still hasn't happened, transform bbcode->bbcode + $this->longdesc + ); // Extract short description $parts = explode("\n", $this->longdesc); diff --git a/lib/util.php b/lib/util.php index 756eff6..8204994 100644 --- a/lib/util.php +++ b/lib/util.php @@ -138,7 +138,6 @@ function text2html($sz) { $base = preg_replace('~\\[b\\](.+?)\\[/b\\]~m', '\\1', $base); $base = preg_replace('~\\[i\\](.+?)\\[/i\\]~m', '\\1', $base); $base = preg_replace('~\\[spoiler\\](.+?)\\[/spoiler\\]~m', '\\1', $base); - $base = preg_replace('~\\[entry=([^\\]]+?)\\](.+?)\\[/entry\\]~m', '\\2', $base); $base = preg_replace('~\n- ~ms', "\n• ", $base); $btparts = explode('`', $base);