PHP7 compatibility: replaced preg_replace /e with preg_replace_callback
This commit is contained in:
parent
d17beb5f48
commit
c9bf223180
|
@ -422,8 +422,8 @@ class serendipity_event_galleryimage extends serendipity_event
|
|||
}
|
||||
|
||||
function gimage_markup ($text, $case_sensitive=false) {
|
||||
$preg_flags = ($case_sensitive) ? 'e' : 'ei';
|
||||
$output = preg_replace("'\[GImage\s*([^\]]*)]([^[]*)\[/GImage]'$preg_flags", "\$this->gimage_thumb('\\2', trim('\\1'))", $text);
|
||||
$preg_flags = ($case_sensitive) ? '' : 'i';
|
||||
$output = preg_replace_callback("'\[GImage\s*([^\]]*)]([^[]*)\[/GImage]'$preg_flags", function($matches){ return $this->gimage_thumb($matches[2],trim($matches[1])); }, $text);
|
||||
|
||||
return $output;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue