[PHP-CVS] com php-src: - fix bug #47358, glob returns error, should be empty array(): ext/standard/dir.c

2013-01-08 Thread Pierre Joye
Commit:2fb7cd30c59345838588ba89ad8b05cc4c34d6dd
Author:Pierre Joye pierre@gmail.com Tue, 8 Jan 2013 15:06:58 
+0100
Parents:   a71e91626a3a72d360c285d0c78a16dbac6a0840 
50ceeb9f750cecedc483ffc3d3e65a3324e21866
Branches:  master

Link:   
http://git.php.net/?p=php-src.git;a=commitdiff;h=2fb7cd30c59345838588ba89ad8b05cc4c34d6dd

Log:
- fix bug #47358, glob returns error, should be empty array()

Bugs:
https://bugs.php.net/47358

Changed paths:
  MM  ext/standard/dir.c


Diff:
diff --cc ext/standard/dir.c
index d921f7c,3f70ea9..91d1e04
--- a/ext/standard/dir.c
+++ b/ext/standard/dir.c
@@@ -491,10 -495,8 +491,8 @@@ PHP_FUNCTION(glob
/* now catch the FreeBSD style of no matches */
if (!globbuf.gl_pathc || !globbuf.gl_pathv) {
  no_results:
 -  if (PG(safe_mode) || (PG(open_basedir)  *PG(open_basedir))) {
 +  if (PG(open_basedir)  *PG(open_basedir)) {
-   struct stat s;
- 
-   if (0 != VCWD_STAT(pattern, s) || S_IFDIR != 
(s.st_mode  S_IFMT)) {
+   if (php_check_open_basedir_ex(pattern, 0 TSRMLS_CC)) {
RETURN_FALSE;
}
}


--
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-CVS] com php-src: - NEWS entry for #50524: NEWS

2013-01-08 Thread Pierre Joye
Commit:bcb3ad043aa36d56945960bf985a673f938711de
Author:Pierre Joye pierre@gmail.com Mon, 7 Jan 2013 13:09:20 
+0100
Parents:   c0fae054c92cf73e5f7a7c32d624e43afabfd8e0
Branches:  master

Link:   
http://git.php.net/?p=php-src.git;a=commitdiff;h=bcb3ad043aa36d56945960bf985a673f938711de

Log:
- NEWS entry for #50524

Bugs:
https://bugs.php.net/50524

Changed paths:
  M  NEWS


Diff:
diff --git a/NEWS b/NEWS
index a0e8a68..a1b0ab1 100644
--- a/NEWS
+++ b/NEWS
@@ -16,6 +16,8 @@ PHP   
 NEWS
   . Fixed bug ##62460 (php binaries installed as binary.dSYM). (Reeze Xia)
   . Fixed bug #60194 (--with-zend-multibyte and --enable-debug reports LEAK
 with run-test.php). (Laruence)
+  . Fixed bug #50524 (Fix the original fix, passing NULL as CWD does not 
+work on Windows). (Pierre)
 
 - CURL:
   . Fixed bug #62839 (curl_copy_handle segfault with CURLOPT_FILE). (Pierrick)


--
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-CVS] com php-src: - fix bug #47358, glob returns error, should be empty array(): ext/standard/dir.c

2013-01-08 Thread Pierre Joye
Commit:50ceeb9f750cecedc483ffc3d3e65a3324e21866
Author:Pierre Joye pierre@gmail.com Tue, 8 Jan 2013 15:02:04 
+0100
Parents:   bcb3ad043aa36d56945960bf985a673f938711de
Branches:  master

Link:   
http://git.php.net/?p=php-src.git;a=commitdiff;h=50ceeb9f750cecedc483ffc3d3e65a3324e21866

Log:
- fix bug #47358, glob returns error, should be empty array()

Bugs:
https://bugs.php.net/47358

Changed paths:
  M  ext/standard/dir.c


Diff:
diff --git a/ext/standard/dir.c b/ext/standard/dir.c
index 37c3bc8..3f70ea9 100644
--- a/ext/standard/dir.c
+++ b/ext/standard/dir.c
@@ -496,9 +496,7 @@ PHP_FUNCTION(glob)
if (!globbuf.gl_pathc || !globbuf.gl_pathv) {
 no_results:
if (PG(safe_mode) || (PG(open_basedir)  *PG(open_basedir))) {
-   struct stat s;
-
-   if (0 != VCWD_STAT(pattern, s) || S_IFDIR != 
(s.st_mode  S_IFMT)) {
+   if (php_check_open_basedir_ex(pattern, 0 TSRMLS_CC)) {
RETURN_FALSE;
}
}


--
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-CVS] com php-src: Merge branch 'PHP-5.4' into PHP-5.5: ext/standard/dir.c

2013-01-08 Thread Pierre Joye
Commit:10a2c0d574be62be1f0224d23909e27e74c87445
Author:Pierre Joye pierre@gmail.com Tue, 8 Jan 2013 15:13:40 
+0100
Parents:   f4142a92b2ecfa0fdf89ec83bb41c2a46b299973 
2fb7cd30c59345838588ba89ad8b05cc4c34d6dd
Branches:  master

Link:   
http://git.php.net/?p=php-src.git;a=commitdiff;h=10a2c0d574be62be1f0224d23909e27e74c87445

Log:
Merge branch 'PHP-5.4' into PHP-5.5

* PHP-5.4:
  - fix bug #47358, glob returns error, should be empty array()
  - NEWS entry for #50524

Bugs:
https://bugs.php.net/47358
https://bugs.php.net/50524

Changed paths:
  MM  ext/standard/dir.c


Diff:



--
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-CVS] com php-src: Fix a typo in the ZipArchive error messages: ext/zip/php_zip.c

2013-01-08 Thread Joey Smith
Commit:c3acefd9ea9f1c0b0900f75d05c14a1e6ab2b671
Author:Joey Smith joeysm...@gmail.com Tue, 8 Jan 2013 14:18:31 
-0700
Parents:   c41291feb9d8b713684331307147bbaef43bc22a
Branches:  master

Link:   
http://git.php.net/?p=php-src.git;a=commitdiff;h=c3acefd9ea9f1c0b0900f75d05c14a1e6ab2b671

Log:
Fix a typo in the ZipArchive error messages

Changed paths:
  M  ext/zip/php_zip.c


Diff:
diff --git a/ext/zip/php_zip.c b/ext/zip/php_zip.c
index 727cc85..5fd470a 100644
--- a/ext/zip/php_zip.c
+++ b/ext/zip/php_zip.c
@@ -410,7 +410,7 @@ static int php_zip_parse_options(zval *options, long 
*remove_all_path,
ze_zip_object *obj = (ze_zip_object*) 
zend_object_store_get_object(object TSRMLS_CC); \
intern = obj-za; \
if (!intern) { \
-   php_error_docref(NULL TSRMLS_CC, E_WARNING, Invalid or 
unitialized Zip object); \
+   php_error_docref(NULL TSRMLS_CC, E_WARNING, Invalid or 
uninitialized Zip object); \
RETURN_FALSE; \
} \
}


--
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-CVS] com php-src: Fixed bug #63943 (Bad warning text from strpos() on empty needle): NEWS ext/standard/string.c ext/standard/tests/strings/bug63943.phpt

2013-01-08 Thread Xinchen Hui
Commit:c05ee74e7ff28b49018bf3e8f452bfd5386d1b68
Author:Xinchen Hui larue...@php.net Wed, 9 Jan 2013 10:53:20 +0800
Parents:   67c662a0a2615d52215dccc4805e8eb989df7eab
Branches:  PHP-5.3

Link:   
http://git.php.net/?p=php-src.git;a=commitdiff;h=c05ee74e7ff28b49018bf3e8f452bfd5386d1b68

Log:
Fixed bug #63943 (Bad warning text from strpos() on empty needle)

Bugs:
https://bugs.php.net/63943

Changed paths:
  M  NEWS
  M  ext/standard/string.c
  A  ext/standard/tests/strings/bug63943.phpt


Diff:
diff --git a/NEWS b/NEWS
index ee76efb..e78af23 100644
--- a/NEWS
+++ b/NEWS
@@ -9,6 +9,10 @@ PHP
NEWS
   . Fixed bug #63762 (Sigsegv when Exception::$trace is changed by user).
 (Johannes)
 
+- Core
+  . Fixed bug #63943 (Bad warning text from strpos() on empty needle).
+(Laruence)
+
 - cURL extension:
   . Fixed bug (segfault due to libcurl connection caching). (Pierrick)
   . Fixed bug #63795 (CURL = 7.28.0 no longer support value 1 for
diff --git a/ext/standard/string.c b/ext/standard/string.c
index b17ad50..907301d 100644
--- a/ext/standard/string.c
+++ b/ext/standard/string.c
@@ -1744,7 +1744,7 @@ PHP_FUNCTION(strpos)
 
if (Z_TYPE_P(needle) == IS_STRING) {
if (!Z_STRLEN_P(needle)) {
-   php_error_docref(NULL TSRMLS_CC, E_WARNING, Empty 
delimiter);
+   php_error_docref(NULL TSRMLS_CC, E_WARNING, Empty 
needle);
RETURN_FALSE;
}
 
diff --git a/ext/standard/tests/strings/bug63943.phpt 
b/ext/standard/tests/strings/bug63943.phpt
new file mode 100644
index 000..6018879
--- /dev/null
+++ b/ext/standard/tests/strings/bug63943.phpt
@@ -0,0 +1,8 @@
+--TEST--
+Bug #63943 (Bad warning text from strpos() on empty needle)
+--FILE--
+?php
+strpos(lll, '');
+?
+--EXPECTF--
+Warning: strpos(): Empty needle in %sbug63943.php on line %d


--
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-CVS] com php-src: update NEWS: NEWS

2013-01-08 Thread Xinchen Hui
Commit:f3b1b8516906fe900e521216c8f01e362790af30
Author:Xinchen Hui larue...@php.net Wed, 9 Jan 2013 10:55:50 +0800
Parents:   15aaa9c6605b9ee5dfd568a13704f36a721433a0
Branches:  PHP-5.4

Link:   
http://git.php.net/?p=php-src.git;a=commitdiff;h=f3b1b8516906fe900e521216c8f01e362790af30

Log:
update NEWS

Changed paths:
  M  NEWS


Diff:
diff --git a/NEWS b/NEWS
index 9fca188..1abd398 100644
--- a/NEWS
+++ b/NEWS
@@ -2,6 +2,10 @@ PHP
NEWS
 |||
 ?? ??? 2012, PHP 5.4.12
 
+- Core:
+  . Fixed bug #63943 (Bad warning text from strpos() on empty needle).
+(Laruence)
+
 - Litespeed:
   . Fixed bug #63228 (-Werror=format-security error in lsapi code). (George)


--
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-CVS] com php-src: Merge branch 'PHP-5.3' into PHP-5.4: ext/standard/string.c

2013-01-08 Thread Xinchen Hui
Commit:15aaa9c6605b9ee5dfd568a13704f36a721433a0
Author:Xinchen Hui larue...@php.net Wed, 9 Jan 2013 10:54:23 +0800
Parents:   6e684e6a6ceac89ad51f822493f702a6925a2d37 
c05ee74e7ff28b49018bf3e8f452bfd5386d1b68
Branches:  PHP-5.4

Link:   
http://git.php.net/?p=php-src.git;a=commitdiff;h=15aaa9c6605b9ee5dfd568a13704f36a721433a0

Log:
Merge branch 'PHP-5.3' into PHP-5.4

Changed paths:
  MM  ext/standard/string.c


Diff:



--
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-CVS] com php-src: Merge branch 'PHP-5.4' into PHP-5.5: ext/standard/string.c

2013-01-08 Thread Xinchen Hui
Commit:6deb8361f32d14fffdd284b47b59cd5dd50baf80
Author:Xinchen Hui larue...@php.net Wed, 9 Jan 2013 10:57:47 +0800
Parents:   9566314d626770c16875476a4c5dce0e63a57441 
f3b1b8516906fe900e521216c8f01e362790af30
Branches:  PHP-5.5

Link:   
http://git.php.net/?p=php-src.git;a=commitdiff;h=6deb8361f32d14fffdd284b47b59cd5dd50baf80

Log:
Merge branch 'PHP-5.4' into PHP-5.5

Changed paths:
  MM  ext/standard/string.c


Diff:



--
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-CVS] com php-src: Fixed bug #63882 (zend_std_compare_objects crash on recursion): NEWS Zend/tests/bug63882.phpt Zend/zend_object_handlers.c Zend/zend_objects_API.c Zend/zend_objects_API.h

2013-01-08 Thread Dmitry Stogov
Commit:f9e8678dd3a41ed8a100d8201153a41d6fd25f2e
Author:Dmitry Stogov dmi...@zend.com Wed, 9 Jan 2013 11:30:50 
+0400
Parents:   f3b1b8516906fe900e521216c8f01e362790af30
Branches:  PHP-5.4 PHP-5.5 master

Link:   
http://git.php.net/?p=php-src.git;a=commitdiff;h=f9e8678dd3a41ed8a100d8201153a41d6fd25f2e

Log:
Fixed bug #63882 (zend_std_compare_objects crash on recursion)

Bugs:
https://bugs.php.net/63882

Changed paths:
  M  NEWS
  A  Zend/tests/bug63882.phpt
  M  Zend/zend_object_handlers.c
  M  Zend/zend_objects_API.c
  M  Zend/zend_objects_API.h


Diff:
diff --git a/NEWS b/NEWS
index 1abd398..cfc0fa9 100644
--- a/NEWS
+++ b/NEWS
@@ -5,6 +5,7 @@ PHP 
   NEWS
 - Core:
   . Fixed bug #63943 (Bad warning text from strpos() on empty needle).
 (Laruence)
+  . Fixed bug #63882 (zend_std_compare_objects crash on recursion). (Dmitry)
 
 - Litespeed:
   . Fixed bug #63228 (-Werror=format-security error in lsapi code). (George)
diff --git a/Zend/tests/bug63882.phpt b/Zend/tests/bug63882.phpt
new file mode 100644
index 000..0cc1bab
--- /dev/null
+++ b/Zend/tests/bug63882.phpt
@@ -0,0 +1,15 @@
+--TEST--
+Bug #63882 (zend_std_compare_objects crash on recursion)
+--FILE--
+?php
+class Test { public $x = 5; }
+
+$testobj1 = new Test;
+$testobj2 = new Test;
+$testobj1-x = $testobj1;
+$testobj2-x = $testobj2;
+
+var_dump($testobj1 == $testobj2);
+?
+--EXPECTF--
+Fatal error: Nesting level too deep - recursive dependency? in %sbug63882.php 
on line 9
diff --git a/Zend/zend_object_handlers.c b/Zend/zend_object_handlers.c
index a76dfb3..3881c0e 100644
--- a/Zend/zend_object_handlers.c
+++ b/Zend/zend_object_handlers.c
@@ -35,6 +35,17 @@
 #define Z_OBJ_P(zval_p) \

((zend_object*)(EG(objects_store).object_buckets[Z_OBJ_HANDLE_P(zval_p)].bucket.obj.object))
 
+#define Z_OBJ_PROTECT_RECURSION(zval_p) \
+   do { \
+   if 
(EG(objects_store).object_buckets[Z_OBJ_HANDLE_P(zval_p)].apply_count++ = 3) { 
\
+   zend_error(E_ERROR, Nesting level too deep - recursive 
dependency?); \
+   } \
+   } while (0)
+
+
+#define Z_OBJ_UNPROTECT_RECURSION(zval_p) \
+   EG(objects_store).object_buckets[Z_OBJ_HANDLE_P(zval_p)].apply_count--
+
 /*
   __X accessors explanation:
 
@@ -1319,28 +1330,43 @@ static int zend_std_compare_objects(zval *o1, zval *o2 
TSRMLS_DC) /* {{{ */
}
if (!zobj1-properties  !zobj2-properties) {
int i;
+
+   Z_OBJ_PROTECT_RECURSION(o1);
+   Z_OBJ_PROTECT_RECURSION(o2);
for (i = 0; i  zobj1-ce-default_properties_count; i++) {
if (zobj1-properties_table[i]) {
if (zobj2-properties_table[i]) {
zval result;
 
if (compare_function(result, 
zobj1-properties_table[i], zobj2-properties_table[i] TSRMLS_CC)==FAILURE) {
+   Z_OBJ_UNPROTECT_RECURSION(o1);
+   Z_OBJ_UNPROTECT_RECURSION(o2);
return 1;
}
if (Z_LVAL(result) != 0) {
+   Z_OBJ_UNPROTECT_RECURSION(o1);
+   Z_OBJ_UNPROTECT_RECURSION(o2);
return Z_LVAL(result);
}
} else {
+   Z_OBJ_UNPROTECT_RECURSION(o1);
+   Z_OBJ_UNPROTECT_RECURSION(o2);
return 1;
}
} else {
if (zobj2-properties_table[i]) {
+   Z_OBJ_UNPROTECT_RECURSION(o1);
+   Z_OBJ_UNPROTECT_RECURSION(o2);
return 1;
} else {
+   Z_OBJ_UNPROTECT_RECURSION(o1);
+   Z_OBJ_UNPROTECT_RECURSION(o2);
return 0;
}
}
}
+   Z_OBJ_UNPROTECT_RECURSION(o1);
+   Z_OBJ_UNPROTECT_RECURSION(o2);
return 0;
} else {
if (!zobj1-properties) {
diff --git a/Zend/zend_objects_API.c b/Zend/zend_objects_API.c
index 4f3561e..1fe5d0c 100644
--- a/Zend/zend_objects_API.c
+++ b/Zend/zend_objects_API.c
@@ -117,6 +117,7 @@ ZEND_API zend_object_handle zend_objects_store_put(void 
*object, zend_objects_st
obj = EG(objects_store).object_buckets[handle].bucket.obj;