diff --git a/app/Http/Controllers/V1/User/KnowledgeController.php b/app/Http/Controllers/V1/User/KnowledgeController.php index 96b8778..7d345e3 100644 --- a/app/Http/Controllers/V1/User/KnowledgeController.php +++ b/app/Http/Controllers/V1/User/KnowledgeController.php @@ -62,12 +62,8 @@ class KnowledgeController extends Controller private function formatAccessData(&$body) { - function getBetween($input, $start, $end){$substr = substr($input, strlen($start)+strpos($input, $start),(strlen($input) - strpos($input, $end))*(-1));return $start . $substr . $end;} - while (strpos($body, '') !== false) { - $accessData = getBetween($body, '', ''); - if ($accessData) { - $body = str_replace($accessData, '
'. __('You must have a valid subscription to view content in this area') .'
', $body); - } - } + $pattern = '/(.*?)/s'; + $replacement = '
' . __('You must have a valid subscription to view content in this area') . '
'; + $body = preg_replace($pattern, $replacement, $body); } }