PDA

View Full Version : BB Code PHP Error


Bulent Tekcan
05-16-2017, 12:31 PM
Hello

I'm using this code in class_bbcode.php. This is for IMG to URL convert

// Start IMG to URL BBCode Converter
if ($this->contains_bbcode_img_tags($message))
{
$message = preg_replace('#\[img\]\s*(https?://([^<>*"]+|[a-z0-9/\\._\- !]+))\[/img\]#iUe', "\$this->handle_bbcode_url(str_replace('\\\"', '\"', '\\1'), '')", $message);
}
// End IMG to URL BBCode ConverterBut I get this error from php

PHP Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/includes/class_bbcode.php on line 1866

Any idea what is the problem in that code ? Before my php is old and I never see any problem.

Regards

MarkFL
05-16-2017, 12:41 PM
The best thing to do here is to upgrade your vB to a version that is compatible with the PHP you are using now.

Bulent Tekcan
05-16-2017, 12:46 PM
But my vB also compatible my php version. Only that code seems to be old. I think preg_replace changed in php 5.6. But how can I correct that code I don't know.

Maybe preg_replace change to preg_replace_callback ?

MarkFL
05-16-2017, 12:47 PM
What are your vB and PHP version numbers?