Bug tracker

This ticket has been moved to our new tracker. Open Ticket PHPBB3-2198 now.

typo in a fulltext_mysql.php recent commit by DavidMJ (fix completed in vcs)

[code]
while (($word = mb_ereg_search_regs()))
{
$text[] = $word[1];
}
[/text]
in this context $text is a string, so you can't assign a string to $text[].
most probably should be $text (without the brackets).

Comments / History

Posted by arod-1 on Mar 31st 2007, 16:23

also, few lines later:

$text = array_diff($text, $this->ignore_words);

as $text is not an array, this is clearly a bug.

Posted by arod-1 on Mar 31st 2007, 16:27

the first post should have been:
Code: Select all
while (($word = mb_ereg_search_regs()))
{
$text[] = $word[1];
}


again, no preview in bug tracker... :(

Assigned ticket to user "DavidMJ"

Action performed by Acyd Burn (Server Manager) on Mar 31st 2007, 16:27

Changed ticket status from "New" to "Fix completed in CVS"

Action performed by DavidMJ (Former Team Member) on Mar 31st 2007, 17:32

Posted by DavidMJ (Former Team Member) on Mar 31st 2007, 17:32

It changes from a string, to an array. I just forgot to initialize it.

Linked ticket with changeset: r7252

Action performed by DavidMJ (Former Team Member) on Mar 31st 2007, 17:33

Posted by arod-1 on Mar 31st 2007, 20:46

in general, this is not a recommended programming technique.
if $text holds a string when the function is called, and you want to have an array, it is largely preferable to use another variable (say $text_arr or something) to hold the array.
surprising the reader of the function this way may hold some entertainment value, but it's bad for readability and devastating for maintenance.

Posted by DavidMJ (Former Team Member) on Apr 1st 2007, 00:40

Sometime later, such an undertaking may be done on all of Olympus. However, there are bigger fish to fry right now ;)

Ticket details

Related SVN changesets