After installing the latest version of 6.x-1.x-dev (that was published on 2009-Mar-15) my site went offline since all requests resulted in the following error message:
PHP Parse error: syntax error, unexpected '&', expecting T_VARIABLE or '$' in /var/www/sites/all/modules/path_redirect/path_redirect.module on line 280
The culprit is the following line (occuring twice in the mentioned version of path_redirect.module):
foreach ($where as $key => &$value) {
The &$value syntax is a PHP5 feature and I'm using PHP4.
Removing the "&" (thus having just $value in these lines) fixes the problem.
I've attached a patch made against the mentioned release.
| Comment | File | Size | Author |
|---|---|---|---|
| path_redirect.patch | 644 bytes | müzso |
Comments
Comment #1
dave reidWell, crap. This is why I hate PHP4. Patch will not work because the value needs to be modified.
Comment #2
dave reidThanks for the report. Fixed using
Comment #3
müzso commentedYes. I've noticed it too after having tested the fix on two Drupal sites.
Interestingly even my patch seemed to work on one site :-o (I don't know why, don't ask me :-) ) and it failed on another one. That's one of the reasons that I only spotted the problem a bit later (and the other one is that I've been out of practise with PHP for the last year or so).
Comment #4
dave reidYeah, not sure why it worked. :) I found a couple places in some of my other modules where I did this. Thanks again for the report. :)