mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-07 20:08:53 +00:00
[ticket/13832] Do not use e modifier in message_parser
PHPBB3-13832
This commit is contained in:
parent
71f5c9c327
commit
1076b562dd
1 changed files with 12 additions and 4 deletions
|
@ -744,7 +744,9 @@ class bbcode_firstpass extends bbcode
|
|||
}
|
||||
|
||||
// To let the parser not catch tokens within quote_username quotes we encode them before we start this...
|
||||
$in = preg_replace('#quote="(.*?)"\]#ie', "'quote="' . str_replace(array('[', ']', '\\\"'), array('[', ']', '\"'), '\$1') . '"]'", $in);
|
||||
$in = preg_replace_callback('#quote="(.*?)"\]#i', function ($match) {
|
||||
return 'quote="' . str_replace(array('[', ']', '\\\"'), array('[', ']', '\"'), $match[1]) . '"]';
|
||||
}, $in);
|
||||
|
||||
$tok = ']';
|
||||
$out = '[';
|
||||
|
@ -1518,7 +1520,9 @@ class parse_message extends bbcode_firstpass
|
|||
);
|
||||
|
||||
$this->attachment_data = array_merge(array(0 => $new_entry), $this->attachment_data);
|
||||
$this->message = preg_replace('#\[attachment=([0-9]+)\](.*?)\[\/attachment\]#e', "'[attachment='.(\\1 + 1).']\\2[/attachment]'", $this->message);
|
||||
$this->message = preg_replace_callback('#\[attachment=([0-9]+)\](.*?)\[\/attachment\]#', function ($match) {
|
||||
return '[attachment='.($match[1] + 1).']' . $match[2] . '[/attachment]';
|
||||
}, $this->message);
|
||||
|
||||
$this->filename_data['filecomment'] = '';
|
||||
|
||||
|
@ -1586,7 +1590,9 @@ class parse_message extends bbcode_firstpass
|
|||
}
|
||||
|
||||
unset($this->attachment_data[$index]);
|
||||
$this->message = preg_replace('#\[attachment=([0-9]+)\](.*?)\[\/attachment\]#e', "(\\1 == \$index) ? '' : ((\\1 > \$index) ? '[attachment=' . (\\1 - 1) . ']\\2[/attachment]' : '\\0')", $this->message);
|
||||
$this->message = preg_replace_callback('#\[attachment=([0-9]+)\](.*?)\[\/attachment\]#', function ($match) use($index) {
|
||||
return ($match[1] == $index) ? '' : (($match[1] > $index) ? '[attachment=' . ($match[1] - 1) . ']' . $match[2] . '[/attachment]' : $match[0]);
|
||||
}, $this->message);
|
||||
|
||||
// Reindex Array
|
||||
$this->attachment_data = array_values($this->attachment_data);
|
||||
|
@ -1630,7 +1636,9 @@ class parse_message extends bbcode_firstpass
|
|||
);
|
||||
|
||||
$this->attachment_data = array_merge(array(0 => $new_entry), $this->attachment_data);
|
||||
$this->message = preg_replace('#\[attachment=([0-9]+)\](.*?)\[\/attachment\]#e', "'[attachment='.(\\1 + 1).']\\2[/attachment]'", $this->message);
|
||||
$this->message = preg_replace_callback('#\[attachment=([0-9]+)\](.*?)\[\/attachment\]#', function ($match) {
|
||||
return '[attachment=' . ($match[1] + 1) . ']' . $match[2] . '[/attachment]';
|
||||
}, $this->message);
|
||||
$this->filename_data['filecomment'] = '';
|
||||
|
||||
if (isset($this->plupload) && $this->plupload->is_active())
|
||||
|
|
Loading…
Add table
Reference in a new issue