Show
Ignore:
Timestamp:
01/18/06 19:46:47 (6 years ago)
Author:
john
Message:

fixed url_for()

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/trax/vendor/trax/action_view/helpers.php

    r119 r120  
    7272            $url[] = $options; 
    7373        } else { 
     74            $url_base = $_SERVER['HTTP_HOST']; 
     75            if(substr($url_base, -1) == "/") { 
     76                # remove the ending slash 
     77                $url_base = substr($url_base, 0, -1);                              
     78            }            
     79             
    7480            if($_SERVER['SERVER_PORT'] == 443) { 
    75                 $url_base = "https://".$_SERVER['HTTP_HOST']; 
     81                $url_base = "https://".$url_base; 
    7682            } else { 
    77                 $url_base = "http://".$_SERVER['HTTP_HOST']; 
     83                $url_base = "http://".$url_base; 
    7884            } 
     85            if(!is_null(TRAX_URL_PREFIX)) { 
     86                $url_base .= "/".TRAX_URL_PREFIX; 
     87            } 
     88             
    7989            if(array_key_exists(":controller", $options)) { 
    8090                if($controller = $options[":controller"]) {