浏览代码

update: fix knowledge access data foreach

tokumeikoi 3 年之前
父节点
当前提交
d5504354bc
共有 2 个文件被更改,包括 5 次插入3 次删除
  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);
+            }
         }
     }
 }

文件差异内容过多而无法显示
+ 0 - 0
public/assets/admin/umi.css


部分文件因为文件数量过多而无法显示