]> git.mxchange.org Git - friendica-addons.git/blobdiff - fromgplus/fromgplus.php
PL translation blackout THX waldis
[friendica-addons.git] / fromgplus / fromgplus.php
index 9c8c7ff2305ea59fa46270fe15b34f70422faf32..ac433526a020b033b68188c5471225f6b4058a4d 100644 (file)
@@ -81,14 +81,14 @@ class="settings-submit" value="' . L10n::t('Save Settings') . '" /></div>';
 
 function fromgplus_addon_settings_post(&$a,&$b) {
 
-       if(! local_user())
+       if (!local_user())
                return;
 
-       if($_POST['fromgplus-submit']) {
+       if (!empty($_POST['fromgplus-submit'])) {
                PConfig::set(local_user(),'fromgplus','account',trim($_POST['fromgplus-account']));
-               $enable = ((x($_POST,'fromgplus-enable')) ? intval($_POST['fromgplus-enable']) : 0);
+               $enable = (x($_POST,'fromgplus-enable') ? intval($_POST['fromgplus-enable']) : 0);
                PConfig::set(local_user(),'fromgplus','enable', $enable);
-               $keywords = ((x($_POST, 'fromgplus-keywords')) ? intval($_POST['fromgplus-keywords']) : 0);
+               $keywords = (x($_POST, 'fromgplus-keywords') ? intval($_POST['fromgplus-keywords']) : 0);
                PConfig::set(local_user(),'fromgplus', 'keywords', $keywords);
 
                if (!$enable)
@@ -341,10 +341,13 @@ function fromgplus_handleattachments($a, $uid, $item, $displaytext, $shared) {
                                if ($images["full"] != "")
                                        $pagedata["images"][0]["src"] = $images["full"];
 
-                               $quote = trim(fromgplus_html2bbcode($attachment->content));
+                               if (!empty($attachment->content)) {
+                                       $quote = trim(fromgplus_html2bbcode($attachment->content));
+                               }
 
-                               if ($quote != "")
+                               if (!empty($quote)) {
                                        $pagedata["text"] = $quote;
+                               }
 
                                // Add Keywords to page link
                                $data = parseurl_getsiteinfo_cached($pagedata["url"], true);