]> git.mxchange.org Git - quix0rs-gnu-social.git/blobdiff - lib/util.php
require sms carrier
[quix0rs-gnu-social.git] / lib / util.php
index 40f2d4cd4de016aa1728a40dd6da4a9eef73c128..6f6f1dd249121be3f5ccc34a3ebd539a48a105df 100644 (file)
@@ -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