]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
Merge remote branch 'gitorious/testing' into testing
authorEvan Prodromou <evan@status.net>
Mon, 24 Jan 2011 13:54:09 +0000 (06:54 -0700)
committerEvan Prodromou <evan@status.net>
Mon, 24 Jan 2011 13:54:09 +0000 (06:54 -0700)
plugins/Bookmark/Bookmark.php
plugins/NewMenu/NewMenuPlugin.php

index 4ee287fb65b88f4bdf3a777f25dd1c95fb3c0ef2..777b50f7243d74f7244f84640cf163d902045b57 100644 (file)
@@ -214,7 +214,11 @@ class Bookmark extends Memcached_DataObject
         }
 
         if (is_string($rawtags)) {
-            $rawtags = preg_split('/[\s,]+/', $rawtags);
+            if (empty($rawtags)) {
+                $rawtags = array();
+            } else {
+                $rawtags = preg_split('/[\s,]+/', $rawtags);
+            }
         }
 
         $nb = new Bookmark();
@@ -274,10 +278,15 @@ class Bookmark extends Memcached_DataObject
 
         // Use user's preferences for short URLs, if possible
 
-        $user = User::staticGet('id', $profile->id);
+        try {
+            $user = User::staticGet('id', $profile->id);
 
-        $shortUrl = File_redirection::makeShort($url, 
-                                                empty($user) ? null : $user);
+            $shortUrl = File_redirection::makeShort($url, 
+                                                    empty($user) ? null : $user);
+        } catch (Exception $e) {
+            // Don't let this stop us.
+            $shortUrl = $url;
+        }
 
         $content = sprintf(_('"%s" %s %s %s'),
                            $title,
index 14950ab079887911a9bb74b79afefe358279d80a..7aad0672bf995ad441c4a925a60440fc91162c48 100644 (file)
@@ -53,31 +53,6 @@ class NewMenuPlugin extends Plugin
 {
     public $loadCSS = false;
 
-    /**
-     * Load related modules when needed
-     *
-     * @param string $cls Name of the class to be loaded
-     *
-     * @return boolean hook value; true means continue processing, false means stop.
-     */
-
-    function onAutoload($cls)
-    {
-        $dir = dirname(__FILE__);
-
-        switch ($cls)
-        {
-        case 'HelloAction':
-            include_once $dir . '/' . strtolower(mb_substr($cls, 0, -6)) . '.php';
-            return false;
-        case 'User_greeting_count':
-            include_once $dir . '/'.$cls.'.php';
-            return false;
-        default:
-            return true;
-        }
-    }
-
     /**
      * Modify the default menu
      *