Jump to content

strpos() [function.strpos]: Empty delimiter


attila2452

Recommended Posts

I’m getting that warning on this site :http://lottoholic.com/soccer/

I’ve gone into the ftp and cheched the file and nothing seems to be out of order, i even compaired the file to another CBPress installment on another website, it’s the same file, same syntax, no error on the other site either. i’m thinking about copying and pasting the code from the one site to the next. but i don’t want to really mess things up. can someone give some advice?

here’s the code block.

 $new = array();            $chunks = $d;            $chunks = str_replace(' and', '. and', $chunks);            $chunks = str_replace(',', '.', $chunks);            $chunks = str_replace('!', '.', $chunks);            $chunks = explode('.',$chunks);            $words = $this->get_word_filter_array();            foreach($chunks as $sentence) {                $stop = 0;                foreach($words as $word) {                    $pos = strpos(strtolower($sentence), strtolower($word));                    if ($pos !== false) { $stop = 1; }                }                if(! $stop){                    $new[] = $sentence;                }            }            $new = implode('.',$new);            $d = $new;            if(trim($d) == '' || strlen(trim($d)) < 3){                $d = $this->title;            }        }

so that’s the code. Line 1385 is the line above “foreach($word as $word) {” .. yeah thats right.. the blank one.

class.prod.txt

Edited by Attila2452
Link to comment
Share on other sites

Your FTP client is duplicating all of the line breaks when you download the file, you should transfer files in binary mode instead of ASCII mode. I assume it's referring to this line, because it's actually using strpos:

 

$pos = strpos(strtolower($sentence), strtolower($word));

 

If it says the delimiter is empty, it is referring to the word. So, the word is empty. This is where it gets the words from:

 

$words = $this->get_word_filter_array();

 

I'm not sure what get_word_filter_array returns, but apparently it is returning a blank value for one of the words. Maybe there's a section in your control panel for the site where you list filter words or something like that, and one of them is blank (maybe a blank line or something).

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...