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)
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);