MoathObyiat / vqmod

Automatically exported from code.google.com/p/vqmod
0 stars 0 forks source link

Warning: strpos() Empty delimiter #20

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1.In xml I have empty CDATA like this <search 
position="before"><![CDATA[]]></search> or I tried it with spaces only

What is the expected output? 
Nothing.
What do you see instead?
php warning
vQmod Version:2.1.5

Please provide any additional information below.
Warning: strpos() [function.strpos]: Empty delimiter in vqmod\vqmod.php on line 
202
I replaced code on line 202 $pos = strpos($line, $mod['search']->getContent()); 
with
if('' == $mod['search']->getContent()) {$pos = false;}else{$pos = strpos($line, 
$mod['search']->getContent());}
works for me. This is my first time with vqmod and I have to say I like it very 
much. This issue is not so bad, it's just not 100% dumb proof.

Original issue reported on code.google.com by Narrowsk...@gmail.com on 1 Feb 2012 at 4:33

GoogleCodeExporter commented 8 years ago
The point is, you should not have an empty search tag. You can't find a match 
if you have nothing to match

Original comment by DJG6...@gmail.com on 1 Feb 2012 at 4:36

GoogleCodeExporter commented 8 years ago
Thank you!
this quick mod solved my problem in a one minute google search.

Original comment by mail4lj...@gmail.com on 9 Mar 2013 at 11:17