Merge pull request #3881 from annando/config-null

null is not false
This commit is contained in:
Hypolite Petovan 2017-11-07 16:53:11 -05:00 committed by GitHub
commit 6feec66979
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 7 deletions

View file

@ -280,10 +280,7 @@ function timesel($format, $h, $m, $id = 'timepicker') {
function datetimesel($format, $min, $max, $default, $label, $id = 'datetimepicker', $pickdate = true, $picktime = true, $minfrom = '', $maxfrom = '', $required = false) { function datetimesel($format, $min, $max, $default, $label, $id = 'datetimepicker', $pickdate = true, $picktime = true, $minfrom = '', $maxfrom = '', $required = false) {
// First day of the week (0 = Sunday) // First day of the week (0 = Sunday)
$firstDay = PConfig::get(local_user(), 'system', 'first_day_of_week'); $firstDay = PConfig::get(local_user(), 'system', 'first_day_of_week', 0);
if ($firstDay === false) {
$firstDay=0;
}
$lang = substr(get_browser_language(), 0, 2); $lang = substr(get_browser_language(), 0, 2);

View file

@ -16,11 +16,11 @@ use Friendica\Core\PConfig;
function feature_enabled($uid, $feature) { function feature_enabled($uid, $feature) {
$x = Config::get('feature_lock', $feature); $x = Config::get('feature_lock', $feature);
if ($x === false) { if (is_null($x)) {
$x = PConfig::get($uid, 'feature', $feature); $x = PConfig::get($uid, 'feature', $feature);
if ($x === false) { if (is_null($x)) {
$x = Config::get('feature', $feature); $x = Config::get('feature', $feature);
if ($x === false) { if (is_null($x)) {
$x = get_feature_default($feature); $x = get_feature_default($feature);
} }
} }