aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorbrettp <brettp@36083f99-b078-4883-b0ff-0f9b5a30f544>2010-01-21 01:29:09 +0000
committerbrettp <brettp@36083f99-b078-4883-b0ff-0f9b5a30f544>2010-01-21 01:29:09 +0000
commit3d9fb93c8c91e45b88dfeb816960049e0cb33231 (patch)
tree2076288e096305b4858a8b21c9c60cdba93ee877
parent265b0629936850da2bfcbc2c91805a17a20bffc5 (diff)
downloadelgg-3d9fb93c8c91e45b88dfeb816960049e0cb33231.tar.gz
elgg-3d9fb93c8c91e45b88dfeb816960049e0cb33231.tar.bz2
elgg_http_build_query() now supports ports.
Checking for __elgg_ts also in elgg_validate_action_url(). Fixed a spelling mistake ;) git-svn-id: http://code.elgg.org/elgg/trunk@3820 36083f99-b078-4883-b0ff-0f9b5a30f544
-rw-r--r--engine/lib/elgglib.php7
1 files changed, 4 insertions, 3 deletions
diff --git a/engine/lib/elgglib.php b/engine/lib/elgglib.php
index 314c87530..059e42fd7 100644
--- a/engine/lib/elgglib.php
+++ b/engine/lib/elgglib.php
@@ -2426,7 +2426,8 @@ interface Friendable {
* @since 1.7
*/
function elgg_http_build_url(array $parts) {
- return "{$parts['scheme']}://{$parts['host']}{$parts['path']}?{$parts['query']}";
+ $port = (array_key_exists('port', $parts)) ? ":{$parts['port']}" : '';
+ return "{$parts['scheme']}://{$parts['host']}{$port}{$parts['path']}?{$parts['query']}";
}
/**
@@ -2439,11 +2440,11 @@ function elgg_http_build_url(array $parts) {
function elgg_validate_action_url($link) {
$url = parse_url($link);
parse_str($url['query'], $query);
- if (array_key_exists('__elgg_token', $query)) {
+ if (array_key_exists('__elgg_ts', $query) && array_key_exists('__elgg_token', $query)) {
return $link;
}
- // apend action tokens to the existing query
+ // append action tokens to the existing query
$query['__elgg_ts'] = time();
$query['__elgg_token'] = generate_action_token($query['__elgg_ts']);
$url['query'] = http_build_query($query);