@@ -15,13 +15,13 @@ private static function getOption(modX $modx, string $namespace, string $field,
15
15
{
16
16
if (!empty ($ field )) {
17
17
$ value = $ modx ->getOption ("$ namespace. $ field. $ area. $ setting " );
18
- if (! empty ( $ value) ) {
18
+ if ($ value !== null && $ value !== '' ) {
19
19
return $ value ;
20
20
}
21
21
}
22
22
23
23
$ value = $ modx ->getOption ("$ namespace.global. $ area. $ setting " );
24
- if (! empty ( $ value) ) {
24
+ if ($ value !== null && $ value !== '' ) {
25
25
return $ value ;
26
26
}
27
27
@@ -31,13 +31,13 @@ private static function getOption(modX $modx, string $namespace, string $field,
31
31
32
32
if (!empty ($ field )) {
33
33
$ value = $ modx ->getOption ("modai. $ field. $ area. $ setting " );
34
- if (! empty ( $ value) ) {
34
+ if ($ value !== null && $ value !== '' ) {
35
35
return $ value ;
36
36
}
37
37
}
38
38
39
39
$ value = $ modx ->getOption ("modai.global. $ area. $ setting " );
40
- if (! empty ( $ value) ) {
40
+ if ($ value !== null && $ value !== '' ) {
41
41
return $ value ;
42
42
}
43
43
@@ -51,7 +51,7 @@ public static function getTextSetting(modX $modx, string $field, string $setting
51
51
{
52
52
$ value = self ::getOption ($ modx , $ namespace , $ field , 'text ' , $ setting );
53
53
54
- if ($ required && empty ($ value )) {
54
+ if ($ required && ($ value === null || $ value === '' )) {
55
55
throw new RequiredSettingException ("modai.global.text. $ setting " );
56
56
}
57
57
@@ -65,7 +65,7 @@ public static function getImageSetting(modX $modx, string $field, string $settin
65
65
{
66
66
$ value = self ::getOption ($ modx , $ namespace , $ field , 'image ' , $ setting );
67
67
68
- if ($ required && empty ($ value )) {
68
+ if ($ required && ($ value === null || $ value === '' )) {
69
69
throw new RequiredSettingException ("modai.global.image. $ setting " );
70
70
}
71
71
@@ -79,7 +79,7 @@ public static function getVisionSetting(modX $modx, string $field, string $setti
79
79
{
80
80
$ value = self ::getOption ($ modx , $ namespace , $ field , 'vision ' , $ setting );
81
81
82
- if ($ required && empty ($ value )) {
82
+ if ($ required && ($ value === null || $ value === '' )) {
83
83
throw new RequiredSettingException ("modai.global.vision. $ setting " );
84
84
}
85
85
0 commit comments