summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEvan Prodromou <evan@prodromou.name>2008-05-17 12:09:08 -0400
committerEvan Prodromou <evan@prodromou.name>2008-05-17 12:09:08 -0400
commit1d9e45fb9bb38740218bb6a7723e697ae157bf9d (patch)
tree9a5cc26f0b34515205daf6826552649be7acf948
parent76c0575ad03cc4e0cf7a2c728aa6ed23dce6b377 (diff)
common_local_url() second parameter optional
darcs-hash:20080517160908-84dde-c176f1fa4c4026a84efac994e65db0158935cb11.gz
-rw-r--r--lib/common.php8
1 files changed, 5 insertions, 3 deletions
diff --git a/lib/common.php b/lib/common.php
index ca21b8011..8e0ea56b6 100644
--- a/lib/common.php
+++ b/lib/common.php
@@ -264,12 +264,14 @@ function common_avatar_url($filename) {
return $config['avatar']['path'] . '/' . $filename;
}
-function common_local_url($action, $args) {
+function common_local_url($action, $args=NULL) {
global $config;
/* XXX: pretty URLs */
$extra = '';
- foreach ($args as $key => $value) {
- $extra .= "&${key}=${value}";
+ if ($args) {
+ foreach ($args as $key => $value) {
+ $extra .= "&${key}=${value}";
+ }
}
return "http://".$config['site']['server'].'/'.$config['site']['path']."/index.php?action=${action}${extra}";
}