Deprecated: str_replace(): Passing null to parameter #3 ($subject) of type array|string is deprecated in /var/www/mybb-es.com/html/inc/plugins/avatarep.php on line 1102

Deprecated: str_replace(): Passing null to parameter #3 ($subject) of type array|string is deprecated in /var/www/mybb-es.com/html/inc/class_language.php on line 201
Trocar img tag em link nos quote posts
martec   12 Feb, 2012, 3:18 pm
#1
Olá...

tenho um probleminha para resolver.

Eu consigo remover o img tag nos quotes posts usando isso:

http://community.mybb.com/thread-87961-p...#pid643415

e isso em ajax quot

http://community.mybb.com/thread-35320-p...#pid237049

Só que quando mudo o código

Código PHP:
<?php 
$message
= preg_replace("#\[img\](\r\n?|\n?)(https?://([^<>\"']+?))\[/img\]#ise", "", $message);

para isso (no intuito de poder trocar por um link)

Código PHP:
<?php 
$message
= preg_replace("#\[img\](\r\n?|\n?)(https?://([^<>\"']+?))\[/img\]#ise", "\(Image: $2)\n", $message);

o plugin deixa de funionar.

Ou seja se eu adiciono \(Image: $2)\n o plugin dá problema.
Alguém poderia me ajudar a solucionar o problema?

o código do plugin seria isso:

Código PHP:
<?php

if(!defined("IN_MYBB"))
{
die(
"Direct initialization of this file is not allowed.<br /><br />Please make sure IN_MYBB is defined.");
}

/**
* Plugin info
*
*/
function no_image_quote_info()
{
return array(
"name" => "no image quote",
"description" => "",
"website" => "",
"author" => "",
"authorsite" => "",
"version" => "0.1",
"guid" => "",
"compatibility" => "16*"
);
}

$plugins->add_hook('xmlhttp', 'no_image_quote_do');

function
no_image_quote_do()
{
global
$mybb;
if(
$mybb->input['action'] != 'get_multiquoted') return;
ob_start();

function
no_image_quote_do_shutdown()
{
global
$message;
if(!
$message)
{
ob_end_flush();
return;
}

ob_end_clean();
$message = preg_replace("#\[img\](\r\n?|\n?)(https?://([^<>\"']+?))\[/img\]#ise", "", $message);
echo
$message;
}
register_shutdown_function('no_image_quote_do_shutdown');
}
?>

desde já grato.
  
Powered By MyBB, © 2002-2025 MyBB Group.
Made with by Curves UI.