mirror of
https://github.com/cedar2025/Xboard.git
synced 2025-01-22 10:38:14 -05:00
fix: 修复知识库 access start 在webman中重新定义的问题
This commit is contained in:
parent
4c1c024afa
commit
638dbef30a
@ -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, '<!--access start-->') !== false) {
|
||||
$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);
|
||||
}
|
||||
}
|
||||
$pattern = '/<!--access start-->(.*?)<!--access end-->/s';
|
||||
$replacement = '<div class="v2board-no-access">' . __('You must have a valid subscription to view content in this area') . '</div>';
|
||||
$body = preg_replace($pattern, $replacement, $body);
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user