Skip to content

Commit

Permalink
# Make $panel safe for all instances that are used in the control.php…
Browse files Browse the repository at this point in the history
… script.
  • Loading branch information
mmakaay committed Mar 10, 2009
1 parent ea45bab commit 3968679
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions control.php
Expand Up @@ -55,6 +55,9 @@
$panel = PHORUM_CC_SUMMARY;
}

$panel = htmlspecialchars(
basename($panel), ENT_COMPAT, $PHORUM["DATA"]["HCHARSET"]
);

// Set all our URLs.
phorum_build_common_urls();
Expand Down Expand Up @@ -131,7 +134,7 @@
$PHORUM["DATA"]["PROFILE"]["forum_id"] = isset($PHORUM["forum_id"]) ? $PHORUM['forum_id'] : 0;
$PHORUM["DATA"]["PROFILE"]["PANEL"] = $panel;
// used in nearly all or all cc-panels
$PHORUM['DATA']['POST_VARS'].="<input type=\"hidden\" name=\"panel\" value=\"".htmlspecialchars($panel, ENT_COMPAT, $PHORUM["DATA"]["HCHARSET"])."\" />\n";
$PHORUM['DATA']['POST_VARS'].="<input type=\"hidden\" name=\"panel\" value=\"$panel\" />\n";

// Set the back-URL and -message.
if ($PHORUM['forum_id'] > 0 && $PHORUM['folder_flag'] == 0) {
Expand All @@ -147,7 +150,6 @@
}

// Load the code for the current panel.
$panel = basename($panel);
/**
* [hook]
* cc_panel
Expand Down

0 comments on commit 3968679

Please sign in to comment.