diff options
author | ewinslow <ewinslow@36083f99-b078-4883-b0ff-0f9b5a30f544> | 2010-11-02 20:59:56 +0000 |
---|---|---|
committer | ewinslow <ewinslow@36083f99-b078-4883-b0ff-0f9b5a30f544> | 2010-11-02 20:59:56 +0000 |
commit | 2820a231076cc640d2de867faeba2e1a3d45a402 (patch) | |
tree | 1fd80c05de913fb0c53f38ada6caef36e310d545 /engine | |
parent | b314a9a072d301e2e89c4873d76429ba46e9c94a (diff) | |
download | elgg-2820a231076cc640d2de867faeba2e1a3d45a402.tar.gz elgg-2820a231076cc640d2de867faeba2e1a3d45a402.tar.bz2 |
Refs #2463: Removed some more instances of $CONFIG->url. Added support for elgg_normalize_url to elgg_add_action_tokens_to_url
git-svn-id: http://code.elgg.org/elgg/trunk@7200 36083f99-b078-4883-b0ff-0f9b5a30f544
Diffstat (limited to 'engine')
-rw-r--r-- | engine/classes/ElggSite.php | 2 | ||||
-rw-r--r-- | engine/lib/actions.php | 2 | ||||
-rw-r--r-- | engine/lib/elgglib.php | 6 | ||||
-rw-r--r-- | engine/lib/entities.php | 9 | ||||
-rw-r--r-- | engine/lib/navigation.php | 2 | ||||
-rw-r--r-- | engine/lib/views.php | 2 | ||||
-rw-r--r-- | engine/tests/ui/submenu.php | 2 |
7 files changed, 13 insertions, 12 deletions
diff --git a/engine/classes/ElggSite.php b/engine/classes/ElggSite.php index 6e73e56a4..febd70be6 100644 --- a/engine/classes/ElggSite.php +++ b/engine/classes/ElggSite.php @@ -352,7 +352,7 @@ class ElggSite extends ElggEntity { } // always allow index page - if ($url == $CONFIG->url) { + if ($url == elgg_get_site_url($this->guid)) { return TRUE; } diff --git a/engine/lib/actions.php b/engine/lib/actions.php index fef6004cc..38fdef1ee 100644 --- a/engine/lib/actions.php +++ b/engine/lib/actions.php @@ -113,7 +113,7 @@ function action($action, $forwarder = "") { register_error(sprintf(elgg_echo('actionundefined'), $action)); } - forward($CONFIG->url . $forwarder); + forward($forwarder); } /** diff --git a/engine/lib/elgglib.php b/engine/lib/elgglib.php index 282b69fce..e45b231d4 100644 --- a/engine/lib/elgglib.php +++ b/engine/lib/elgglib.php @@ -1565,7 +1565,7 @@ function elgg_http_build_url(array $parts, $html_encode = TRUE) { * @link http://docs.elgg.org/Tutorials/Actions */ function elgg_add_action_tokens_to_url($url, $html_encode = TRUE) { - $components = parse_url($url); + $components = parse_url(elgg_normalize_url($url)); if (isset($components['query'])) { $query = elgg_parse_str($components['query']); @@ -1680,11 +1680,11 @@ function elgg_http_url_is_identical($url1, $url2, $ignore_params = array('offset // if the server portion is missing but it starts with / then add the url in. if (elgg_substr($url1, 0, 1) == '/') { - $url1 = $CONFIG->url . ltrim($url1, '/'); + $url1 = elgg_get_site_url() . ltrim($url1, '/'); } if (elgg_substr($url1, 0, 1) == '/') { - $url2 = $CONFIG->url . ltrim($url2, '/'); + $url2 = elgg_get_site_url() . ltrim($url2, '/'); } // @todo - should probably do something with relative URLs diff --git a/engine/lib/entities.php b/engine/lib/entities.php index 1c8db655b..34dc39de5 100644 --- a/engine/lib/entities.php +++ b/engine/lib/entities.php @@ -2097,10 +2097,10 @@ function get_entity_icon_url(ElggEntity $entity, $size = 'medium') { return $overrideurl; } - $url = $CONFIG->url . "_graphics/icons/default/$size.png"; + $url = "_graphics/icons/default/$size.png"; } - return $url; + return elgg_normalize_url($url); } /** @@ -2137,9 +2137,10 @@ function get_entity_url($entity_guid) { } if ($url == "") { - $url = $CONFIG->url . "pg/view/" . $entity_guid; + $url = "pg/view/" . $entity_guid; } - return $url; + + return elgg_noramlize_url($url); } diff --git a/engine/lib/navigation.php b/engine/lib/navigation.php index beb154f30..fcfc553fd 100644 --- a/engine/lib/navigation.php +++ b/engine/lib/navigation.php @@ -196,7 +196,7 @@ function elgg_prepare_submenu($context = 'main', $sort = FALSE) { $item->href = $child->href; } else { // @todo There are no URLs anywhere in this tree. - $item->href = $CONFIG->url; + $item->href = elgg_get_site_url(); } } } diff --git a/engine/lib/views.php b/engine/lib/views.php index d8564c5e3..82be10118 100644 --- a/engine/lib/views.php +++ b/engine/lib/views.php @@ -279,7 +279,7 @@ function elgg_view($view, $vars = array(), $bypass = false, $debug = false, $vie $vars['config'] = $CONFIG; } - $vars['url'] = $CONFIG->url; + $vars['url'] = elgg_get_site_url(); // Load page owner variables into $vars if (is_callable('page_owner')) { diff --git a/engine/tests/ui/submenu.php b/engine/tests/ui/submenu.php index 745364890..fcf4589e2 100644 --- a/engine/tests/ui/submenu.php +++ b/engine/tests/ui/submenu.php @@ -15,7 +15,7 @@ require_once('../../start.php'); -$url = "{$CONFIG->url}engine/tests/ui/submenu.php"; +$url = "engine/tests/ui/submenu.php"; $items = array( array( |