I added the debugging line in this snippet from set_string():

    if (isset($string['title'])) {
      $this->title = $string['title'];
    }         
    if ($this->title == 'Y') {
      dsm("string = '$string' and this->title == 'Y'");
    }

With PHP 5.3.3, I get this screen shot. Apparently, when $string is a string, $string['title'] evaluates to the first character of the string. I do not see this with PHP 5.3.22.

screen shot with debug output

I will attach a patch as soon as I have an issue number.

Comments

benjifisher’s picture

StatusFileSize
new797 bytes

The attached patch adds a test for is_array($string). I also made a similar change in string_filter() later on. This may not be needed, but it should not cause any problems, either.

benjifisher’s picture

Issue summary: View changes

Show the screen shot in-line.

benjifisher’s picture

Issue summary: View changes
Status: Active » Needs review

Setting the status to NR.

benjifisher’s picture

Issue summary: View changes

Cleaning up the description. How did that get in there?

jose reyero’s picture

StatusFileSize
new573 bytes

Right about the issue in the first function, though it can be fixed just by some reordering, see attached patch.

About the second one, the parameter *must* be an array, so if it is not, the bug is somewhere else.

guillaumeduveau’s picture

Status: Needs review » Reviewed & tested by the community

Patch in #4 applies and seems OK to me.

jose reyero’s picture

Status: Reviewed & tested by the community » Fixed

Great, thanks for the review.

Committed the patch #4 with some api documentation updates for the string_filter() method.

Thanks.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.