X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=lib%2Futil.php;h=6f6f1dd249121be3f5ccc34a3ebd539a48a105df;hb=36429673150b89e868c4ef54f89f408a11971df3;hp=ca8b539569fc012896fe08ddcb115a98724140b2;hpb=e59cfea9bc75a551dab0bc19fcab9a6a9e119b4e;p=quix0rs-gnu-social.git diff --git a/lib/util.php b/lib/util.php index ca8b539569..6f6f1dd249 100644 --- a/lib/util.php +++ b/lib/util.php @@ -253,7 +253,7 @@ function common_show_footer() { common_text(_('Unless otherwise specified, contents of this site are copyright by the contributors and available under the ')); common_element('a', array('class' => 'license', 'rel' => 'license', - href => $config['license']['url']), + 'href' => $config['license']['url']), $config['license']['title']); common_text(_('. Contributors should be attributed by full name or nickname.')); common_element_end('p'); @@ -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