Browse Source

update: fix knowledge access data foreach

tokumeikoi 3 years ago
parent
commit
d5504354bc
2 changed files with 5 additions and 3 deletions
  1. 5 3
      app/Http/Controllers/User/KnowledgeController.php
  2. 0 0
      public/assets/admin/umi.css

+ 5 - 3
app/Http/Controllers/User/KnowledgeController.php

@@ -64,9 +64,11 @@ 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 $substr;}
-        $accessData = getBetween($body, '<!--access start-->', '<!--access end-->');
-        if ($accessData) {
-            $body = str_replace($accessData, '<div class="v2board-no-access">'. __('You must have a valid subscription to view content in this area') .'</div>', $body);
+        while (strpos($body, '<!--access start-->') !== false) {
+            $accessData = '<!--access start-->' . getBetween($body, '<!--access start-->', '<!--access end-->') . '<!--access end-->';
+            if ($accessData) {
+                $body = str_replace($accessData, '<div class="v2board-no-access">'. __('You must have a valid subscription to view content in this area') .'</div>', $body);
+            }
         }
     }
 }

File diff suppressed because it is too large
+ 0 - 0
public/assets/admin/umi.css


Some files were not shown because too many files changed in this diff