In cases like this, image 1 and image 2 are replaced but image 3 is not. I'm guessing that it has to do with the ungreedy preg matching that matches up to the first closing quote tag of the inner quote.Outer Quote wrote:image1image 3Inner Quote wrote:image 2
HelloMOD Robot wrote: Download file: convert_quoted_images_to_url_1.0.1.zip
File size: 29733 Bytes
Thanks. The same download link nows gets me the correct mod.Ger wrote:Seems only the version information at the top isn't changed, but when you open MOD history, you'll see its 1.0.1.
It definitely doesn't say "quote removal".
Code: Select all
$qres = preg_replace('#\[img\](.*)\[/img\]#iU', '[ [url=\1]'. $user->lang['IMAGE'] .'[/url] ]', $qmatchin);
Code: Select all
$replacement = preg_replace('#\[youtube\]\n*(.*)\n*\[/youtube\]#iU', '[url=$1]Writer posted a YouTube video[/url]', $replacement); // RupertGee Addition
Code: Select all
if ($mode == 'quote' && !$submit && !$preview && !$refresh)
{
$message_parser->message = '[quote="' . $post_data['quote_username'] . '"]' . censor_text(trim($message_parser->message)) . "[/quote]\n";
}
Code: Select all
//Start SFB MOD convert quoted images to url
if ($mode == 'quote' && !$submit && !$preview && !$refresh)
{
$inmessage = censor_text(trim($message_parser->message));
preg_match_all('#\[code\](.*?)\[/code\]#is', $inmessage, $qcode);
$crepl = str_replace('[img]', '[img]', $qcode[1]);
$replacement = str_replace($qcode[1], $crepl, $inmessage);
$replacement = preg_replace('#\[url=\n*(.*(jpg|jpeg|gif|png|bmp))\n*\]\n*\[img\]\n*(.*)\n*\[/img\]\n*\[/url\]#iU', '[ [url=$1]'. $user->lang['IMAGE'] .'[/url] ]', $replacement);
$replacement = preg_replace('#\[url=\n*(.*)\n*\]\n*\[img\]\n*(.*)\n*\[/img\]\n*\[/url\]#iU', '[ [url=$1]'. $user->lang['IMAGE'] .'[/url] ]', $replacement);
$replacement = preg_replace('#\[img\]\n*(.*)\n*\[/img\]#iU', '[ [url=$1]'. $user->lang['IMAGE'] .'[/url] ]', $replacement);
$inmessage = str_replace($inmessage, $replacement, $inmessage);
$inmessage = str_replace($crepl, $qcode[1], $inmessage);
$message_parser->message = '[quote="' . $post_data['quote_username'] . '"]' . $inmessage . "[/quote]\n";
}
/*
if ($mode == 'quote' && !$submit && !$preview && !$refresh)
{
$message_parser->message = '[quote="' . $post_data['quote_username'] . '"]' . censor_text(trim($message_parser->message)) . "[/quote]\n";
}
*/
//End SFB MOD convert quoted images into url
Code: Select all
[phpBB Debug] PHP Notice: in file /posting.php on line 1398: Array to string conversion
[phpBB Debug] PHP Notice: in file /posting.php on line 1398: Undefined variable: Array
[phpBB Debug] PHP Notice: in file /posting.php on line 1398: Array to string conversion
Code: Select all
$inmessage = str_replace($$crepl, $qcode[1], $inmessage);