Permalink
Browse files

Renaming RequestHandler::getReferrer to RequestHandler::getReferer fo…

…r (mis)spelling consistency and deprecating the former
  • Loading branch information...
1 parent f36e5ef commit d561405daa1339c77bf33a47056f2faf7c5f0b75 @ADmad ADmad committed Dec 20, 2009
@@ -410,7 +410,7 @@ function setContent($name, $type = null) {
* @return string Server address
* @access public
*/
- function getReferrer() {
+ function getReferer() {
if (env('HTTP_HOST') != null) {
$sessHost = env('HTTP_HOST');
}
@@ -422,6 +422,14 @@ function getReferrer() {
}
/**
+ * @deprecated use getReferer()
+ */
+ function getReferrer() {
+ trigger_error('Deprecated method, use RequestHandlerComponent::getReferer instead', E_USER_WARNING);
+ return $this->getReferer();
+ }
+
+/**
* Gets remote client IP
*
* @return string Client IP address
@@ -530,10 +530,10 @@ function testCustomContent() {
*/
function testClientProperties() {
$_SERVER['HTTP_HOST'] = 'localhost:80';
- $this->assertEqual($this->RequestHandler->getReferrer(), 'localhost');
+ $this->assertEqual($this->RequestHandler->getReferer(), 'localhost');
$_SERVER['HTTP_HOST'] = null;
$_SERVER['HTTP_X_FORWARDED_HOST'] = 'cakephp.org';
- $this->assertEqual($this->RequestHandler->getReferrer(), 'cakephp.org');
+ $this->assertEqual($this->RequestHandler->getReferer(), 'cakephp.org');
$_SERVER['HTTP_X_FORWARDED_FOR'] = '192.168.1.5, 10.0.1.1, proxy.com';
$_SERVER['HTTP_CLIENT_IP'] = '192.168.1.2';

0 comments on commit d561405

Please sign in to comment.