forked from sbgodin/HtmGem
Fix possible XSS.
This commit is contained in:
parent
33839c0fbb
commit
bbfd7dc396
@ -12,6 +12,9 @@ $domain = $_SERVER['HTTP_HOST'];
|
||||
$php_self = $_SERVER['PHP_SELF']; // by default: /htmgem/index.php
|
||||
$php_self_dir = dirname($php_self);
|
||||
$url = @$_REQUEST["url"];
|
||||
|
||||
$style = htmlspecialchars(@$_REQUEST['style']);
|
||||
|
||||
$urlRewriting = @$_REQUEST["rw"]=="1";
|
||||
|
||||
/**
|
||||
@ -82,8 +85,6 @@ $fileContents = @file_get_contents($filePath);
|
||||
|
||||
/* CSS and special style management
|
||||
*/
|
||||
|
||||
$style = @$_REQUEST['style'];
|
||||
if ("source" == $style) {
|
||||
$basename = basename($filePath);
|
||||
header("Cache-Control: public");
|
||||
@ -129,5 +130,4 @@ if (empty($style)) {
|
||||
if ($urlRewriting)
|
||||
echo \htmgem\html\getHtmlWithMenu($gt_html, $scheme, $domain, $url);
|
||||
else
|
||||
echo \htmgem\html\getHtmlWithMenu($gt_html, $scheme, $domain, $url, "$php_self?url=");
|
||||
|
||||
echo \htmgem\html\getHtmlWithMenu($gt_html, $scheme, $domain, $url, "$php_self?url=");
|
Loading…
Reference in New Issue
Block a user