diff --git a/classes/Profile_prefs.php b/classes/Profile_prefs.php index 97df488b6a..37ccf4fb96 100644 --- a/classes/Profile_prefs.php +++ b/classes/Profile_prefs.php @@ -120,7 +120,7 @@ class Profile_prefs extends Managed_DataObject static function getConfigData(Profile $profile, $namespace, $topic) { try { $data = self::getData($profile, $namespace, $topic); - } catch (Exception $e) { + } catch (NoResultException $e) { $data = common_config($namespace, $topic); } return $data; @@ -160,7 +160,7 @@ class Profile_prefs extends Managed_DataObject $pref->topic = $topic; $pref->data = $data; - if (!$pref->insert()) { + if ($pref->insert() === false) { throw new ServerException('Could not save profile preference.'); } return true; diff --git a/lib/htmloutputter.php b/lib/htmloutputter.php index 9ec7850402..369cd5936e 100644 --- a/lib/htmloutputter.php +++ b/lib/htmloutputter.php @@ -302,7 +302,7 @@ class HTMLOutputter extends XMLOutputter function hidden($id, $value, $name=null) { - $this->element('input', array('name' => ($name) ? $name : $id, + $this->element('input', array('name' => $name ?: $id, 'type' => 'hidden', 'id' => $id, 'value' => $value)); @@ -351,7 +351,7 @@ class HTMLOutputter extends XMLOutputter { $this->element('input', array('type' => 'submit', 'id' => $id, - 'name' => ($name) ? $name : $id, + 'name' => $name ?: $id, 'class' => $cls, 'value' => $label, 'title' => $title));