2
0
forked from Wavyzz/dolibarr

Fix sanitize website module

This commit is contained in:
Laurent Destailleur
2023-03-27 17:37:09 +02:00
parent a633766b23
commit e0cd351b3e
3 changed files with 31 additions and 4 deletions

View File

@@ -35,8 +35,10 @@ function dolStripPhpCode($str, $replacewith = '')
$newstr = '';
//split on each opening tag
$parts = explode('<?php', $str);
// Split on each opening tag
//$parts = explode('<?php', $str);
$parts = preg_split('/'.preg_quote('<?php', '/').'/i', $str);
if (!empty($parts)) {
$i = 0;
foreach ($parts as $part) {
@@ -77,8 +79,10 @@ function dolKeepOnlyPhpCode($str)
$newstr = '';
//split on each opening tag
$parts = explode('<?php', $str);
// Split on each opening tag
//$parts = explode('<?php', $str);
$parts = preg_split('/'.preg_quote('<?php', '/').'/i', $str);
if (!empty($parts)) {
$i = 0;
foreach ($parts as $part) {