Closed Bug 619189 Opened 14 years ago Closed 13 years ago

PHP variable error for 'downloadrefresh' when loading pages (once per http session)

Categories

(Camino Graveyard :: Product Site, defect)

All
macOS
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: alqahira, Assigned: moz)

References

()

Details

NR mentioned this error when they were piddling around; I saw it today while poking error_log:

[Tue Dec 14 14:23:34 2010] [error] [client 86.0.136.227] PHP Notice:  Undefined variable: downloadrefresh in /www/cbo-www/inc/header_inc.php on line 17, referer: http://caminobrowser.org/download/

This only seems to be triggered once per http session, and obviously on pages where $downloadrefresh is not defined.

The header_inc line in question is:

17 <?php if ( $downloadrefresh == "1" ) {
18     echo "<meta http-equiv=\"refresh\" content=\"3;url=$downloadurl\">
19     
20     ";
21 } ?>

Have we switched PHP versions, and did syntax switch between them?
We definitely did switch PHP versions, but I can't answer the syntax question. I kind of wonder if this just needs an "else" statement that does nothing or if we have to define $downloadrefresh as "0" on every page that doesn't need an automatic refresh.
Ahh... This happens because we define $downloadrefresh *after* we parse an if statement for it. That's because we have to put the if statement in the header include (to place the meta tag in it) and the value in the main file because it varies by page. I'm not entirely sure how to fix this... I'll have to think about it.

(Note also that I'm testing things on www-stage for this and bug 619195.)
Change line 17 from

<?php if ( $downloadrefresh == "1" ) {

to

<?php if ( isset($downloadrefresh) && $downloadrefresh == "1" ) {
Deployed; thanks!  I look forward to that log file getting smaller :D
Assignee: samuel.sidler → moz
Status: NEW → RESOLVED
Closed: 13 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.