File tree Expand file tree Collapse file tree 1 file changed +10
-2
lines changed
modules/wordpress/mu-plugins Expand file tree Collapse file tree 1 file changed +10
-2
lines changed Original file line number Diff line number Diff line change @@ -37,9 +37,17 @@ License URI: http://www.gnu.org/licenses/gpl-3.0.html
3737/** A. 000 Common: Safe Constant ************************************************************ */
3838/** ********************************************************************************************* */
3939
40- // Function to check if a constant is defined before using it
40+ // check if constant is defined before using it
4141function ss_safe_constant( $constant, $default = '' ) {
42- return defined( $constant ) ? (string) constant( $constant ) : $default;
42+ if ( defined( $constant ) ) {
43+ $value = constant( $constant );
44+
45+ if ( is_scalar( $value ) ) {
46+ return (string) $value;
47+ }
48+ }
49+
50+ return $default;
4351}
4452
4553/** ********************************************************************************************* */
You can’t perform that action at this time.
0 commit comments