Skip to content

Commit

Permalink
upnp: fix racy redeclaration of function by bringing back this hack
Browse files Browse the repository at this point in the history
  • Loading branch information
fichtner committed Apr 8, 2015
1 parent 91692c7 commit 4358b85
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/etc/inc/functions.inc
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@ function gettext($text)
return $text;
}
}
/* END compatibility goo with HEAD */

if (!function_exists('redirectHeader')) {
function redirectHeader($text)
{
global $_SERVER;
Expand All @@ -61,6 +61,8 @@ function redirectHeader($text)
header("Location: $text");
}
}
}
/* END compatibility goo with HEAD */

function get_menu_messages()
{
Expand Down

4 comments on commit 4358b85

@AdSchellevis
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

did I miss something? I can't find the other declaration in the code.

@fichtner
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The code races with pkg_edit.php (I think upnp) when clicking the main page shortcut. Some require vs. require_once issue I guess. The function_exists() code was previously there. Couldn't pin this down any further. :(

@fichtner
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@AdSchellevis
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, weird.... I had the same issue before I remove the extra redirectHeader that was in pkg_edit.php.

/* dummy stubs needed by some code that was MFC'd */
function redirectHeader($location) { header("Location: " . $location); }

But when I dropped that one, all worked fine at my end... weird.... but not worth looking into :-)

Please sign in to comment.