diff options
author | Florian Dold <florian.dold@gmail.com> | 2016-01-25 18:40:40 +0100 |
---|---|---|
committer | Florian Dold <florian.dold@gmail.com> | 2016-01-25 18:40:40 +0100 |
commit | e015708c602441b090ceb563ec38d3ad16134f7b (patch) | |
tree | 25061410f41d588b44d17b7a64c946aa29b09d3c /src/frontend_lib/util.php | |
parent | 9f87ec5e8e1c549f46f9577c8b67c3315b88edd4 (diff) | |
download | merchant-e015708c602441b090ceb563ec38d3ad16134f7b.tar.gz merchant-e015708c602441b090ceb563ec38d3ad16134f7b.tar.bz2 merchant-e015708c602441b090ceb563ec38d3ad16134f7b.zip |
modify session state correctly
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)) |