]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
Merge branch 'fix-setpassword' into 'nightly'
authormmn <mmn@hethane.se>
Mon, 14 Dec 2015 20:37:26 +0000 (20:37 +0000)
committermmn <mmn@hethane.se>
Mon, 14 Dec 2015 20:37:26 +0000 (20:37 +0000)
Fix /scripts/setpassword.php

common_munge_password is expecting a Profile, we were passing a user_id.

Thanks @aroque for the fix ( ref. #100 )

See merge request !67

classes/File_redirection.php
classes/Notice.php
lib/action.php
lib/util.php
plugins/Autocomplete/actions/autocomplete.php

index 0d90b9e82c0016040e8bf9f3fd83f7653be04d07..bb8ffc8c61301d3cf281382d719406354bf0dd81 100644 (file)
@@ -192,16 +192,18 @@ class File_redirection extends Managed_DataObject
             if (!empty($r->file_id)) {
                 return $r;
             }
-        }
 
-        $redir->httpcode = $redir_info['code'];
-        $redir->redirections = intval($redir_info['redirects']);
-        $redir->file = new File();
-        $redir->file->url = $redir_info ? $redir_info['url'] : $in_url;
-        $redir->file->mimetype = $redir_info['type'];
-        $redir->file->size = $redir_info['size'];
-        $redir->file->date = $redir_info['time'];
-        if($redir_info['protected']) $redir->file->protected = true;
+            $redir->httpcode = $redir_info['code'];
+            $redir->redirections = intval($redir_info['redirects']);
+            $redir->file = new File();
+            $redir->file->url = $redir_info ? $redir_info['url'] : $in_url;
+            $redir->file->mimetype = $redir_info['type'];
+            $redir->file->size = $redir_info['size'];
+            $redir->file->date = $redir_info['time'];
+            if ($redir_info['protected']) {
+                $redir->file->protected = true;
+            }
+        }
 
         return $redir;
     }
index 8f4d63c8927a6a4e7e5809c4ea44a65b6b8bba43..6fe2e4c76ad6e9dfee40f509932792dc13f9a499 100644 (file)
@@ -814,7 +814,7 @@ class Notice extends Managed_DataObject
         // Use the local user's shortening preferences, if applicable.
         $stored->rendered = $actor->isLocal()
                                 ? $actor->shortenLinks($act->content)
-                                : $act->content;
+                                : common_purify($act->content);
         $stored->content = common_strip_html($stored->rendered);
 
         // Maybe a missing act-time should be fatal if the actor is not local?
index 4a815c148360efa6d0064c411cc6b06a669a245e..c2d60e11e974bec1414fe2b9b143b4babdb4ce0d 100644 (file)
@@ -1490,7 +1490,7 @@ class Action extends HTMLOutputter // lawsuit
             }
             $this->initDocument('json');
             $error_array = array('error' => $msg, 'request' => $_SERVER['REQUEST_URI']);
-            $this->text(json_encode($error_array));
+            print(json_encode($error_array));
             $this->endDocument('json');
             break;
         case 'text':
index f58e8cd112a8b980aa9b75b0730054c0d6b48885..c6005718d6233aea3e368a7593c74f5a40086457 100644 (file)
@@ -877,7 +877,7 @@ function common_replace_urls_callback($text, $callback, $arg = null) {
         '(?:'.
             '(?:'. //Known protocols
                 '(?:'.
-                    '(?:(?:https?|ftps?|mms|rtsp|gopher|news|nntp|telnet|wais|file|prospero|webcal|irc)://)'.
+                    '(?:(?:https?|ftps?|mms|rtsp|gopher|news|nntp|telnet|wais|file|prospero|webcal|ircs?)://)'.
                     '|'.
                     '(?:(?:mailto|aim|tel|xmpp):)'.
                 ')'.
index 56df4eb6d8b6c205c2775745d33ab2297a01c238..d5370fe0e1e66eeaf383de3cf62fdaec58342c9b 100644 (file)
@@ -141,10 +141,13 @@ class AutocompleteAction extends Action
         $results = array();
         foreach($this->profiles as $profile){
             $avatarUrl = $profile->avatarUrl(AVATAR_MINI_SIZE);
+            $acct = $profile->getAcctUri();
+            $identifier = split(':', $profile->getAcctUri(), 2)[1];
             $results[] = array(
-                'value' => '@'.$profile->nickname,
-                'nickname' => $profile->nickname,
-                'label'=> $profile->getFancyName(),
+                'value' => '@'.$identifier,
+                'nickname' => $profile->getNickname(),
+                'acct_uri' => $acct,
+                'label'=> "${identifier} (".$profile->getFullname().")",
                 'avatar' => $avatarUrl,
                 'type' => 'user'
             );
@@ -156,10 +159,13 @@ class AutocompleteAction extends Action
             } else {
                 $avatarUrl = User_group::defaultLogo(AVATAR_MINI_SIZE);
             }
+            $acct = $profile->getAcctUri();
+            $identifier = split(':', $profile->getAcctUri(), 2)[1];
             $results[] = array(
-                'value' => '!'.$group->nickname,
-                'nickname' => $group->nickname,
-                'label'=> $group->getFancyName(),
+                'value' => '!'.$group->getNickname(),
+                'nickname' => $group->getNickname(),
+                'acct_uri' => $acct,
+                'label'=> "${identifier} (".$group->getFullname().")",
                 'avatar' => $avatarUrl,
                 'type' => 'group');
         }