Skip to content

Commit

Permalink
Potential Fix for issue #87
Browse files Browse the repository at this point in the history
  • Loading branch information
BSteelooper committed Nov 8, 2019
1 parent 9d6e7a8 commit 49fe71e
Showing 1 changed file with 17 additions and 3 deletions.
20 changes: 17 additions & 3 deletions data/inc/functions.admin.php
Original file line number Diff line number Diff line change
Expand Up @@ -651,8 +651,22 @@ function check_update_version($version) {
*/

function requestedByTheSameDomain() {
$myDomain = $_SERVER['SCRIPT_URI'];
$requestsSource = $_SERVER['HTTP_REFERER'];
if(isset($_SERVER['SCRIPT_URI'])){
$myDomain = $_SERVER['SCRIPT_URI'];
} elseif(isset($_SERVER['SCRIPT_URI'])){
$myDomain = $_SERVER['SCRIPT_URI'];
} else {
$myDomain = $null;
}
if(isset($_SERVER['HTTP_REFERER'])){
$requestsSource = $_SERVER['HTTP_REFERER'];
} else {
$requestsSource = $null;
}

return parse_url($myDomain, PHP_URL_HOST) === parse_url($requestsSource, PHP_URL_HOST);
if ($mydomain != $null and $requestsSource != $null ){
return parse_url($myDomain, PHP_URL_HOST) === parse_url($requestsSource, PHP_URL_HOST);
} else {
show_error("Be carefull with clicking links, they might compromise your website. Your installation is not secured with measures to protect it.", 1);
}
}

0 comments on commit 49fe71e

Please sign in to comment.