X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=lib%2Futil.php;h=6f6f1dd249121be3f5ccc34a3ebd539a48a105df;hb=36429673150b89e868c4ef54f89f408a11971df3;hp=40f2d4cd4de016aa1728a40dd6da4a9eef73c128;hpb=32136f978a7bfad8c261b633edaa1cb24a4dc133;p=quix0rs-gnu-social.git diff --git a/lib/util.php b/lib/util.php index 40f2d4cd4d..6f6f1dd249 100644 --- a/lib/util.php +++ b/lib/util.php @@ -708,7 +708,7 @@ function common_local_url($action, $args=NULL) { function common_fancy_url($action, $args=NULL) { switch (strtolower($action)) { case 'public': - if ($args && $args['page']) { + if ($args && isset($args['page'])) { return common_path('?page=' . $args['page']); } else { return common_path(''); @@ -769,7 +769,7 @@ function common_fancy_url($action, $args=NULL) { case 'userrss': return common_path($args['nickname'].'/rss'); case 'showstream': - if ($args && $args['page']) { + if ($args && isset($args['page'])) { return common_path($args['nickname'].'?page=' . $args['page']); } else { return common_path($args['nickname']); @@ -889,6 +889,7 @@ function common_redirect($url, $code=307) { function common_save_replies($notice) { # Alternative reply format + $tname = false; if (preg_match('/^T ([A-Z0-9]{1,64}) /', $notice->content, $match)) { $tname = $match[1]; } @@ -1318,4 +1319,10 @@ function common_profile_uri($profile) { } # XXX: this is a very bad profile! return NULL; +} + +function common_canonical_sms($sms) { + # strip non-digits + preg_replace('/\D/', '', $sms); + return $sms; } \ No newline at end of file