Changeset View
Changeset View
Standalone View
Standalone View
core/kernel/utility/http_query.php
Show First 20 Lines • Show All 437 Lines • ▼ Show 20 Line(s) | |||||
*/ | */ | ||||
function refererIsOurSite() | function refererIsOurSite() | ||||
{ | { | ||||
if ( !array_key_exists('HTTP_REFERER', $_SERVER) ) { | if ( !array_key_exists('HTTP_REFERER', $_SERVER) ) { | ||||
// no referer -> don't care what happens | // no referer -> don't care what happens | ||||
return false; | return false; | ||||
} | } | ||||
/** @var SiteHelper $site_helper */ | |||||
$site_helper = $this->Application->recallObject('SiteHelper'); | $site_helper = $this->Application->recallObject('SiteHelper'); | ||||
/* @var $site_helper SiteHelper */ | |||||
$found = false; | $found = false; | ||||
$http_referer = $_SERVER['HTTP_REFERER']; | $http_referer = $_SERVER['HTTP_REFERER']; | ||||
preg_match('/^(.*?):\/\/(.*?)(\/|$)/', $http_referer, $regs); // 1 - protocol, 2 - domain | preg_match('/^(.*?):\/\/(.*?)(\/|$)/', $http_referer, $regs); // 1 - protocol, 2 - domain | ||||
if ($regs[1] == 'https') { | if ($regs[1] == 'https') { | ||||
$found = $site_helper->getDomainByName('SSLUrl', $http_referer) > 0; | $found = $site_helper->getDomainByName('SSLUrl', $http_referer) > 0; | ||||
▲ Show 20 Lines • Show All 98 Lines • ▼ Show 20 Line(s) | |||||
/** | /** | ||||
* Overwrites GET events with POST events in case if they are set and not empty | * Overwrites GET events with POST events in case if they are set and not empty | ||||
* | * | ||||
* @return void | * @return void | ||||
* @access protected | * @access protected | ||||
*/ | */ | ||||
protected function convertPostEvents() | protected function convertPostEvents() | ||||
{ | { | ||||
/** @var Array $events */ | |||||
$events = $this->Get('events', Array ()); | $events = $this->Get('events', Array ()); | ||||
Lint: CodingStandard.Array.Array.SpaceAfterKeyword: There must be no space between the Array keyword and the opening parenthesis | |||||
PHP keywords must be lowercase; expected "array" but found "Array" Lint: Generic.PHP.LowerCaseKeyword.Found: PHP keywords must be lowercase; expected "array" but found "Array" | |||||
/* @var $events Array */ | |||||
if ( is_array($events) ) { | if ( is_array($events) ) { | ||||
$events = array_filter($events); | $events = array_filter($events); | ||||
foreach ($events as $prefix_special => $event_name) { | foreach ($events as $prefix_special => $event_name) { | ||||
$this->Set($prefix_special . '_event', $event_name); | $this->Set($prefix_special . '_event', $event_name); | ||||
} | } | ||||
} | } | ||||
▲ Show 20 Lines • Show All 235 Lines • Show Last 20 Lines |
There must be no space between the Array keyword and the opening parenthesis