2012/2/6 Jakub Jankiewicz <[email protected]>

> I'm wonder why Aiki how url can't we just pull that info from $_SERVER
> like that (It should work)
>

i don't know. Wordpress has this disadvantage. Drupal and joomla no. In
Drupal base url is calculated by
...
$base_root = (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == 'on') ?
'https' : 'http';

    // As $_SERVER['HTTP_HOST'] is user input, ensure it only contains
    // characters allowed in hostnames.
    $base_url = $base_root .= '://'. preg_replace('/[^a-z0-9-:._]/i', '',
$_SERVER['HTTP_HOST']);

    // $_SERVER['SCRIPT_NAME'] can, in contrast to $_SERVER['PHP_SELF'], not
    // be modified by a visitor.
    if ($dir = trim(dirname($_SERVER['SCRIPT_NAME']), '\,/')) {
      $base_path = "/$dir";
      $base_url .= $base_path;
      $base_path .= '/';
    }
    else {
      $base_path = '/';
    }
.....
So in aiki, perhaps it can be:
$config["url"] =
    'http' . ( isset($_SERVER['HTTPS']) &&  $_SERVER['HTTPS']=="on" ? 's' :
'') . '://' .
    $_SERVER['HTTP_HOST'] . ($_SERVER['SERVER_PORT'] != 80 ? ':' .
$_SERVER['SERVER_PORT'] : '') .
    preg_replace("/" . basename($_SERVER['SCRIPT_NAME']) . "$/", "",
$_SERVER['SCRIPT_NAME']);
_______________________________________________
Mailing list: https://launchpad.net/~aikiframework-devel
Post to     : [email protected]
Unsubscribe : https://launchpad.net/~aikiframework-devel
More help   : https://help.launchpad.net/ListHelp

Reply via email to