Development

Changeset 11901

You must first sign up to be able to contribute.

Changeset 11901

Show
Ignore:
Timestamp:
10/02/08 13:33:35 (6 years ago)
Author:
fabien
Message:

[1.2] added HTTP_REFERER support to the browser

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • branches/1.2/UPGRADE_TO_1_2

    r11899 r11901  
    624624This refactor must not introduce backward incompatibility with symfony 1.1. 
    625625 
     626The browser classes now add the `HTTP_REFERER` header for each request. 
     627 
    626628Tests 
    627629----- 
  • branches/1.2/lib/util/sfBrowserBase.class.php

    r11497 r11901  
    255255    $_SERVER['SCRIPT_FILENAME'] = '/index.php'; 
    256256    $_SERVER['QUERY_STRING']    = $queryString; 
     257 
     258    if ($this->stackPosition >= 1) 
     259    { 
     260      $_SERVER['HTTP_REFERER'] = sprintf('http%s://%s%s', isset($this->defaultServerArray['HTTPS']) ? 's' : '', $this->hostname, $this->stack[$this->stackPosition - 1]['uri']); 
     261    } 
     262 
    257263    foreach ($this->vars as $key => $value) 
    258264    { 
     
    800806      } 
    801807 
    802       $uri = substr($uri, strpos($uri, 'index.php') + strlen('index.php')); 
     808      $uri = preg_replace('#^https?\://[^/]+/#', '/', $uri); 
    803809    } 
    804810    $uri = str_replace('/index.php', '', $uri);