[PHP-CVS] cvs: php-src / README.UNICODE-UPGRADES

2005-09-27 Thread Andrei Zmievski
andrei  Tue Sep 27 15:56:39 2005 EDT

  Modified files:  
/php-srcREADME.UNICODE-UPGRADES 
  Log:
  strrev() walkthrough
  
  
http://cvs.php.net/diff.php/php-src/README.UNICODE-UPGRADES?r1=1.5&r2=1.6&ty=u
Index: php-src/README.UNICODE-UPGRADES
diff -u php-src/README.UNICODE-UPGRADES:1.5 php-src/README.UNICODE-UPGRADES:1.6
--- php-src/README.UNICODE-UPGRADES:1.5 Fri Sep 23 17:24:31 2005
+++ php-src/README.UNICODE-UPGRADES Tue Sep 27 15:56:39 2005
@@ -274,24 +274,24 @@
 This functions returns part of a string based on offset and length
 parameters.
 
-   void *str;
-   int32_t str_len, cp_len;
-   zend_uchar str_type;
-
-   if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "tl|l", &str, 
&str_len, &str_type, &f, &l) == FAILURE) {
-   return;
-   }
+void *str;
+int32_t str_len, cp_len;
+zend_uchar str_type;
+
+if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "tl|l", &str, 
&str_len, &str_type, &f, &l) == FAILURE) {
+return;
+}
 
 The first thing we notice is that the incoming string specifier is 't',
 which means that we can accept all 3 string types. The 'str' variable is
 declared as void*, because it can point to either UChar* or char*.
 The actual type of the incoming string is stored in 'str_type' variable.
 
-   if (str_type == IS_UNICODE) {
-   cp_len = u_countChar32(str, str_len);
-   } else {
-   cp_len = str_len;
-   }
+if (str_type == IS_UNICODE) {
+cp_len = u_countChar32(str, str_len);
+} else {
+cp_len = str_len;
+}
 
 If the string is a Unicode one, we cannot rely on the str_len value to tell
 us the number of characters in it. Instead, we call u_countChar32() to
@@ -300,12 +300,12 @@
 The next several lines normalize start and length parameters to fit within the
 string. Nothing new here. Then we locate the appropriate segment.
 
-   if (str_type == IS_UNICODE) {
-   int32_t start = 0, end = 0;
-   U16_FWD_N((UChar*)str, end, str_len, f);
-   start = end;
-   U16_FWD_N((UChar*)str, end, str_len, l);
-   RETURN_UNICODEL((UChar*)str + start, end-start, 1);
+if (str_type == IS_UNICODE) {
+int32_t start = 0, end = 0;
+U16_FWD_N((UChar*)str, end, str_len, f);
+start = end;
+U16_FWD_N((UChar*)str, end, str_len, l);
+RETURN_UNICODEL((UChar*)str + start, end-start, 1);
 
 Since codepoint (character) #n is not necessarily at offset #n in Unicode
 strings, we start at the beginning and iterate forward until we have gone
@@ -314,13 +314,84 @@
 of codepoints specified by the offset. Once that's done, we can return the
 segment as a Unicode string.
 
-   } else {
-   RETURN_STRINGL((char*)str + f, l, 1);
-   }
+} else {
+RETURN_STRINGL((char*)str + f, l, 1);
+}
 
 For native and binary types, we can return the segment directly.
 
 
+strrev()
+
+
+Let's look at strrev() which requires somewhat more complicated upgrade.
+While one of the guidelines for upgrades is that combining sequences are not
+really taken into account during processing -- substr() can break them up,
+for example -- in this case, we actually should be concerned, because
+reversing combining sequence may result in a completely different string. To
+illustrate:
+
+  a(U+0061 LATIN SMALL LETTER A)
+  o(U+006f LATIN SMALL LETTER O)
++ '(U+0301 COMBINING ACUTE ACCENT)
++ _(U+0320 COMBINING MINUS SIGN BELOW)
+  l(U+006C LATIN SMALL LETTER L)
+
+Reversing this would result in:
+
+  l(U+006C LATIN SMALL LETTER L)
++ _(U+0320 COMBINING MINUS SIGN BELOW)
++ '(U+0301 COMBINING ACUTE ACCENT)
+  o(U+006f LATIN SMALL LETTER O)
+  a(U+0061 LATIN SMALL LETTER A)
+
+All of a sudden the combining marks are being applied to 'l' instead of 'o'.
+To avoid this, we need to treat combininig sequences as a unit, by checking
+the combining character class of each character with u_getCombiningClass().
+
+strrev() obtains its single argument, a string, and unless the string is of
+Unicode type, processes it exactly as before, simply swapping bytes around.
+For Unicode case, the magic is like this:
+
+   int32_t i, x1, x2;
+   UChar32 ch;
+   UChar *u_s, *u_n, *u_p;
+
+u_n = eumalloc(Z_USTRLEN_PP(str)+1);
+u_p = u_n;
+u_s = Z_USTRVAL_PP(str);
+
+i = Z_USTRLEN_PP(str);
+while (i > 0) {
+U16_PREV(u_s, 0, i, ch);
+if (u_getCombiningClass(ch) == 0) {
+u_p += zend_codepoint_to_uchar(ch, u_p);
+} else {
+x2 = i;
+do {
+U16_PREV(u_s, 0, i, ch);
+} while (u_getCombiningClass(ch) != 0);
+x1 = i;
+while (x1 <= x2) {
+U16_NEXT(u_s, x1, Z_USTRLEN_PP(str), ch);
+u_p += zend_codepoint_to_uchar(ch, u_p);
+}

[PHP-CVS] cvs: php-src /main rfc1867.c

2005-09-27 Thread Andrei Zmievski
andrei  Tue Sep 27 13:50:00 2005 EDT

  Modified files:  
/php-src/main   rfc1867.c 
  Log:
  Unicode fixes.
  
  
http://cvs.php.net/diff.php/php-src/main/rfc1867.c?r1=1.175&r2=1.176&ty=u
Index: php-src/main/rfc1867.c
diff -u php-src/main/rfc1867.c:1.175 php-src/main/rfc1867.c:1.176
--- php-src/main/rfc1867.c:1.175Wed Aug 31 16:42:14 2005
+++ php-src/main/rfc1867.c  Tue Sep 27 13:50:00 2005
@@ -17,7 +17,7 @@
+--+
  */
 
-/* $Id: rfc1867.c,v 1.175 2005/08/31 20:42:14 andrei Exp $ */
+/* $Id: rfc1867.c,v 1.176 2005/09/27 17:50:00 andrei Exp $ */
 
 /*
  *  This product includes software developed by the Apache Group
@@ -1227,22 +1227,24 @@
/* New Rule: never repair potential malicious user 
input */
if (!skip_upload) {
UChar32 c = 0;
-   int32_t ic;
+   int32_t ic, l_ic;
long l = 0;
 
for (ic = 0; ic < param_len; ) {
+   l_ic = ic;
U16_NEXT(param, ic, param_len, c);
if (c == 0x5b /*'['*/) {
l++;
} else if (c == 0x5d /*']'*/) {
l--;
+   l_ic = ic;
U16_NEXT(param, ic, param_len, 
c);
if (ic < param_len && c != 0x5b 
/*'['*/) {
skip_upload = 1;
break;
} else {
-   /* decrement index so 
that the same character is retrieved again */
-   ic--;
+   /* go back so that the 
same character is retrieved again */
+   ic = l_ic;
}
}
if (l < 0) {
@@ -1281,12 +1283,12 @@
{
if (PG(upload_max_filesize) > 0 && total_bytes 
> PG(upload_max_filesize)) {
 #if DEBUG_FILE_UPLOAD
-   sapi_module.sapi_error(E_NOTICE, 
"upload_max_filesize of %ld bytes exceeded - file [%s=%s] not saved", 
PG(upload_max_filesize), param, filename);
+   sapi_module.sapi_error(E_NOTICE, 
"upload_max_filesize of %ld bytes exceeded - file [%r=%r] not saved", 
PG(upload_max_filesize), param, filename);
 #endif
cancel_upload = UPLOAD_ERROR_A;
} else if (max_file_size && (total_bytes > 
max_file_size)) {
 #if DEBUG_FILE_UPLOAD
-   sapi_module.sapi_error(E_NOTICE, 
"MAX_FILE_SIZE of %ld bytes exceeded - file [%s=%s] not saved", max_file_size, 
param, filename);
+   sapi_module.sapi_error(E_NOTICE, 
"MAX_FILE_SIZE of %ld bytes exceeded - file [%r=%r] not saved", max_file_size, 
param, filename);
 #endif
cancel_upload = UPLOAD_ERROR_B;
} else if (blen > 0) {
@@ -1313,7 +1315,7 @@
}
 #if DEBUG_FILE_UPLOAD
if(u_strlen(filename) > 0 && total_bytes == 0 && 
!cancel_upload) {
-   sapi_module.sapi_error(E_WARNING, "Uploaded 
file size 0 - file [%v=%v] not saved", param, filename);
+   sapi_module.sapi_error(E_WARNING, "Uploaded 
file size 0 - file [%r=%r] not saved", param, filename);
cancel_upload = 5;
}
 #endif 

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



[PHP-CVS] cvs: php-src(PHP_5_0) / NEWS /ext/soap soap.c /ext/soap/tests/bugs bug34643.phpt bug34643.wsdl

2005-09-27 Thread Dmitry Stogov
dmitry  Tue Sep 27 11:26:26 2005 EDT

  Added files: (Branch: PHP_5_0)
/php-src/ext/soap/tests/bugsbug34643.phpt bug34643.wsdl 

  Modified files:  
/php-srcNEWS 
/php-src/ext/soap   soap.c 
  Log:
  Fixed bug #34643 (wsdl default value has no effect)
  
  
http://cvs.php.net/diff.php/php-src/NEWS?r1=1.1760.2.484&r2=1.1760.2.485&ty=u
Index: php-src/NEWS
diff -u php-src/NEWS:1.1760.2.484 php-src/NEWS:1.1760.2.485
--- php-src/NEWS:1.1760.2.484   Tue Sep 20 07:55:32 2005
+++ php-src/NEWSTue Sep 27 11:26:24 2005
@@ -2,6 +2,7 @@
 |||
 ?? ??? , PHP 5.0.6
 - Renamed CachingRecursiveIterator to RecursiveCachingIterator. (Marcus)
+- Fixed bug #34643 (wsdl default value has no effect). (Dmitry)
 - Fixed bug #34505 (Possible memory corruption when unmangling properties 
   with empty names). (Tony)
 - Fixed bug #34478 (Incorrect parsing of url's fragment (#...)). (Dmitry)
http://cvs.php.net/diff.php/php-src/ext/soap/soap.c?r1=1.110.2.43&r2=1.110.2.44&ty=u
Index: php-src/ext/soap/soap.c
diff -u php-src/ext/soap/soap.c:1.110.2.43 php-src/ext/soap/soap.c:1.110.2.44
--- php-src/ext/soap/soap.c:1.110.2.43  Mon Sep 12 04:26:05 2005
+++ php-src/ext/soap/soap.c Tue Sep 27 11:26:25 2005
@@ -17,7 +17,7 @@
   |  Dmitry Stogov <[EMAIL PROTECTED]> |
   +--+
 */
-/* $Id: soap.c,v 1.110.2.43 2005/09/12 08:26:05 dmitry Exp $ */
+/* $Id: soap.c,v 1.110.2.44 2005/09/27 15:26:25 dmitry Exp $ */
 
 #ifdef HAVE_CONFIG_H
 #include "config.h"
@@ -4004,9 +4004,21 @@
 {
xmlNodePtr xmlParam;
encodePtr enc;
+   zval defval;
 
if (param != NULL) {
enc = param->encode;
+   if (val == NULL || Z_TYPE_P(val) == IS_NULL) {
+   if (param->element) {
+   if (param->element->fixed) {
+   ZVAL_STRING(&defval, 
param->element->fixed, 0);
+   val = &defval;
+   } else if (param->element->def && 
!param->element->nillable) {
+   ZVAL_STRING(&defval, 
param->element->def, 0);
+   val = &defval;
+   }
+   }
+   }
} else {
enc = NULL;
}

http://cvs.php.net/co.php/php-src/ext/soap/tests/bugs/bug34643.phpt?r=1.1&p=1
Index: php-src/ext/soap/tests/bugs/bug34643.phpt
+++ php-src/ext/soap/tests/bugs/bug34643.phpt
--TEST--
Bug #34643 (wsdl default value)
--SKIPIF--

--INI--
soap.wsdl_cache_enabled=0
--FILE--
server = new SoapServer($wsdl, $options);
$this->server->setClass('fp');
  }

  function __doRequest($request, $location, $action, $version) {
ob_start();
$this->server->handle($request);
$response = ob_get_contents();
ob_end_clean();
return $response;
  }

}

$cl = new LocalSoapClient(dirname(__FILE__).'/bug34643.wsdl', 
array("trace"=>1));
print_r($cl->__getFunctions());
echo $cl->get_it("aaa")."\n";
echo $cl->get_it()."\n";
?>
--EXPECT--
Array
(
[0] => string get_it(string $opt)
)
aaa
zzz

http://cvs.php.net/co.php/php-src/ext/soap/tests/bugs/bug34643.wsdl?r=1.1&p=1
Index: php-src/ext/soap/tests/bugs/bug34643.wsdl
+++ php-src/ext/soap/tests/bugs/bug34643.wsdl

http://www.w3.org/2001/XMLSchema";
xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/";
xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/";
xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/";
xmlns="http://schemas.xmlsoap.org/wsdl/";>

http://www.w3.org/2001/XMLSchema"; 
targetNamespace="urn:wsdl">
















http://schemas.xmlsoap.org/soap/http"/>



http://schemas.xmlsoap.org/soap/encoding/"/>


http://schemas.xmlsoap.org/soap/encoding/"/>










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



[PHP-CVS] cvs: php-src(PHP_5_1) / NEWS /ext/soap soap.c /ext/soap/tests/bugs bug34643.phpt bug34643.wsdl

2005-09-27 Thread Dmitry Stogov
dmitry  Tue Sep 27 11:25:10 2005 EDT

  Added files: (Branch: PHP_5_1)
/php-src/ext/soap/tests/bugsbug34643.phpt bug34643.wsdl 

  Modified files:  
/php-srcNEWS 
/php-src/ext/soap   soap.c 
  Log:
  Fixed bug #34643 (wsdl default value has no effect)
  
  
http://cvs.php.net/diff.php/php-src/NEWS?r1=1.2027.2.80&r2=1.2027.2.81&ty=u
Index: php-src/NEWS
diff -u php-src/NEWS:1.2027.2.80 php-src/NEWS:1.2027.2.81
--- php-src/NEWS:1.2027.2.80Tue Sep 27 11:07:49 2005
+++ php-src/NEWSTue Sep 27 11:25:09 2005
@@ -36,6 +36,7 @@
 - Fixed failing queries (FALSE returned) with mysqli_query() on 64 bit systems.
   (Andrey)
 - Fixed bug #34645 (ctype corrupts memory when validating large numbers). 
(Ilia)
+- Fixed bug #34643 (wsdl default value has no effect). (Dmitry)
 - Fixed bug #34590 (User defined PDOStatement class can't implement methods).
   (Marcus)
 - Fixed bug #34584 (Segfault with SPL autoload handler). (Marcus)
http://cvs.php.net/diff.php/php-src/ext/soap/soap.c?r1=1.156.2.3&r2=1.156.2.4&ty=u
Index: php-src/ext/soap/soap.c
diff -u php-src/ext/soap/soap.c:1.156.2.3 php-src/ext/soap/soap.c:1.156.2.4
--- php-src/ext/soap/soap.c:1.156.2.3   Mon Sep 12 04:24:00 2005
+++ php-src/ext/soap/soap.c Tue Sep 27 11:25:09 2005
@@ -17,7 +17,7 @@
   |  Dmitry Stogov <[EMAIL PROTECTED]> |
   +--+
 */
-/* $Id: soap.c,v 1.156.2.3 2005/09/12 08:24:00 dmitry Exp $ */
+/* $Id: soap.c,v 1.156.2.4 2005/09/27 15:25:09 dmitry Exp $ */
 
 #ifdef HAVE_CONFIG_H
 #include "config.h"
@@ -4018,9 +4018,21 @@
 {
xmlNodePtr xmlParam;
encodePtr enc;
+   zval defval;
 
if (param != NULL) {
enc = param->encode;
+   if (val == NULL || Z_TYPE_P(val) == IS_NULL) {
+   if (param->element) {
+   if (param->element->fixed) {
+   ZVAL_STRING(&defval, 
param->element->fixed, 0);
+   val = &defval;
+   } else if (param->element->def && 
!param->element->nillable) {
+   ZVAL_STRING(&defval, 
param->element->def, 0);
+   val = &defval;
+   }
+   }
+   }
} else {
enc = NULL;
}

http://cvs.php.net/co.php/php-src/ext/soap/tests/bugs/bug34643.phpt?r=1.1&p=1
Index: php-src/ext/soap/tests/bugs/bug34643.phpt
+++ php-src/ext/soap/tests/bugs/bug34643.phpt
--TEST--
Bug #34643 (wsdl default value)
--SKIPIF--

--INI--
soap.wsdl_cache_enabled=0
--FILE--
server = new SoapServer($wsdl, $options);
$this->server->setClass('fp');
  }

  function __doRequest($request, $location, $action, $version) {
ob_start();
$this->server->handle($request);
$response = ob_get_contents();
ob_end_clean();
return $response;
  }

}

$cl = new LocalSoapClient(dirname(__FILE__).'/bug34643.wsdl', 
array("trace"=>1));
print_r($cl->__getFunctions());
echo $cl->get_it("aaa")."\n";
echo $cl->get_it()."\n";
?>
--EXPECT--
Array
(
[0] => string get_it(string $opt)
)
aaa
zzz

http://cvs.php.net/co.php/php-src/ext/soap/tests/bugs/bug34643.wsdl?r=1.1&p=1
Index: php-src/ext/soap/tests/bugs/bug34643.wsdl
+++ php-src/ext/soap/tests/bugs/bug34643.wsdl

http://www.w3.org/2001/XMLSchema";
xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/";
xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/";
xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/";
xmlns="http://schemas.xmlsoap.org/wsdl/";>

http://www.w3.org/2001/XMLSchema"; 
targetNamespace="urn:wsdl">
















http://schemas.xmlsoap.org/soap/http"/>



http://schemas.xmlsoap.org/soap/encoding/"/>


http://schemas.xmlsoap.org/soap/encoding/"/>










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



[PHP-CVS] cvs: php-src /ext/soap soap.c /ext/soap/tests/bugs bug34643.phpt bug34643.wsdl

2005-09-27 Thread Dmitry Stogov
dmitry  Tue Sep 27 11:24:47 2005 EDT

  Added files: 
/php-src/ext/soap/tests/bugsbug34643.phpt bug34643.wsdl 

  Modified files:  
/php-src/ext/soap   soap.c 
  Log:
  Fixed bug #34643 (wsdl default value has no effect)
  
  
http://cvs.php.net/diff.php/php-src/ext/soap/soap.c?r1=1.160&r2=1.161&ty=u
Index: php-src/ext/soap/soap.c
diff -u php-src/ext/soap/soap.c:1.160 php-src/ext/soap/soap.c:1.161
--- php-src/ext/soap/soap.c:1.160   Mon Sep 12 04:23:49 2005
+++ php-src/ext/soap/soap.c Tue Sep 27 11:24:47 2005
@@ -17,7 +17,7 @@
   |  Dmitry Stogov <[EMAIL PROTECTED]> |
   +--+
 */
-/* $Id: soap.c,v 1.160 2005/09/12 08:23:49 dmitry Exp $ */
+/* $Id: soap.c,v 1.161 2005/09/27 15:24:47 dmitry Exp $ */
 
 #ifdef HAVE_CONFIG_H
 #include "config.h"
@@ -4018,9 +4018,21 @@
 {
xmlNodePtr xmlParam;
encodePtr enc;
+   zval defval;
 
if (param != NULL) {
enc = param->encode;
+   if (val == NULL || Z_TYPE_P(val) == IS_NULL) {
+   if (param->element) {
+   if (param->element->fixed) {
+   ZVAL_STRING(&defval, 
param->element->fixed, 0);
+   val = &defval;
+   } else if (param->element->def && 
!param->element->nillable) {
+   ZVAL_STRING(&defval, 
param->element->def, 0);
+   val = &defval;
+   }
+   }
+   }
} else {
enc = NULL;
}

http://cvs.php.net/co.php/php-src/ext/soap/tests/bugs/bug34643.phpt?r=1.1&p=1
Index: php-src/ext/soap/tests/bugs/bug34643.phpt
+++ php-src/ext/soap/tests/bugs/bug34643.phpt
--TEST--
Bug #34643 (wsdl default value)
--SKIPIF--

--INI--
soap.wsdl_cache_enabled=0
--FILE--
server = new SoapServer($wsdl, $options);
$this->server->setClass('fp');
  }

  function __doRequest($request, $location, $action, $version) {
ob_start();
$this->server->handle($request);
$response = ob_get_contents();
ob_end_clean();
return $response;
  }

}

$cl = new LocalSoapClient(dirname(__FILE__).'/bug34643.wsdl', 
array("trace"=>1));
print_r($cl->__getFunctions());
echo $cl->get_it("aaa")."\n";
echo $cl->get_it()."\n";
?>
--EXPECT--
Array
(
[0] => string get_it(string $opt)
)
aaa
zzz

http://cvs.php.net/co.php/php-src/ext/soap/tests/bugs/bug34643.wsdl?r=1.1&p=1
Index: php-src/ext/soap/tests/bugs/bug34643.wsdl
+++ php-src/ext/soap/tests/bugs/bug34643.wsdl

http://www.w3.org/2001/XMLSchema";
xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/";
xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/";
xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/";
xmlns="http://schemas.xmlsoap.org/wsdl/";>

http://www.w3.org/2001/XMLSchema"; 
targetNamespace="urn:wsdl">
















http://schemas.xmlsoap.org/soap/http"/>



http://schemas.xmlsoap.org/soap/encoding/"/>


http://schemas.xmlsoap.org/soap/encoding/"/>










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



[PHP-CVS] cvs: php-src(PHP_4_4) / NEWS /main fopen_wrappers.c

2005-09-27 Thread Ilia Alshanetsky
iliaa   Tue Sep 27 11:08:44 2005 EDT

  Modified files:  (Branch: PHP_4_4)
/php-src/main   fopen_wrappers.c 
/php-srcNEWS 
  Log:
  MFH: Fixed bug #32937 (open_basedir looses trailing / in the limiter).
  
  
http://cvs.php.net/diff.php/php-src/main/fopen_wrappers.c?r1=1.153.2.10.2.1&r2=1.153.2.10.2.2&ty=u
Index: php-src/main/fopen_wrappers.c
diff -u php-src/main/fopen_wrappers.c:1.153.2.10.2.1 
php-src/main/fopen_wrappers.c:1.153.2.10.2.2
--- php-src/main/fopen_wrappers.c:1.153.2.10.2.1Tue Jul 26 09:51:33 2005
+++ php-src/main/fopen_wrappers.c   Tue Sep 27 11:08:43 2005
@@ -16,7 +16,7 @@
|  Jim Winstead <[EMAIL PROTECTED]> 
|
+--+
  */
-/* $Id: fopen_wrappers.c,v 1.153.2.10.2.1 2005/07/26 13:51:33 hyanantha Exp $ 
*/
+/* $Id: fopen_wrappers.c,v 1.153.2.10.2.2 2005/09/27 15:08:43 iliaa Exp $ */
 
 /* {{{ includes
  */
@@ -110,8 +110,8 @@
/* Handler for basedirs that end with a / */
resolved_basedir_len = strlen(resolved_basedir);
if (basedir[strlen(basedir) - 1] == PHP_DIR_SEPARATOR) {
-   if (resolved_basedir[resolved_basedir_len - 1] == '/') {
-   resolved_basedir[resolved_basedir_len - 1] = 
PHP_DIR_SEPARATOR;
+   if (resolved_basedir[resolved_basedir_len - 1] != 
PHP_DIR_SEPARATOR) {
+   resolved_basedir[resolved_basedir_len] = 
PHP_DIR_SEPARATOR;
resolved_basedir[++resolved_basedir_len] = '\0';
}
}
http://cvs.php.net/diff.php/php-src/NEWS?r1=1.1247.2.920.2.41&r2=1.1247.2.920.2.42&ty=u
Index: php-src/NEWS
diff -u php-src/NEWS:1.1247.2.920.2.41 php-src/NEWS:1.1247.2.920.2.42
--- php-src/NEWS:1.1247.2.920.2.41  Mon Sep 26 11:19:04 2005
+++ php-src/NEWSTue Sep 27 11:08:43 2005
@@ -28,6 +28,7 @@
   (Ilia)
 - Fixed bug #33940 (array_map() fails to pass by reference when called
   recursively). (Dmitry)
+- Fixed bug #32937 (open_basedir looses trailing / in the limiter). (Adam C.)
 - Fixed bug #33690 (Crash setting some ini directives in httpd.conf). (Rasmus)
 - Fixed bug #33673 (Added detection for partially uploaded files). (Ilia)
 - Fixed bug #33648 (Using --with-regex=system causes compile failure). (Andrei)

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



[PHP-CVS] cvs: php-src(PHP_5_0) /main fopen_wrappers.c

2005-09-27 Thread Ilia Alshanetsky
iliaa   Tue Sep 27 11:08:11 2005 EDT

  Modified files:  (Branch: PHP_5_0)
/php-src/main   fopen_wrappers.c 
  Log:
  MFH: Fixed bug #32937 (open_basedir looses trailing / in the limiter).
  
  
http://cvs.php.net/diff.php/php-src/main/fopen_wrappers.c?r1=1.170.2.4&r2=1.170.2.5&ty=u
Index: php-src/main/fopen_wrappers.c
diff -u php-src/main/fopen_wrappers.c:1.170.2.4 
php-src/main/fopen_wrappers.c:1.170.2.5
--- php-src/main/fopen_wrappers.c:1.170.2.4 Sat Jul 16 08:14:44 2005
+++ php-src/main/fopen_wrappers.c   Tue Sep 27 11:08:11 2005
@@ -17,7 +17,7 @@
+--+
  */
 
-/* $Id: fopen_wrappers.c,v 1.170.2.4 2005/07/16 12:14:44 hyanantha Exp $ */
+/* $Id: fopen_wrappers.c,v 1.170.2.5 2005/09/27 15:08:11 iliaa Exp $ */
 
 /* {{{ includes
  */
@@ -109,8 +109,8 @@
/* Handler for basedirs that end with a / */
resolved_basedir_len = strlen(resolved_basedir);
if (basedir[strlen(basedir) - 1] == PHP_DIR_SEPARATOR) {
-   if (resolved_basedir[resolved_basedir_len - 1] == '/') {
-   resolved_basedir[resolved_basedir_len - 1] = 
PHP_DIR_SEPARATOR;
+   if (resolved_basedir[resolved_basedir_len - 1] != 
PHP_DIR_SEPARATOR) {
+   resolved_basedir[resolved_basedir_len] = 
PHP_DIR_SEPARATOR;
resolved_basedir[++resolved_basedir_len] = '\0';
}
}

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



[PHP-CVS] cvs: php-src(PHP_5_1) / NEWS /main fopen_wrappers.c

2005-09-27 Thread Ilia Alshanetsky
iliaa   Tue Sep 27 11:07:49 2005 EDT

  Modified files:  (Branch: PHP_5_1)
/php-src/main   fopen_wrappers.c 
/php-srcNEWS 
  Log:
  MFH: Fixed bug #32937 (open_basedir looses trailing / in the limiter).
  
  
http://cvs.php.net/diff.php/php-src/main/fopen_wrappers.c?r1=1.175&r2=1.175.2.1&ty=u
Index: php-src/main/fopen_wrappers.c
diff -u php-src/main/fopen_wrappers.c:1.175 
php-src/main/fopen_wrappers.c:1.175.2.1
--- php-src/main/fopen_wrappers.c:1.175 Wed Aug  3 10:08:28 2005
+++ php-src/main/fopen_wrappers.c   Tue Sep 27 11:07:48 2005
@@ -17,7 +17,7 @@
+--+
  */
 
-/* $Id: fopen_wrappers.c,v 1.175 2005/08/03 14:08:28 sniper Exp $ */
+/* $Id: fopen_wrappers.c,v 1.175.2.1 2005/09/27 15:07:48 iliaa Exp $ */
 
 /* {{{ includes
  */
@@ -108,8 +108,8 @@
/* Handler for basedirs that end with a / */
resolved_basedir_len = strlen(resolved_basedir);
if (basedir[strlen(basedir) - 1] == PHP_DIR_SEPARATOR) {
-   if (resolved_basedir[resolved_basedir_len - 1] == '/') {
-   resolved_basedir[resolved_basedir_len - 1] = 
PHP_DIR_SEPARATOR;
+   if (resolved_basedir[resolved_basedir_len - 1] != 
PHP_DIR_SEPARATOR) {
+   resolved_basedir[resolved_basedir_len] = 
PHP_DIR_SEPARATOR;
resolved_basedir[++resolved_basedir_len] = '\0';
}
}
http://cvs.php.net/diff.php/php-src/NEWS?r1=1.2027.2.79&r2=1.2027.2.80&ty=u
Index: php-src/NEWS
diff -u php-src/NEWS:1.2027.2.79 php-src/NEWS:1.2027.2.80
--- php-src/NEWS:1.2027.2.79Tue Sep 27 04:23:20 2005
+++ php-src/NEWSTue Sep 27 11:07:49 2005
@@ -129,6 +129,7 @@
 - Fixed bug #33326 (Cannot build extensions with phpize on Macosx). (Jani)
 - Fixed bug #32981 (ReflectionMethod::getStaticVariables() causes apache2.0.54
   seg fault). (Dmitry)
+- Fixed bug #32937 (open_basedir looses trailing / in the limiter). (Adam 
Conrad)
 - Fixed bug #32589 (possible crash inside imap_mail_compose() function). (Ilia)
 - Fixed bug #32139 (SOAP client does not auto-handle base64 encoding). (Ilia)
 - Fixed bug #32010 (Memory leak in mssql_fetch_batch). (fmk)

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



[PHP-CVS] cvs: php-src /main fopen_wrappers.c

2005-09-27 Thread Ilia Alshanetsky
iliaa   Tue Sep 27 11:07:39 2005 EDT

  Modified files:  
/php-src/main   fopen_wrappers.c 
  Log:
  Fixed bug #32937 (open_basedir looses trailing / in the limiter).
  
  Patch by Adam Conrad
  
  
http://cvs.php.net/diff.php/php-src/main/fopen_wrappers.c?r1=1.175&r2=1.176&ty=u
Index: php-src/main/fopen_wrappers.c
diff -u php-src/main/fopen_wrappers.c:1.175 php-src/main/fopen_wrappers.c:1.176
--- php-src/main/fopen_wrappers.c:1.175 Wed Aug  3 10:08:28 2005
+++ php-src/main/fopen_wrappers.c   Tue Sep 27 11:07:38 2005
@@ -17,7 +17,7 @@
+--+
  */
 
-/* $Id: fopen_wrappers.c,v 1.175 2005/08/03 14:08:28 sniper Exp $ */
+/* $Id: fopen_wrappers.c,v 1.176 2005/09/27 15:07:38 iliaa Exp $ */
 
 /* {{{ includes
  */
@@ -108,8 +108,8 @@
/* Handler for basedirs that end with a / */
resolved_basedir_len = strlen(resolved_basedir);
if (basedir[strlen(basedir) - 1] == PHP_DIR_SEPARATOR) {
-   if (resolved_basedir[resolved_basedir_len - 1] == '/') {
-   resolved_basedir[resolved_basedir_len - 1] = 
PHP_DIR_SEPARATOR;
+   if (resolved_basedir[resolved_basedir_len - 1] != 
PHP_DIR_SEPARATOR) {
+   resolved_basedir[resolved_basedir_len] = 
PHP_DIR_SEPARATOR;
resolved_basedir[++resolved_basedir_len] = '\0';
}
}

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



[PHP-CVS] cvs: php-src /tests/classes tostring_003.phpt

2005-09-27 Thread Dmitry Stogov
dmitry  Tue Sep 27 04:50:23 2005 EDT

  Modified files:  
/php-src/tests/classes  tostring_003.phpt 
  Log:
  MFH
  
  
http://cvs.php.net/diff.php/php-src/tests/classes/tostring_003.phpt?r1=1.1&r2=1.2&ty=u
Index: php-src/tests/classes/tostring_003.phpt
diff -u php-src/tests/classes/tostring_003.phpt:1.1 
php-src/tests/classes/tostring_003.phpt:1.2
--- php-src/tests/classes/tostring_003.phpt:1.1 Tue Sep 27 04:37:37 2005
+++ php-src/tests/classes/tostring_003.phpt Tue Sep 27 04:50:23 2005
@@ -34,3 +34,6 @@
 --EXPECTF--
 string(5) "Damn!"
 DONE
+--UEXPECTF--
+unicode(5) "Damn!"
+DONE

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



[PHP-CVS] cvs: php-src /tests/classes tostring_001.phpt

2005-09-27 Thread Marcus Boerger
helly   Tue Sep 27 04:46:54 2005 EDT

  Modified files:  
/php-src/tests/classes  tostring_001.phpt 
  Log:
  - Need to rename in expectations, too
  
http://cvs.php.net/diff.php/php-src/tests/classes/tostring_001.phpt?r1=1.1&r2=1.2&ty=u
Index: php-src/tests/classes/tostring_001.phpt
diff -u php-src/tests/classes/tostring_001.phpt:1.1 
php-src/tests/classes/tostring_001.phpt:1.2
--- php-src/tests/classes/tostring_001.phpt:1.1 Tue Sep 27 04:41:23 2005
+++ php-src/tests/classes/tostring_001.phpt Tue Sep 27 04:46:53 2005
@@ -92,7 +92,7 @@
 test7
 test2::__toString()
 
-Warning: Illegal offset type in %stostring.php on line %d
+Warning: Illegal offset type in %stostring_001.php on line %d
 test8
 test2::__toString()
 string(9) "Converted"
@@ -141,7 +141,7 @@
 test7
 test2::__toString()
 
-Warning: Illegal offset type in %stostring.php on line %d
+Warning: Illegal offset type in %stostring_001.php on line %d
 test8
 test2::__toString()
 unicode(9) "Converted"

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



[PHP-CVS] cvs: php-src /tests/classes tostring.phpt tostring_001.phpt

2005-09-27 Thread Marcus Boerger
helly   Tue Sep 27 04:41:24 2005 EDT

  Added files: 
/php-src/tests/classes  tostring_001.phpt 

  Removed files:   
/php-src/tests/classes  tostring.phpt 
  Log:
  - Rename test to be consistent
  
  

http://cvs.php.net/co.php/php-src/tests/classes/tostring_001.phpt?r=1.1&p=1
Index: php-src/tests/classes/tostring_001.phpt
+++ php-src/tests/classes/tostring_001.phpt
--TEST--
ZE2 __toString()
--SKIPIF--

--FILE--
__toString()] = "ERROR";
echo $ar[$o];

echo "test8\n";
var_dump(trim($o));
var_dump(trim((string)$o));

echo "test9\n";
echo sprintf("%s", $o);
?>
DONE!
--EXPECTF--
test1
test1 Object
(
)
string(12) "Object id #%d"
object(test1)#%d (0) {
}
test2
test2 Object
(
)
test2::__toString()
Converted
object(test2)#%d (%d) {
}
test3
test2::__toString()
Converted
test4
test2::__toString()
string:Converted
test5
test2::__toString()
1Converted
test2::__toString()
1Converted
test6
test2::__toString()
test2::__toString()
Converted
Converted
test2::__toString()
Converted
test2::__toString()
Converted
test7
test2::__toString()

Warning: Illegal offset type in %stostring.php on line %d
test8
test2::__toString()
string(9) "Converted"
test2::__toString()
string(9) "Converted"
test9
test2::__toString()
Converted
DONE!
--UEXPECTF--
test1
test1 Object
(
)
string(12) "Object id #%d"
object(test1)#%d (0) {
}
test2
test2 Object
(
)
test2::__toString()
Converted
object(test2)#%d (%d) {
}
test3
test2::__toString()
Converted
test4
test2::__toString()
string:Converted
test5
test2::__toString()
1Converted
test2::__toString()
1Converted
test6
test2::__toString()
test2::__toString()
Converted
Converted
test2::__toString()
Converted
test2::__toString()
Converted
test7
test2::__toString()

Warning: Illegal offset type in %stostring.php on line %d
test8
test2::__toString()
unicode(9) "Converted"
test2::__toString()
unicode(9) "Converted"
test9
test2::__toString()
Converted
DONE!

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



[PHP-CVS] cvs: php-src /tests/classes tostring_002.phpt tostring_003.phpt

2005-09-27 Thread Marcus Boerger
helly   Tue Sep 27 04:37:40 2005 EDT

  Added files: 
/php-src/tests/classes  tostring_003.phpt tostring_002.phpt 
  Log:
  - Add new tests
  

http://cvs.php.net/co.php/php-src/tests/classes/tostring_003.phpt?r=1.1&p=1
Index: php-src/tests/classes/tostring_003.phpt
+++ php-src/tests/classes/tostring_003.phpt
--TEST--
ZE2 __toString() in __destruct/exception
--SKIPIF--

--FILE--
getMessage());
}

?>
DONE
--EXPECTF--
string(5) "Damn!"
DONE

http://cvs.php.net/co.php/php-src/tests/classes/tostring_002.phpt?r=1.1&p=1
Index: php-src/tests/classes/tostring_002.phpt
+++ php-src/tests/classes/tostring_002.phpt
--TEST--
ZE2 __toString() in __destruct
--SKIPIF--

--FILE--

DONE
--EXPECTF--
Hello
DONE
Hello

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



[PHP-CVS] cvs: php-src / NEWS

2005-09-27 Thread Marcus Boerger
helly   Tue Sep 27 04:25:34 2005 EDT

  Modified files:  
/php-srcNEWS 
  Log:
  - BFN
  
http://cvs.php.net/diff.php/php-src/NEWS?r1=1.2066&r2=1.2067&ty=u
Index: php-src/NEWS
diff -u php-src/NEWS:1.2066 php-src/NEWS:1.2067
--- php-src/NEWS:1.2066 Tue Sep 27 03:58:59 2005
+++ php-src/NEWSTue Sep 27 04:25:34 2005
@@ -17,3 +17,4 @@
   the part of haystack before or after first occurence of needle. (Johannes)
 - Added possibility to check in which extension an internal function was
   defined using reflection API. (Johannes)
+- Fixed bug #34286 (__toString() behavior is inconsistent). (Marcus)

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



[PHP-CVS] cvs: php-src(PHP_5_1) / NEWS

2005-09-27 Thread Marcus Boerger
helly   Tue Sep 27 04:23:21 2005 EDT

  Modified files:  (Branch: PHP_5_1)
/php-srcNEWS 
  Log:
  - BFN
  
http://cvs.php.net/diff.php/php-src/NEWS?r1=1.2027.2.78&r2=1.2027.2.79&ty=u
Index: php-src/NEWS
diff -u php-src/NEWS:1.2027.2.78 php-src/NEWS:1.2027.2.79
--- php-src/NEWS:1.2027.2.78Mon Sep 26 15:33:23 2005
+++ php-src/NEWSTue Sep 27 04:23:20 2005
@@ -38,6 +38,7 @@
 - Fixed bug #34645 (ctype corrupts memory when validating large numbers). 
(Ilia)
 - Fixed bug #34590 (User defined PDOStatement class can't implement methods).
   (Marcus)
+- Fixed bug #34584 (Segfault with SPL autoload handler). (Marcus)
 - Fixed bug #34565 (mb_send_mail does not fetch mail.force_extra_parameters).
   (Marco, Ilia)
 - Fixed bug #34518 (Unset doesn't separate container in CV). (Dmitry)
@@ -106,6 +107,7 @@
 - Fixed bug #33917 (number_format() output with > 1 char separators). (Jani)
 - Fixed bug #33904 (input array keys being escaped when magic quotes is off). 
   (Ilia)
+- Fixed bug #33903 (spl_autoload_register class method). (Marcus)
 - Fixed bug #33899 (CLI: setting extension_dir=some/path extension=foobar.so
   does not work). (Jani)
 - Fixed bug #33882 (CLI was looking for php.ini in wrong path). (Hartmut)

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



[PHP-CVS] cvs: php-src /tests/classes tostring.phpt

2005-09-27 Thread Dmitry Stogov
dmitry  Tue Sep 27 03:59:18 2005 EDT

  Modified files:  
/php-src/tests/classes  tostring.phpt 
  Log:
  Changed __toString() behavior to call it in all necessary places
  
  
http://cvs.php.net/diff.php/php-src/tests/classes/tostring.phpt?r1=1.6&r2=1.7&ty=u
Index: php-src/tests/classes/tostring.phpt
diff -u php-src/tests/classes/tostring.phpt:1.6 
php-src/tests/classes/tostring.phpt:1.7
--- php-src/tests/classes/tostring.phpt:1.6 Wed Aug 17 07:36:32 2005
+++ php-src/tests/classes/tostring.phpt Tue Sep 27 03:59:18 2005
@@ -34,9 +34,11 @@
 
 echo "test5\n";
 echo 1 . $o;
+echo 1 . $o;
 
 echo "test6\n";
 echo $o.$o;
+echo $o,$o;
 
 echo "test7\n";
 $ar = array();
@@ -56,8 +58,8 @@
 test1 Object
 (
 )
-string(1%d) "Object id #%d"
-object(test1)#%d (%d) {
+string(12) "Object id #%d"
+object(test1)#%d (0) {
 }
 test2
 test2 Object
@@ -71,26 +73,42 @@
 test2::__toString()
 Converted
 test4
-string:Object id #%dtest5
-1Object id #%dtest6
-Object id #%dObject id #2test7
+test2::__toString()
+string:Converted
+test5
+test2::__toString()
+1Converted
+test2::__toString()
+1Converted
+test6
+test2::__toString()
+test2::__toString()
+Converted
+Converted
+test2::__toString()
+Converted
+test2::__toString()
+Converted
+test7
 test2::__toString()
 
 Warning: Illegal offset type in %stostring.php on line %d
 test8
-
-Notice: Object of class test2 to string conversion in %stostring.php on line %d
-string(6) "Object"
-string(1%d) "Object id #%d"
+test2::__toString()
+string(9) "Converted"
+test2::__toString()
+string(9) "Converted"
 test9
-Object id #%dDONE!
+test2::__toString()
+Converted
+DONE!
 --UEXPECTF--
 test1
 test1 Object
 (
 )
-string(1%d) "Object id #%d"
-object(test1)#%d (%d) {
+string(12) "Object id #%d"
+object(test1)#%d (0) {
 }
 test2
 test2 Object
@@ -104,16 +122,32 @@
 test2::__toString()
 Converted
 test4
-string:Object id #%dtest5
-1Object id #%dtest6
-Object id #%dObject id #2test7
+test2::__toString()
+string:Converted
+test5
+test2::__toString()
+1Converted
+test2::__toString()
+1Converted
+test6
+test2::__toString()
+test2::__toString()
+Converted
+Converted
+test2::__toString()
+Converted
+test2::__toString()
+Converted
+test7
 test2::__toString()
 
 Warning: Illegal offset type in %stostring.php on line %d
 test8
-
-Notice: Object of class test2 to string conversion in %stostring.php on line %d
-unicode(6) "Object"
-unicode(1%d) "Object id #%d"
+test2::__toString()
+unicode(9) "Converted"
+test2::__toString()
+unicode(9) "Converted"
 test9
-Object id #%dDONE!
+test2::__toString()
+Converted
+DONE!

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