mirror of
https://github.com/cedar2025/Xboard.git
synced 2025-01-22 18:48: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)
|
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;}
|
$pattern = '/<!--access start-->(.*?)<!--access end-->/s';
|
||||||
while (strpos($body, '<!--access start-->') !== false) {
|
$replacement = '<div class="v2board-no-access">' . __('You must have a valid subscription to view content in this area') . '</div>';
|
||||||
$accessData = getBetween($body, '<!--access start-->', '<!--access end-->');
|
$body = preg_replace($pattern, $replacement, $body);
|
||||||
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);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user