diff options
Diffstat (limited to 'src/frontend_lib/util.php')
-rw-r--r-- | src/frontend_lib/util.php | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/frontend_lib/util.php b/src/frontend_lib/util.php index 1ccc4674..379efbca 100644 --- a/src/frontend_lib/util.php +++ b/src/frontend_lib/util.php @@ -4,6 +4,13 @@ function get(&$var, $default=null) { return isset($var) ? $var : $default; } +function &pull(&$arr, $idx, $default) { + if (!isset($arr[$idx]) { + $arr[idx] = $default; + } + return $arr[$idx]; +} + function url_join($base, $path, $strip=false) { $flags = $strip ? (http\Url::STRIP_PATH|http\URL::STRIP_QUERY) : 0; return (new http\URL($base, null, $flags)) |