mirror of
https://github.com/Combodo/iTop.git
synced 2026-05-20 15:52:24 +02:00
N°8681 - PHP 8.1: Fix deprecated notice for null value passed to preg_match_all()
This commit is contained in:
@@ -4259,6 +4259,9 @@ class AttributeText extends AttributeString
|
|||||||
|
|
||||||
public static function RenderWikiHtml($sText, $bWikiOnly = false)
|
public static function RenderWikiHtml($sText, $bWikiOnly = false)
|
||||||
{
|
{
|
||||||
|
// N°8681 - Ensure to have a string value
|
||||||
|
$sText = $sText ?? '';
|
||||||
|
|
||||||
if (!$bWikiOnly) {
|
if (!$bWikiOnly) {
|
||||||
$sPattern = '/'.str_replace('/', '\/', utils::GetConfig()->Get('url_validation_pattern')).'/i';
|
$sPattern = '/'.str_replace('/', '\/', utils::GetConfig()->Get('url_validation_pattern')).'/i';
|
||||||
if (preg_match_all(
|
if (preg_match_all(
|
||||||
|
|||||||
@@ -266,6 +266,9 @@ class InlineImage extends DBObject
|
|||||||
*/
|
*/
|
||||||
public static function FixUrls($sHtml)
|
public static function FixUrls($sHtml)
|
||||||
{
|
{
|
||||||
|
// N°8681 - Ensure to have a string value
|
||||||
|
$sHtml = $sHtml ?? '';
|
||||||
|
|
||||||
$aNeedles = [];
|
$aNeedles = [];
|
||||||
$aReplacements = [];
|
$aReplacements = [];
|
||||||
// Find img tags with an attribute data-img-id
|
// Find img tags with an attribute data-img-id
|
||||||
|
|||||||
Reference in New Issue
Block a user