From: <var...@us...> - 2019-04-18 14:38:57
|
Revision: 10103 http://sourceforge.net/p/phpwiki/code/10103 Author: vargenau Date: 2019-04-18 14:38:56 +0000 (Thu, 18 Apr 2019) Log Message: ----------- More strict tests Modified Paths: -------------- trunk/lib/main.php trunk/lib/plugin/UserPreferences.php Modified: trunk/lib/main.php =================================================================== --- trunk/lib/main.php 2019-04-18 14:36:33 UTC (rev 10102) +++ trunk/lib/main.php 2019-04-18 14:38:56 UTC (rev 10103) @@ -332,7 +332,7 @@ // Convenience function: function getPref($key) { - if (isset($this->_prefs)) { + if (isset($this->_prefs) && ($this->_prefs)) { return $this->_prefs->get($key); } return false; Modified: trunk/lib/plugin/UserPreferences.php =================================================================== --- trunk/lib/plugin/UserPreferences.php 2019-04-18 14:36:33 UTC (rev 10102) +++ trunk/lib/plugin/UserPreferences.php 2019-04-18 14:38:56 UTC (rev 10103) @@ -57,9 +57,11 @@ $pref = $user->getPreferences(); } $prefs = array(); - //we need a hash of pref => default_value - foreach ($pref->_prefs as $name => $obj) { - $prefs[$name] = $obj->default_value; + if ($pref) { + //we need a hash of pref => default_value + foreach ($pref->_prefs as $name => $obj) { + $prefs[$name] = $obj->default_value; + } } return $prefs; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |