cvs: Zend / zend_compile.c
| From: | Masaki Fujimoto | Date: | Tue, 20 Aug 2002 14:26:31 +0000 |
| Subject: | cvs: Zend / zend_compile.c | ||
| Groups: | php.zend-engine.cvs | ||
| Request: | Send a blank email to php-zend-engine-cvs+get-338@lists.php.net to get a copy of this message | ||
fujimoto Tue Aug 20 10:26:31 2002 EDT
Modified files:
/Zend zend_compile.c
Log:
check for IS_CONSTANT instead of NULL, according to Andi's idea.
Index: Zend/zend_compile.c
diff -u Zend/zend_compile.c:1.235 Zend/zend_compile.c:1.236
--- Zend/zend_compile.c:1.235 Tue Aug 13 02:01:40 2002
+++ Zend/zend_compile.c Tue Aug 20 10:26:31 2002
@@ -2224,10 +2224,10 @@
zend_encoding *new_encoding, *old_encoding;
zend_multibyte_filter old_input_filter;
- convert_to_string(&val->u.constant);
- if (!val->u.constant.value.str.val) {
- zend_error(E_COMPILE_ERROR, "Invalid encoding specified (without quotes ?)");
+ if (val->u.constant.type == IS_CONSTANT) {
+ zend_error(E_COMPILE_ERROR, "Cannot use constants as encoding");
}
+ convert_to_string(&val->u.constant);
new_encoding = zend_multibyte_fetch_encoding(val->u.constant.value.str.val);
if (!new_encoding) {
zend_error(E_COMPILE_WARNING, "Unsupported encoding [%s]\n",
val->u.constant.value.str.val);