1 (edited by 2012-02-02 10:28:29)

Topic: Editnews preg_match problem

Hi!,

I had the preg_match / eregi problem and i have replaced eregi by preg_match in the following code in editnews.mdu :

Line : 89

$title = !preg_match("/<[^>]*>/","",$title);

The titles of the news articles now show up as numers and these titles are all the same. They now all have the title "1".

Does anyone knows how to fix this issue?

Thank you!

Re: Editnews preg_match problem

preg_match function is used to search a string, not change it
try

$title = preg_replace("/<[^>]*>/","",$title);


Does that work?

Re: Editnews preg_match problem

preg_match function is used to search a string, not change it
try

$title = preg_replace("/<[^>]*>/","",$title);


Does that work?

Well yeah! that worked.

Thanks for the help Damoor, its appriciated!

Re: Editnews preg_match problem

Please use the UTF-8 CuteNews version, it is more stable, more secure and PHP 5.3 ready:

A good idea for users new to Cutenews but difficult for those who have added lots of hacks and extra code to 1.4.6.