From 81d9d009484a19f17af92e085e0d990ab6eedae9 Mon Sep 17 00:00:00 2001 From: Krivchikov Dmitry Date: Sun, 9 Aug 2015 00:23:42 +0300 Subject: [PATCH] =?UTF-8?q?=D0=94=D0=BE=D0=B1=D0=B0=D0=B2=D0=BB=D0=B5?= =?UTF-8?q?=D0=BD=D0=B0=20=D0=B2=D0=BE=D0=B7=D0=BC=D0=BE=D0=B6=D0=BD=D0=BE?= =?UTF-8?q?=D1=81=D1=82=D1=8C=20=D0=B2=D1=81=D1=82=D0=B0=D0=B2=D0=BB=D1=8F?= =?UTF-8?q?=D1=82=D1=8C=20=D1=81=D1=81=D1=8B=D0=BB=D0=BA=D0=B8=20=D0=B2=20?= =?UTF-8?q?=D1=81=D0=BE=D0=BE=D1=82=D0=B2=D0=B5=D1=82=D1=81=D1=82=D0=B2?= =?UTF-8?q?=D0=B8=D0=B8=20=D1=81=20=D0=B2=D0=B8=D0=BA=D0=B8-=D1=80=D0=B0?= =?UTF-8?q?=D0=B7=D0=BC=D0=B5=D1=82=D0=BA=D0=BE=D0=B9=20-=20=D1=80=D0=B5?= =?UTF-8?q?=D0=B7=D0=B4=D0=B5=D0=BB=D0=B8=D1=82=D0=B5=D0=BB=D1=8C=20=D0=B2?= =?UTF-8?q?=D0=B5=D1=80=D1=82=D0=B8=D0=BA=D0=B0=D0=BB=D1=8C=D0=BD=D0=B0=20?= =?UTF-8?q?=D1=87=D0=B5=D1=80=D1=82=D0=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ground/classes/Helper.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/ground/classes/Helper.php b/ground/classes/Helper.php index e50f33c..404d866 100644 --- a/ground/classes/Helper.php +++ b/ground/classes/Helper.php @@ -10,12 +10,13 @@ class Helper public static function replaceLinks($string, $linkTemplate = '/page/point/id/') { - preg_match_all("(\[#(\d+)>?(.*?)\])", $string, $links); + preg_match_all("(\[#(\d+)[>\|](.*?)\])", $string, $links); $links = isset($links[0]) ? $links[0] : FALSE; if ($links) { foreach ($links as $link) { $idAndLink = mb_substr($link, 2, -1); - $idAndLink = explode('>', $idAndLink); + $delimiter = strpos($idAndLink, '|') === FALSE ? '>' : '|'; + $idAndLink = explode($delimiter, $idAndLink); $linkId = $idAndLink[0]; $linkName = isset($idAndLink[1]) ? $idAndLink[1] : '';