summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ext/standard/string.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/ext/standard/string.c b/ext/standard/string.c
index 419fef3d59..2668161c09 100644
--- a/ext/standard/string.c
+++ b/ext/standard/string.c
@@ -4274,7 +4274,11 @@ PHP_FUNCTION(setlocale)
zend_string_release(loc);
}
- RETURN_STR(zend_string_copy(BG(locale_string)));
+ if (BG(locale_string)) {
+ RETURN_STR(zend_string_copy(BG(locale_string)));
+ } else {
+ RETURN_EMPTY_STRING();
+ }
}
zend_string_release(loc);