Changeset - 5608907ef402
[Not reviewed]
default
0 1 0
Nathan Brink (binki) - 14 years ago 2012-02-09 21:05:16
ohnobinki@ohnopublishing.net
Fix regression in 4d7bb7e8bc2e which caused redirection to the parent directory of slate_permutate.
1 file changed with 2 insertions and 1 deletions:
0 comments (0 inline, 0 general)
inc/class.page.php
Show inline comments
 
@@ -634,49 +634,50 @@ class page
 
    if (empty($host))
 
      {
 
	if (isset($_SERVER['SERVER_NAME']))
 
	  $host = $_SERVER['SERVER_NAME'];
 
	if (isset($_SERvER['HTTP_HOST']))
 
	  $host = $_SERVER['HTTP_HOST'];
 
      }
 

	
 
    if (empty($base_uri))
 
      if (strlen($host))
 
	{
 
	  $proto = 'http';
 
	  $port = NULL;
 
	  if (isset($_SERVER['SERVER_PORT']) && $_SERVER['SERVER_PORT'] != 80)
 
	    {
 
	      if ($_SERVER['SERVER_PORT'] == 443 || !empty($_SERVER['HTTPS']))
 
		$proto .= 's';
 
	      if ($_SERVER['SERVER_PORT'] != 433)
 
		$port = $_SERVER['SERVER_PORT'];
 
	    }
 
	  
 
	  $base_uri = $proto . '://' . $host;
 
	  if ($port !== NULL)
 
	    $base_uri .= ':' . $port;
 
	  $base_uri .= dirname($_SERVER['REQUEST_URI']) . '/';
 
	  list($base_request_uri) = explode('?', $_SERVER['REQUEST_URI'], 2);
 
	  $base_uri .= substr($base_request_uri, 0, strrpos($base_request_uri, '/')) . '/';
 
	}
 

	
 
    if (empty($base_uri) && empty($uri))
 
      return './';
 

	
 
    return $base_uri . $uri;
 
  }
 

	
 
  /**
 
   * \brief
 
   *   Get the current school profile handle.
 
   */
 
  public function get_school()
 
  {
 
    return $this->school;
 
  }
 

	
 
  /**
 
   * \brief
 
   *   Get the current semester.
 
   */
 
  public function semester_get()
 
  {
 
    return $this->semester;
0 comments (0 inline, 0 general)