mirror of
https://github.com/friendica/friendica
synced 2024-11-10 07:02:54 +00:00
For very large posts (~18k) with lots of markup, these regexes were causing enough backtracking for php to run out of memory, silently generating an empty entry. This tightens up the regexes so they do less backtracking.
This commit is contained in:
parent
52614bd72b
commit
63be0062b6
1 changed files with 2 additions and 2 deletions
|
@ -642,8 +642,8 @@ function bbcode($Text,$preserve_nl = false, $tryoembed = true, $simplehtml = fal
|
|||
$Text = preg_replace('/\"\;/','"',$Text);
|
||||
|
||||
// fix any escaped ampersands that may have been converted into links
|
||||
$Text = preg_replace("/\<(.*?)(src|href)=(.*?)\&\;(.*?)\>/ism",'<$1$2=$3&$4>',$Text);
|
||||
$Text = preg_replace("/\<(.*?)(src|href)=\"[^hfm](.*?)\>/ism",'<$1$2="">',$Text);
|
||||
$Text = preg_replace("/\<([^>]*?)(src|href)=(.*?)\&\;(.*?)\>/ism",'<$1$2=$3&$4>',$Text);
|
||||
$Text = preg_replace("/\<([^>]*?)(src|href)=\"[^hfm](.*?)\>/ism",'<$1$2="">',$Text);
|
||||
|
||||
if($saved_image)
|
||||
$Text = bb_replace_images($Text, $saved_image);
|
||||
|
|
Loading…
Reference in a new issue