Gets the referring URL of this request.

Parameters

  • string $default Default URL to use if HTTP_REFERER cannot be read from headers.
  • boolean $local If true, restrict referring URLs to local server.

Returns

string Referring URL.

Source

						public function referer($default = null, $local = false) {
		if ($ref = $this->env('HTTP_REFERER')) {
			if (!$local) {
				return $ref;
			}
			if (strpos($ref, '://') == false) {
				return $ref;
			}
		}
		return ($default != null) ? $default : '/';
	}