summaryrefslogtreecommitdiff
path: root/ext/standard
diff options
context:
space:
mode:
Diffstat (limited to 'ext/standard')
-rw-r--r--ext/standard/file.c8
-rw-r--r--ext/standard/var_unserializer.re12
2 files changed, 17 insertions, 3 deletions
diff --git a/ext/standard/file.c b/ext/standard/file.c
index 80de164ab8..15c2e902c4 100644
--- a/ext/standard/file.c
+++ b/ext/standard/file.c
@@ -1991,8 +1991,14 @@ PHP_FUNCTION(fgetcsv)
while(isspace((int) *bptr) && (*bptr!=delimiter)) bptr++;
/* 2. Read field, leaving bptr pointing at start of next field */
if (enclosure && *bptr == enclosure) {
+ bptr++; /* move on to first character in field */
+
+ /* Check if there is an end to the enclosure */
+ if (!strchr(bptr, enclosure)) {
+ continue;
+ }
+
/* 2A. handle enclosure delimited field */
- bptr++; /* move on to first character in field */
while (*bptr) {
if (*bptr == enclosure) {
/* handle the enclosure */
diff --git a/ext/standard/var_unserializer.re b/ext/standard/var_unserializer.re
index 457c5bf83d..185909492b 100644
--- a/ext/standard/var_unserializer.re
+++ b/ext/standard/var_unserializer.re
@@ -375,12 +375,20 @@ PHPAPI int php_var_unserialize(UNSERIALIZE_PARAMETER)
zend_error(E_WARNING, "'unserialize_callback_func' (%s) hasn't defined the class it was called for", user_func->value.str.val);
incomplete_class = 1;
ce = PHP_IC_ENTRY;
- } else
+ } else {
+#ifdef ZEND_ENGINE_2
+ ce = *(zend_class_entry **)ce; /* Bad hack, TBF! */
+#endif
efree(class_name);
+ }
}
}
- } else
+ } else {
+#ifdef ZEND_ENGINE_2
+ ce = *(zend_class_entry **)ce; /* Bad hack, TBF! */
+#endif
efree(class_name);
+ }
*p = YYCURSOR;
elements = object_common1(UNSERIALIZE_PASSTHRU, ce);