There is an bug within the "filter module".
I always get the following error message:
----
warning: Invalid argument supplied for foreach() in /var/www/htdocs/drupal-5.5/modules/filter/filter.module on line 927.
-----
My "drupal" installation is a standard 5.5 installation. Server: Apache 2.2.3, PHP 5.2.0.
I found the bug:
within the function "theme_filter_tips" in ..../modules/filter/filter.module (around line 927) there is the "foreach" loop
foreach ($tips as $name => $tiplist)
6 Lines beneath the foreach (within the loop) the variable "tips" is made empty and is then used to hold the "tipstring".
$tips = '';
foreach ($tiplist as $tip) {
$tips .= '<li'. ($long ? ' id="filter-'. str_replace("/", "-", $tip['id']) .'">' : '>') . $tip['tip'] . '</li>';
}
The solution:
Use "$tipString" within the loop to hold the output string and do not use the "tips" variable for that.
Regards
Comment | File | Size | Author |
---|---|---|---|
#1 | 20080112.filter-tips-php-520.patch | 1.02 KB | Bart Jansens |
Comments
Comment #1
Bart Jansens CreditAttribution: Bart Jansens commentedApparently this is only an issue in some php versions, I wasn't able to reproduce it. But the code is ugly non the less.
Patch attached that uses a second variable with a different name.
Comment #2
drummI committed a straight backport from Drupal 6, which has solved this issue with slightly different code.