[PHP-CVS] svn: /php/php-src/branches/PHP_5_2/ NEWS Zend/tests/bug49269.phpt Zend/zend_vm_def.h Zend/zend_vm_execute.h
dmitry Mon, 17 Aug 2009 07:40:18 + Revision: http://svn.php.net/viewvc?view=revisionrevision=287396 Log: Fixed bug #49269 (Ternary operator fails on Iterator object when used inside foreach declaration). (Etienne, Dmitry) Bug: http://bugs.php.net/49269 (Assigned) Ternary operator fails on Iterator object when used inside foreach declaration Changed paths: U php/php-src/branches/PHP_5_2/NEWS A php/php-src/branches/PHP_5_2/Zend/tests/bug49269.phpt U php/php-src/branches/PHP_5_2/Zend/zend_vm_def.h U php/php-src/branches/PHP_5_2/Zend/zend_vm_execute.h Modified: php/php-src/branches/PHP_5_2/NEWS === --- php/php-src/branches/PHP_5_2/NEWS 2009-08-17 07:15:43 UTC (rev 287395) +++ php/php-src/branches/PHP_5_2/NEWS 2009-08-17 07:40:18 UTC (rev 287396) @@ -1,6 +1,9 @@ PHPNEWS ||| ?? ??? 2009, PHP 5.2.11 +- Fixed bug #49269 (Ternary operator fails on Iterator object when used inside + foreach declaration). (Etienne, Dmitry) + - Added missing sanity checks around exif processing (Ilia) 13 Aug 2009, PHP 5.2.11RC1 Added: php/php-src/branches/PHP_5_2/Zend/tests/bug49269.phpt === --- php/php-src/branches/PHP_5_2/Zend/tests/bug49269.phpt (rev 0) +++ php/php-src/branches/PHP_5_2/Zend/tests/bug49269.phpt 2009-08-17 07:40:18 UTC (rev 287396) @@ -0,0 +1,26 @@ +--TEST-- +Bug #49269 (Ternary operator fails on Iterator object when used inside foreach declaration). +--FILE-- +?php +class TestObject implements Iterator +{ +public $n = 0; +function valid() +{ +return ($this-n 3); +} +function current() {return $this-n;} +function next() {$this-n++;} +function key() { } +function rewind() {$this-n = 0;} +} + + +$array_object = new TestObject(); + +foreach ((true ? $array_object : $array_object) as $item) echo $item\n; +? +--EXPECT-- +0 +1 +2 Modified: php/php-src/branches/PHP_5_2/Zend/zend_vm_def.h === --- php/php-src/branches/PHP_5_2/Zend/zend_vm_def.h 2009-08-17 07:15:43 UTC (rev 287395) +++ php/php-src/branches/PHP_5_2/Zend/zend_vm_def.h 2009-08-17 07:40:18 UTC (rev 287396) @@ -3196,15 +3196,22 @@ ALLOC_ZVAL(tmp); INIT_PZVAL_COPY(tmp, array_ptr); array_ptr = tmp; + if (Z_TYPE_P(array_ptr) == IS_OBJECT) { + ce = Z_OBJCE_P(array_ptr); + if (ce ce-get_iterator) { + array_ptr-refcount--; + } + } } else if (Z_TYPE_P(array_ptr) == IS_OBJECT) { ce = Z_OBJCE_P(array_ptr); if (!ce || !ce-get_iterator) { array_ptr-refcount++; } } else { - if ((OP1_TYPE == IS_CV || OP1_TYPE == IS_VAR) + if (OP1_TYPE == IS_CONST || + ((OP1_TYPE == IS_CV || OP1_TYPE == IS_VAR) !array_ptr-is_ref - array_ptr-refcount 1) { + array_ptr-refcount 1)) { zval *tmp; ALLOC_ZVAL(tmp); @@ -3217,7 +3224,7 @@ } } - if (OP1_TYPE != IS_TMP_VAR ce ce-get_iterator) { + if (ce ce-get_iterator) { iter = ce-get_iterator(ce, array_ptr, opline-extended_value ZEND_FE_RESET_REFERENCE TSRMLS_CC); if (iter !EG(exception)) { Modified: php/php-src/branches/PHP_5_2/Zend/zend_vm_execute.h === --- php/php-src/branches/PHP_5_2/Zend/zend_vm_execute.h 2009-08-17 07:15:43 UTC (rev 287395) +++ php/php-src/branches/PHP_5_2/Zend/zend_vm_execute.h 2009-08-17 07:40:18 UTC (rev 287396) @@ -2230,15 +2230,22 @@ ALLOC_ZVAL(tmp); INIT_PZVAL_COPY(tmp, array_ptr); array_ptr = tmp; + if (Z_TYPE_P(array_ptr) == IS_OBJECT) { + ce = Z_OBJCE_P(array_ptr); + if (ce ce-get_iterator) { + array_ptr-refcount--; + } + } } else if (Z_TYPE_P(array_ptr) == IS_OBJECT) { ce = Z_OBJCE_P(array_ptr); if (!ce || !ce-get_iterator) { array_ptr-refcount++;
[PHP-CVS] svn: /php/php-src/branches/PHP_5_3/ NEWS Zend/tests/bug49269.phpt Zend/zend_vm_def.h Zend/zend_vm_execute.h
dmitry Mon, 17 Aug 2009 07:40:43 + Revision: http://svn.php.net/viewvc?view=revisionrevision=287397 Log: Fixed bug #49269 (Ternary operator fails on Iterator object when used inside foreach declaration). (Etienne, Dmitry) Bug: http://bugs.php.net/49269 (Assigned) Ternary operator fails on Iterator object when used inside foreach declaration Changed paths: U php/php-src/branches/PHP_5_3/NEWS A php/php-src/branches/PHP_5_3/Zend/tests/bug49269.phpt U php/php-src/branches/PHP_5_3/Zend/zend_vm_def.h U php/php-src/branches/PHP_5_3/Zend/zend_vm_execute.h Modified: php/php-src/branches/PHP_5_3/NEWS === --- php/php-src/branches/PHP_5_3/NEWS 2009-08-17 07:40:18 UTC (rev 287396) +++ php/php-src/branches/PHP_5_3/NEWS 2009-08-17 07:40:43 UTC (rev 287397) @@ -22,6 +22,8 @@ - Fixed memory leak in stream_is_local(). (Felipe, Tony) - Fixed BC break in mime_content_type(), removes the content encoding. (Scott) +- Fixed bug #49269 (Ternary operator fails on Iterator object when used inside + foreach declaration). (Etienne, Dmitry) - Fixed bug #49193 (gdJpegGetVersionString() inside gd_compact identifies wrong type in declaration). (Ilia) - Fixed bug #49183 (dns_get_record does not return NAPTR records). (Pierre) Added: php/php-src/branches/PHP_5_3/Zend/tests/bug49269.phpt === --- php/php-src/branches/PHP_5_3/Zend/tests/bug49269.phpt (rev 0) +++ php/php-src/branches/PHP_5_3/Zend/tests/bug49269.phpt 2009-08-17 07:40:43 UTC (rev 287397) @@ -0,0 +1,26 @@ +--TEST-- +Bug #49269 (Ternary operator fails on Iterator object when used inside foreach declaration). +--FILE-- +?php +class TestObject implements Iterator +{ +public $n = 0; +function valid() +{ +return ($this-n 3); +} +function current() {return $this-n;} +function next() {$this-n++;} +function key() { } +function rewind() {$this-n = 0;} +} + + +$array_object = new TestObject(); + +foreach ((true ? $array_object : $array_object) as $item) echo $item\n; +? +--EXPECT-- +0 +1 +2 Modified: php/php-src/branches/PHP_5_3/Zend/zend_vm_def.h === --- php/php-src/branches/PHP_5_3/Zend/zend_vm_def.h 2009-08-17 07:40:18 UTC (rev 287396) +++ php/php-src/branches/PHP_5_3/Zend/zend_vm_def.h 2009-08-17 07:40:43 UTC (rev 287397) @@ -3573,28 +3573,33 @@ ALLOC_ZVAL(tmp); INIT_PZVAL_COPY(tmp, array_ptr); array_ptr = tmp; + if (Z_TYPE_P(array_ptr) == IS_OBJECT) { +ce = Z_OBJCE_P(array_ptr); +if (ce ce-get_iterator) { + Z_DELREF_P(array_ptr); +} + } } else if (Z_TYPE_P(array_ptr) == IS_OBJECT) { ce = Z_OBJCE_P(array_ptr); if (!ce || !ce-get_iterator) { Z_ADDREF_P(array_ptr); } + } else if (OP1_TYPE == IS_CONST || + ((OP1_TYPE == IS_CV || OP1_TYPE == IS_VAR) + !Z_ISREF_P(array_ptr) + Z_REFCOUNT_P(array_ptr) 1)) { + zval *tmp; + + ALLOC_ZVAL(tmp); + INIT_PZVAL_COPY(tmp, array_ptr); + zval_copy_ctor(tmp); + array_ptr = tmp; } else { - if ((OP1_TYPE == IS_CV || OP1_TYPE == IS_VAR) - !Z_ISREF_P(array_ptr) - Z_REFCOUNT_P(array_ptr) 1) { -zval *tmp; - -ALLOC_ZVAL(tmp); -INIT_PZVAL_COPY(tmp, array_ptr); -zval_copy_ctor(tmp); -array_ptr = tmp; - } else { -Z_ADDREF_P(array_ptr); - } + Z_ADDREF_P(array_ptr); } } - if (OP1_TYPE != IS_TMP_VAR ce ce-get_iterator) { + if (ce ce-get_iterator) { iter = ce-get_iterator(ce, array_ptr, opline-extended_value ZEND_FE_RESET_REFERENCE TSRMLS_CC); if (iter !EG(exception)) { Modified: php/php-src/branches/PHP_5_3/Zend/zend_vm_execute.h === --- php/php-src/branches/PHP_5_3/Zend/zend_vm_execute.h 2009-08-17 07:40:18 UTC (rev 287396) +++ php/php-src/branches/PHP_5_3/Zend/zend_vm_execute.h 2009-08-17 07:40:43 UTC (rev 287397) @@ -2108,28 +2108,33 @@ ALLOC_ZVAL(tmp); INIT_PZVAL_COPY(tmp, array_ptr); array_ptr = tmp; + if (Z_TYPE_P(array_ptr) == IS_OBJECT) { +ce = Z_OBJCE_P(array_ptr); +if (ce ce-get_iterator) { + Z_DELREF_P(array_ptr); +} + } } else if (Z_TYPE_P(array_ptr) == IS_OBJECT) { ce = Z_OBJCE_P(array_ptr); if (!ce || !ce-get_iterator) { Z_ADDREF_P(array_ptr); } + } else if (IS_CONST == IS_CONST || + ((IS_CONST == IS_CV || IS_CONST == IS_VAR) + !Z_ISREF_P(array_ptr) + Z_REFCOUNT_P(array_ptr) 1)) { + zval *tmp; + + ALLOC_ZVAL(tmp); + INIT_PZVAL_COPY(tmp, array_ptr); + zval_copy_ctor(tmp); + array_ptr = tmp; } else { - if ((IS_CONST == IS_CV || IS_CONST == IS_VAR) - !Z_ISREF_P(array_ptr) - Z_REFCOUNT_P(array_ptr) 1) { -zval *tmp; - -ALLOC_ZVAL(tmp); -
[PHP-CVS] svn: /SVNROOT/ pear_avail
cweiske Mon, 17 Aug 2009 09:18:55 + Revision: http://svn.php.net/viewvc?view=revisionrevision=287402 Log: give Franck karma for SEW Changed paths: U SVNROOT/pear_avail Modified: SVNROOT/pear_avail === --- SVNROOT/pear_avail 2009-08-17 09:05:45 UTC (rev 287401) +++ SVNROOT/pear_avail 2009-08-17 09:18:55 UTC (rev 287402) @@ -175,6 +175,7 @@ avail|tacker|pear/packages/File_Bittorrent,pear/packages/File_Bittorrent2 avail|mrook|pear/packages/VersionControl_SVN,pear/packages/Archive_Tar avail|bishop|pear/packages/Net_SMS +avail|progi1984|pear/packages/Spreadsheet_Excel_Writer # But members of the PHP Group get access to everything. # Note: This line MUST be at the end so that it overrides any unavail settings -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] svn: /php/php-src/ branches/PHP_5_2/ext/standard/tests/strings/soundex_basic.phpt branches/PHP_5_2/ext/standard/tests/strings/soundex_error.phpt branches/PHP_5_2/ext/standard/tests/strings/s
wharmby Mon, 17 Aug 2009 10:37:30 + Revision: http://svn.php.net/viewvc?view=revisionrevision=287404 Log: New basic string tests - includes back-porting a few existing tests back to 5.2. All tested on Windows, Linux and Linux 64 Changed paths: A php/php-src/branches/PHP_5_2/ext/standard/tests/strings/soundex_basic.phpt A php/php-src/branches/PHP_5_2/ext/standard/tests/strings/soundex_error.phpt A php/php-src/branches/PHP_5_2/ext/standard/tests/strings/str_rot13_basic.phpt A php/php-src/branches/PHP_5_2/ext/standard/tests/strings/str_rot13_error.phpt A php/php-src/branches/PHP_5_2/ext/standard/tests/strings/strnatcasecmp_basic.phpt A php/php-src/branches/PHP_5_2/ext/standard/tests/strings/strnatcasecmp_error.phpt A php/php-src/branches/PHP_5_2/ext/standard/tests/strings/strnatcasecmp_variation1.phpt A php/php-src/branches/PHP_5_2/ext/standard/tests/strings/strnatcmp_basic.phpt A php/php-src/branches/PHP_5_2/ext/standard/tests/strings/strnatcmp_error.phpt A php/php-src/branches/PHP_5_2/ext/standard/tests/strings/strpbrk_basic.phpt A php/php-src/branches/PHP_5_2/ext/standard/tests/strings/strpbrk_error.phpt A php/php-src/branches/PHP_5_3/ext/standard/tests/strings/soundex_basic.phpt A php/php-src/branches/PHP_5_3/ext/standard/tests/strings/soundex_error.phpt A php/php-src/branches/PHP_5_3/ext/standard/tests/strings/str_rot13_basic.phpt A php/php-src/branches/PHP_5_3/ext/standard/tests/strings/str_rot13_error.phpt A php/php-src/branches/PHP_5_3/ext/standard/tests/strings/strnatcasecmp_error.phpt A php/php-src/branches/PHP_5_3/ext/standard/tests/strings/strnatcmp_basic.phpt A php/php-src/branches/PHP_5_3/ext/standard/tests/strings/strnatcmp_error.phpt A php/php-src/trunk/ext/standard/tests/strings/soundex_basic.phpt A php/php-src/trunk/ext/standard/tests/strings/soundex_error.phpt A php/php-src/trunk/ext/standard/tests/strings/str_rot13_basic.phpt A php/php-src/trunk/ext/standard/tests/strings/str_rot13_error.phpt A php/php-src/trunk/ext/standard/tests/strings/strnatcasecmp_error.phpt A php/php-src/trunk/ext/standard/tests/strings/strnatcmp_basic.phpt A php/php-src/trunk/ext/standard/tests/strings/strnatcmp_error.phpt Added: php/php-src/branches/PHP_5_2/ext/standard/tests/strings/soundex_basic.phpt === --- php/php-src/branches/PHP_5_2/ext/standard/tests/strings/soundex_basic.phpt (rev 0) +++ php/php-src/branches/PHP_5_2/ext/standard/tests/strings/soundex_basic.phpt 2009-08-17 10:37:30 UTC (rev 287404) @@ -0,0 +1,46 @@ +--TEST-- +Test soundex() function : basic functionality +--FILE-- +?php +/* Prototype : string soundex ( string $str ) + * Description: Calculate the soundex key of a string + * Source code: ext/standard/string.c +*/ +echo *** Testing soundex() : basic functionality ***\n; + +var_dump(soundex(Euler)); +var_dump(soundex(Gauss)); +var_dump(soundex(Hilbert)); +var_dump(soundex(Knuth)); +var_dump(soundex(Lloyd)); +var_dump(soundex(Lukasiewicz)); + +var_dump(soundex(Euler) == soundex(Ellery));// E460 +var_dump(soundex(Gauss) == soundex(Ghosh)); // G200 +var_dump(soundex(Hilbert) == soundex(Heilbronn)); // H416 +var_dump(soundex(Knuth) == soundex(Kant)); // K530 +var_dump(soundex(Lloyd) == soundex(Ladd)); // L300 +var_dump(soundex(Lukasiewicz) == soundex(Lissajous)); // L222 + +var_dump(soundex(Lukasiewicz) == soundex(Ghosh)); +var_dump(soundex(Hilbert) == soundex(Ladd)); +? +===DONE=== +--EXPECT-- +*** Testing soundex() : basic functionality *** +string(4) E460 +string(4) G200 +string(4) H416 +string(4) K530 +string(4) L300 +string(4) L222 +bool(true) +bool(true) +bool(true) +bool(true) +bool(true) +bool(true) +bool(false) +bool(false) + +===DONE=== Added: php/php-src/branches/PHP_5_2/ext/standard/tests/strings/soundex_error.phpt === --- php/php-src/branches/PHP_5_2/ext/standard/tests/strings/soundex_error.phpt (rev 0) +++ php/php-src/branches/PHP_5_2/ext/standard/tests/strings/soundex_error.phpt 2009-08-17 10:37:30 UTC (rev 287404) @@ -0,0 +1,34 @@ +--TEST-- +Test soundex() function : error conditions +--FILE-- +?php +/* Prototype : string soundex ( string $str ) + * Description: Calculate the soundex key of a string + * Source code: ext/standard/string.c +*/ + +echo \n*** Testing soundex error conditions ***; + +echo -- Testing soundex() function with Zero arguments --\n; +var_dump( soundex() ); + +echo \n\n-- Testing soundex() function with more than expected no. of arguments --\n; +$str = Euler; +$extra_arg = 10; +var_dump( soundex( $str, $extra_arg) ); + +? +===DONE=== +--EXPECTF-- +*** Testing soundex error conditions ***-- Testing soundex() function with Zero
Re: [PHP-CVS] svn: /php/php-src/ branches/PHP_5_3/NEWS branches/PHP_5_3/ext/exif/exif.c trunk/ext/exif/exif.c
Please commit fixes to all branches in one single commit. --Jani On 08/16/2009 05:32 PM, Ilia Alshanetsky wrote: iliaaSun, 16 Aug 2009 14:32:32 + Revision: http://svn.php.net/viewvc?view=revisionrevision=287372 Log: MFB: Added missing sanity checks around exif processing. Changed paths: U php/php-src/branches/PHP_5_3/NEWS U php/php-src/branches/PHP_5_3/ext/exif/exif.c U php/php-src/trunk/ext/exif/exif.c Modified: php/php-src/branches/PHP_5_3/NEWS === --- php/php-src/branches/PHP_5_3/NEWS 2009-08-16 14:31:27 UTC (rev 287371) +++ php/php-src/branches/PHP_5_3/NEWS 2009-08-16 14:32:32 UTC (rev 287372) @@ -1,6 +1,7 @@ PHP NEWS ||| ?? ??? 2009, PHP 5.3.1 +- Added missing sanity checks around exif processing. (Ilia) - Upgraded bundled sqlite to version 3.6.17. (Scott) - Improved dns_get_record support on windows. Always available when IPv6 is Modified: php/php-src/branches/PHP_5_3/ext/exif/exif.c === --- php/php-src/branches/PHP_5_3/ext/exif/exif.c2009-08-16 14:31:27 UTC (rev 287371) +++ php/php-src/branches/PHP_5_3/ext/exif/exif.c2009-08-16 14:32:32 UTC (rev 287372) @@ -3238,7 +3238,7 @@ { /* Check the APP1 for Exif Identifier Code */ static const uchar ExifHeader[] = {0x45, 0x78, 0x69, 0x66, 0x00, 0x00}; - if (memcmp(CharBuf+2, ExifHeader, 6)) { + if (length= 8 || memcmp(CharBuf+2, ExifHeader, 6)) { exif_error_docref(NULL EXIFERR_CC, ImageInfo, E_WARNING, Incorrect APP1 Exif Identifier Code); return; } @@ -3321,8 +3321,14 @@ } /* Read the length of the section. */ - lh = php_stream_getc(ImageInfo-infile); - ll = php_stream_getc(ImageInfo-infile); + if ((lh = php_stream_getc(ImageInfo-infile)) == EOF) { + EXIF_ERRLOG_CORRUPT(ImageInfo) + return FALSE; + } + if ((ll = php_stream_getc(ImageInfo-infile)) == EOF) { + EXIF_ERRLOG_CORRUPT(ImageInfo) + return FALSE; + } itemlen = (lh 8) | ll; @@ -3522,6 +3528,10 @@ int entry_tag , entry_type; tag_table_type tag_table = exif_get_tag_table(section_index); + if (ImageInfo-ifd_nesting_level MAX_IFD_NESTING_LEVEL) { +return FALSE; +} + if (ImageInfo-FileSize= dir_offset+2) { sn = exif_file_sections_add(ImageInfo, M_PSEUDO, 2, NULL); #ifdef EXIF_DEBUG @@ -3665,6 +3675,7 @@ #ifdef EXIF_DEBUG exif_error_docref(NULL EXIFERR_CC, ImageInfo, E_NOTICE, Next IFD: %s @x%04X, exif_get_sectionname(sub_section_index), entry_offset); #endif + ImageInfo-ifd_nesting_level++; exif_process_IFD_in_TIFF(ImageInfo, entry_offset, sub_section_index TSRMLS_CC); if (section_index!=SECTION_THUMBNAIL entry_tag==TAG_SUB_IFD) { if (ImageInfo-Thumbnail.filetype != IMAGE_FILETYPE_UNKNOWN @@ -3704,6 +3715,7 @@ #ifdef EXIF_DEBUG exif_error_docref(NULL EXIFERR_CC, ImageInfo, E_NOTICE, Read next IFD (THUMBNAIL) at x%04X, next_offset); #endif + ImageInfo-ifd_nesting_level++; exif_process_IFD_in_TIFF(ImageInfo, next_offset, SECTION_THUMBNAIL TSRMLS_CC); #ifdef EXIF_DEBUG exif_error_docref(NULL EXIFERR_CC, ImageInfo, E_NOTICE, %s THUMBNAIL @0x%04X + 0x%04X, ImageInfo-Thumbnail.data ? Ignore : Read, ImageInfo-Thumbnail.offset, ImageInfo-Thumbnail.size); @@ -3776,9 +3788,7 @@ } else { exif_error_docref(NULL EXIFERR_CC, ImageInfo, E_WARNING, Invalid TIFF file); } - } - else - if (!memcmp(file_header, MM\x00\x2a, 4)) { + } else if (!memcmp(file_header, MM\x00\x2a, 4)) { ImageInfo-FileType = IMAGE_FILETYPE_TIFF_MM; ImageInfo-motorola_intel = 1; #ifdef EXIF_DEBUG Modified: php/php-src/trunk/ext/exif/exif.c === --- php/php-src/trunk/ext/exif/exif.c 2009-08-16 14:31:27 UTC (rev 287371) +++ php/php-src/trunk/ext/exif/exif.c 2009-08-16
[PHP-CVS] svn: /php/php-src/ branches/PHP_5_2/ext/standard/tests/general_functions/uniqid_basic.phpt branches/PHP_5_2/ext/standard/tests/general_functions/uniqid_error.phpt branches/PHP_5_3/ext/standa
wharmby Mon, 17 Aug 2009 14:22:02 + Revision: http://svn.php.net/viewvc?view=revisionrevision=287412 Log: New basic tests for uniqid(). Tested on Windows, Linux and Linux 64 bit Changed paths: A php/php-src/branches/PHP_5_2/ext/standard/tests/general_functions/uniqid_basic.phpt A php/php-src/branches/PHP_5_2/ext/standard/tests/general_functions/uniqid_error.phpt A php/php-src/branches/PHP_5_3/ext/standard/tests/general_functions/uniqid_basic.phpt A php/php-src/branches/PHP_5_3/ext/standard/tests/general_functions/uniqid_error.phpt A php/php-src/trunk/ext/standard/tests/general_functions/uniqid_basic.phpt A php/php-src/trunk/ext/standard/tests/general_functions/uniqid_error.phpt Added: php/php-src/branches/PHP_5_2/ext/standard/tests/general_functions/uniqid_basic.phpt === --- php/php-src/branches/PHP_5_2/ext/standard/tests/general_functions/uniqid_basic.phpt (rev 0) +++ php/php-src/branches/PHP_5_2/ext/standard/tests/general_functions/uniqid_basic.phpt 2009-08-17 14:22:02 UTC (rev 287412) @@ -0,0 +1,73 @@ +--TEST-- +Test uniqid() function : basic functionality +--FILE-- +?php +/* Prototype : string uniqid ([ string $prefix= [, bool $more_entropy= false ]] ) + * Description: Gets a prefixed unique identifier based on the current time in microseconds. + * Source code: ext/standard/uniqid.c +*/ +echo *** Testing uniqid() : basic functionality ***\n; + +echo \nuniqid() without a prefix\n; +var_dump(uniqid()); +var_dump(uniqid(null, true)); +var_dump(uniqid(null, false)); +echo \n\n; + +echo uniqid() with a prefix\n; + +// Use a fixed prefix so we can ensure length of o/p id is fixed +$prefix = array ( +9, +9, +10.5e2, +null, +true, +false +); + +for ($i = 0; $i count($prefix); $i++) { + var_dump(uniqid($prefix[$i])); + var_dump(uniqid($prefix[$i], true)); + var_dump(uniqid($prefix[$i], false)); + echo \n; +} + +? +===DONE=== +--EXPECTF-- +*** Testing uniqid() : basic functionality *** + +uniqid() without a prefix +string(13) %s +string(23) %s.%s +string(13) %s + + +uniqid() with a prefix +string(18) 9%s +string(28) 9%s.%s +string(18) 9%s + +string(18) 94%s +string(28) 94%s.%s +string(18) 94%s + +string(17) 1050%s +string(27) 1050%s.%s +string(17) 1050%s + +string(13) %s +string(23) %s.%s +string(13) %s + +string(14) 1%s +string(24) 1%s.%s +string(14) 1%s + +string(13) %s +string(23) %s.%s +string(13) %s + +===DONE=== + \ No newline at end of file Added: php/php-src/branches/PHP_5_2/ext/standard/tests/general_functions/uniqid_error.phpt === --- php/php-src/branches/PHP_5_2/ext/standard/tests/general_functions/uniqid_error.phpt (rev 0) +++ php/php-src/branches/PHP_5_2/ext/standard/tests/general_functions/uniqid_error.phpt 2009-08-17 14:22:02 UTC (rev 287412) @@ -0,0 +1,46 @@ +--TEST-- +Test uniqid() function : error conditions +--FILE-- +?php +/* Prototype : string uniqid ([ string $prefix= [, bool $more_entropy= false ]] ) + * Description: Gets a prefixed unique identifier based on the current time in microseconds. + * Source code: ext/standard/uniqid.c +*/ +echo *** Testing uniqid() : error conditions ***\n; + +echo \n-- Testing uniqid() function with more than expected no. of arguments --\n; +$prefix = null; +$more_entropy = false; +$extra_arg = false; +var_dump(uniqid($prefix, $more_entropy, $extra_arg)); + +echo \n-- Testing uniqid() function with invalid values for \$prefix --\n; +class class1{} +$obj = new class1(); +$res = fopen(__FILE__, r); +$array = array(1,2,3); + +uniqid($array, false); +uniqid($res, false); +uniqid($obj, false); + +fclose($res); + +? +===DONE=== +--EXPECTF-- +*** Testing uniqid() : error conditions *** + +-- Testing uniqid() function with more than expected no. of arguments -- + +Warning: uniqid() expects at most 2 parameters, 3 given in %s on line %d +NULL + +-- Testing uniqid() function with invalid values for $prefix -- + +Warning: uniqid() expects parameter 1 to be string, array given in %s on line %d + +Warning: uniqid() expects parameter 1 to be string, resource given in %s on line %d + +Warning: uniqid() expects parameter 1 to be string, object given in %s on line %d +===DONE=== \ No newline at end of file Added: php/php-src/branches/PHP_5_3/ext/standard/tests/general_functions/uniqid_basic.phpt === --- php/php-src/branches/PHP_5_3/ext/standard/tests/general_functions/uniqid_basic.phpt (rev 0) +++ php/php-src/branches/PHP_5_3/ext/standard/tests/general_functions/uniqid_basic.phpt 2009-08-17 14:22:02 UTC (rev 287412) @@ -0,0 +1,73 @@ +--TEST-- +Test uniqid() function : basic functionality +--FILE-- +?php +/* Prototype : string uniqid ([ string $prefix= [, bool
[PHP-CVS] svn: /php/php-src/ branches/PHP_5_2/ext/date/lib/timezonedb.h branches/PHP_5_3/ext/date/lib/timezonedb.h trunk/ext/date/lib/timezonedb.h
derick Mon, 17 Aug 2009 14:46:58 + Revision: http://svn.php.net/viewvc?view=revisionrevision=287414 Log: - Updated to version 2009.12 (2009l) Changed paths: U php/php-src/branches/PHP_5_2/ext/date/lib/timezonedb.h U php/php-src/branches/PHP_5_3/ext/date/lib/timezonedb.h U php/php-src/trunk/ext/date/lib/timezonedb.h Modified: php/php-src/branches/PHP_5_2/ext/date/lib/timezonedb.h === --- php/php-src/branches/PHP_5_2/ext/date/lib/timezonedb.h 2009-08-17 14:27:25 UTC (rev 287413) +++ php/php-src/branches/PHP_5_2/ext/date/lib/timezonedb.h 2009-08-17 14:46:58 UTC (rev 287414) @@ -722,7 +722,7 @@ 0x3F, 0x73, 0x57, 0x50, 0x40, 0x91, 0x7A, 0xE0, 0x41, 0x5C, 0x73, 0xD0, 0x42, 0x71, 0x5C, 0xE0, 0x43, 0x3C, 0x55, 0xD0, 0x44, 0x51, 0x3E, 0xE0, 0x45, 0x12, 0xFD, 0x50, 0x46, 0x31, 0x20, 0xE0, 0x46, 0xE0, 0x6A, 0x50, 0x48, 0x11, 0x02, 0xE0, 0x48, 0xB7, 0x11, 0xD0, 0x49, 0xF0, 0xE4, 0xE0, -0x4A, 0xBB, 0xDD, 0xD0, 0x4B, 0xDA, 0x01, 0x60, 0x4C, 0xA4, 0xFA, 0x50, 0x4D, 0xB9, 0xE3, 0x60, +0x4A, 0x8D, 0xB9, 0x50, 0x4B, 0xDA, 0x01, 0x60, 0x4C, 0xA4, 0xFA, 0x50, 0x4D, 0xB9, 0xE3, 0x60, 0x4E, 0x84, 0xDC, 0x50, 0x4F, 0x99, 0xC5, 0x60, 0x50, 0x64, 0xBE, 0x50, 0x51, 0x79, 0xA7, 0x60, 0x52, 0x44, 0xA0, 0x50, 0x53, 0x59, 0x89, 0x60, 0x54, 0x24, 0x82, 0x50, 0x55, 0x39, 0x6B, 0x60, 0x56, 0x04, 0x64, 0x50, 0x57, 0x22, 0x87, 0xE0, 0x57, 0xED, 0x80, 0xD0, 0x59, 0x02, 0x69, 0xE0, @@ -11701,7 +11701,7 @@ 0x3F, 0x73, 0x57, 0x50, 0x40, 0x91, 0x7A, 0xE0, 0x41, 0x5C, 0x73, 0xD0, 0x42, 0x71, 0x5C, 0xE0, 0x43, 0x3C, 0x55, 0xD0, 0x44, 0x51, 0x3E, 0xE0, 0x45, 0x12, 0xFD, 0x50, 0x46, 0x31, 0x20, 0xE0, 0x46, 0xE0, 0x6A, 0x50, 0x48, 0x11, 0x02, 0xE0, 0x48, 0xB7, 0x11, 0xD0, 0x49, 0xF0, 0xE4, 0xE0, -0x4A, 0xBB, 0xDD, 0xD0, 0x4B, 0xDA, 0x01, 0x60, 0x4C, 0xA4, 0xFA, 0x50, 0x4D, 0xB9, 0xE3, 0x60, +0x4A, 0x8D, 0xB9, 0x50, 0x4B, 0xDA, 0x01, 0x60, 0x4C, 0xA4, 0xFA, 0x50, 0x4D, 0xB9, 0xE3, 0x60, 0x4E, 0x84, 0xDC, 0x50, 0x4F, 0x99, 0xC5, 0x60, 0x50, 0x64, 0xBE, 0x50, 0x51, 0x79, 0xA7, 0x60, 0x52, 0x44, 0xA0, 0x50, 0x53, 0x59, 0x89, 0x60, 0x54, 0x24, 0x82, 0x50, 0x55, 0x39, 0x6B, 0x60, 0x56, 0x04, 0x64, 0x50, 0x57, 0x22, 0x87, 0xE0, 0x57, 0xED, 0x80, 0xD0, 0x59, 0x02, 0x69, 0xE0, @@ -18094,4 +18094,4 @@ 0x00, 0x00, 0x55, 0x54, 0x43, 0x00, 0x00, 0x00, 0x00, 0x89, 0x54, 0x40, 0x01, 0x12, 0xA8, 0x80, 0x00, 0x00, 0x00, 0x00, }; -const timelib_tzdb timezonedb_builtin = { 2009.11, 560, timezonedb_idx_builtin, timelib_timezone_db_data_builtin }; +const timelib_tzdb timezonedb_builtin = { 2009.12, 560, timezonedb_idx_builtin, timelib_timezone_db_data_builtin }; Modified: php/php-src/branches/PHP_5_3/ext/date/lib/timezonedb.h === --- php/php-src/branches/PHP_5_3/ext/date/lib/timezonedb.h 2009-08-17 14:27:25 UTC (rev 287413) +++ php/php-src/branches/PHP_5_3/ext/date/lib/timezonedb.h 2009-08-17 14:46:58 UTC (rev 287414) @@ -722,7 +722,7 @@ 0x3F, 0x73, 0x57, 0x50, 0x40, 0x91, 0x7A, 0xE0, 0x41, 0x5C, 0x73, 0xD0, 0x42, 0x71, 0x5C, 0xE0, 0x43, 0x3C, 0x55, 0xD0, 0x44, 0x51, 0x3E, 0xE0, 0x45, 0x12, 0xFD, 0x50, 0x46, 0x31, 0x20, 0xE0, 0x46, 0xE0, 0x6A, 0x50, 0x48, 0x11, 0x02, 0xE0, 0x48, 0xB7, 0x11, 0xD0, 0x49, 0xF0, 0xE4, 0xE0, -0x4A, 0xBB, 0xDD, 0xD0, 0x4B, 0xDA, 0x01, 0x60, 0x4C, 0xA4, 0xFA, 0x50, 0x4D, 0xB9, 0xE3, 0x60, +0x4A, 0x8D, 0xB9, 0x50, 0x4B, 0xDA, 0x01, 0x60, 0x4C, 0xA4, 0xFA, 0x50, 0x4D, 0xB9, 0xE3, 0x60, 0x4E, 0x84, 0xDC, 0x50, 0x4F, 0x99, 0xC5, 0x60, 0x50, 0x64, 0xBE, 0x50, 0x51, 0x79, 0xA7, 0x60, 0x52, 0x44, 0xA0, 0x50, 0x53, 0x59, 0x89, 0x60, 0x54, 0x24, 0x82, 0x50, 0x55, 0x39, 0x6B, 0x60, 0x56, 0x04, 0x64, 0x50, 0x57, 0x22, 0x87, 0xE0, 0x57, 0xED, 0x80, 0xD0, 0x59, 0x02, 0x69, 0xE0, @@ -11701,7 +11701,7 @@ 0x3F, 0x73, 0x57, 0x50, 0x40, 0x91, 0x7A, 0xE0, 0x41, 0x5C, 0x73, 0xD0, 0x42, 0x71, 0x5C, 0xE0, 0x43, 0x3C, 0x55, 0xD0, 0x44, 0x51, 0x3E, 0xE0, 0x45, 0x12, 0xFD, 0x50, 0x46, 0x31, 0x20, 0xE0, 0x46, 0xE0, 0x6A, 0x50, 0x48, 0x11, 0x02, 0xE0, 0x48, 0xB7, 0x11, 0xD0, 0x49, 0xF0, 0xE4, 0xE0, -0x4A, 0xBB, 0xDD, 0xD0, 0x4B, 0xDA, 0x01, 0x60, 0x4C, 0xA4, 0xFA, 0x50, 0x4D, 0xB9, 0xE3, 0x60, +0x4A, 0x8D, 0xB9, 0x50, 0x4B, 0xDA, 0x01, 0x60, 0x4C, 0xA4, 0xFA, 0x50, 0x4D, 0xB9, 0xE3, 0x60, 0x4E, 0x84, 0xDC, 0x50, 0x4F, 0x99, 0xC5, 0x60, 0x50, 0x64, 0xBE, 0x50, 0x51, 0x79, 0xA7, 0x60, 0x52, 0x44, 0xA0, 0x50, 0x53, 0x59, 0x89, 0x60, 0x54, 0x24, 0x82, 0x50, 0x55, 0x39, 0x6B, 0x60, 0x56, 0x04, 0x64, 0x50, 0x57, 0x22, 0x87, 0xE0, 0x57, 0xED, 0x80, 0xD0, 0x59, 0x02, 0x69, 0xE0, @@ -18094,4 +18094,4 @@ 0x00, 0x00, 0x55, 0x54, 0x43, 0x00, 0x00, 0x00, 0x00, 0x89, 0x54, 0x40, 0x01, 0x12, 0xA8, 0x80, 0x00, 0x00, 0x00, 0x00, }; -const timelib_tzdb timezonedb_builtin = { 2009.11, 560, timezonedb_idx_builtin, timelib_timezone_db_data_builtin }; +const timelib_tzdb timezonedb_builtin = { 2009.12, 560,
[PHP-CVS] svn: /php/php-src/branches/PHP_5_3/ NEWS
iliaaMon, 17 Aug 2009 14:50:34 + Revision: http://svn.php.net/viewvc?view=revisionrevision=287417 Log: Fixed typo Changed paths: U php/php-src/branches/PHP_5_3/NEWS Modified: php/php-src/branches/PHP_5_3/NEWS === --- php/php-src/branches/PHP_5_3/NEWS 2009-08-17 14:47:19 UTC (rev 287416) +++ php/php-src/branches/PHP_5_3/NEWS 2009-08-17 14:50:34 UTC (rev 287417) @@ -61,7 +61,7 @@ in a chunk). (andreas dot streichardt at globalpark dot com, Ilia) - Fixed bug #49000 (PHP CLI in Interactive mode (php -a) crashes when including files from function). (Stas) -- Fixed bug #48994 (zlib.output_compression does not ouput HTTP headers when +- Fixed bug #48994 (zlib.output_compression does not output HTTP headers when set to a string value). (Jani) - Fixed bug #48980 (Crash when compiling with pdo_firebird). (Felipe) - Fixed bug #48962 (cURL does not upload files with specified filename). -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] svn: /php/php-src/branches/PHP_5_2/ext/standard/tests/math/ acosh_basic.phpt acosh_basiclong_64bit.phpt acosh_error.phpt acosh_variation.phpt asinh_basic.phpt asinh_basiclong_64bit.phpt asin
wharmby Mon, 17 Aug 2009 15:54:51 + Revision: http://svn.php.net/viewvc?view=revisionrevision=287421 Log: Make test more portable. Changed paths: U php/php-src/branches/PHP_5_2/ext/standard/tests/math/acosh_basic.phpt U php/php-src/branches/PHP_5_2/ext/standard/tests/math/acosh_basiclong_64bit.phpt U php/php-src/branches/PHP_5_2/ext/standard/tests/math/acosh_error.phpt U php/php-src/branches/PHP_5_2/ext/standard/tests/math/acosh_variation.phpt U php/php-src/branches/PHP_5_2/ext/standard/tests/math/asinh_basic.phpt U php/php-src/branches/PHP_5_2/ext/standard/tests/math/asinh_basiclong_64bit.phpt U php/php-src/branches/PHP_5_2/ext/standard/tests/math/asinh_error.phpt U php/php-src/branches/PHP_5_2/ext/standard/tests/math/asinh_variation.phpt U php/php-src/branches/PHP_5_2/ext/standard/tests/math/atanh_basic.phpt U php/php-src/branches/PHP_5_2/ext/standard/tests/math/atanh_basiclong_64bit.phpt U php/php-src/branches/PHP_5_2/ext/standard/tests/math/atanh_error.phpt U php/php-src/branches/PHP_5_2/ext/standard/tests/math/atanh_variation.phpt Modified: php/php-src/branches/PHP_5_2/ext/standard/tests/math/acosh_basic.phpt === --- php/php-src/branches/PHP_5_2/ext/standard/tests/math/acosh_basic.phpt 2009-08-17 15:53:19 UTC (rev 287420) +++ php/php-src/branches/PHP_5_2/ext/standard/tests/math/acosh_basic.phpt 2009-08-17 15:54:51 UTC (rev 287421) @@ -2,9 +2,10 @@ Test return type and value for expected input acosh() --SKIPIF-- ?php -if(substr(PHP_OS, 0, 3) == WIN) - die (skip - function not supported on Windows); -? +if (!function_exists(acosh)) { + die(SKIP acosh - not supported\n); +} +? --INI-- precision = 14 --FILE-- Modified: php/php-src/branches/PHP_5_2/ext/standard/tests/math/acosh_basiclong_64bit.phpt === --- php/php-src/branches/PHP_5_2/ext/standard/tests/math/acosh_basiclong_64bit.phpt 2009-08-17 15:53:19 UTC (rev 287420) +++ php/php-src/branches/PHP_5_2/ext/standard/tests/math/acosh_basiclong_64bit.phpt 2009-08-17 15:54:51 UTC (rev 287421) @@ -2,7 +2,8 @@ Test acosh function : 64bit long tests --SKIPIF-- ?php -if (PHP_INT_SIZE != 8) die(skip this test is for 64bit platform only); +if (PHP_INT_SIZE != 8) die(SKIP this test is for 64bit platform only); +if (!function_exists(acosh)) die(SKIP acosh - not supported\n); ? --FILE-- ?php Modified: php/php-src/branches/PHP_5_2/ext/standard/tests/math/acosh_error.phpt === --- php/php-src/branches/PHP_5_2/ext/standard/tests/math/acosh_error.phpt 2009-08-17 15:53:19 UTC (rev 287420) +++ php/php-src/branches/PHP_5_2/ext/standard/tests/math/acosh_error.phpt 2009-08-17 15:54:51 UTC (rev 287421) @@ -2,9 +2,10 @@ Test wrong number of arguments for acosh() --SKIPIF-- ?php -if(substr(PHP_OS, 0, 3) == WIN ) -die (skip - function not supported on Windows); -? +if (!function_exists(acosh)) { + die(SKIP acosh - not supported\n); +} +? --FILE-- ?php /* Modified: php/php-src/branches/PHP_5_2/ext/standard/tests/math/acosh_variation.phpt === --- php/php-src/branches/PHP_5_2/ext/standard/tests/math/acosh_variation.phpt 2009-08-17 15:53:19 UTC (rev 287420) +++ php/php-src/branches/PHP_5_2/ext/standard/tests/math/acosh_variation.phpt 2009-08-17 15:54:51 UTC (rev 287421) @@ -2,9 +2,10 @@ Test variations in usage of acosh() --SKIPIF-- ?php -if(substr(PHP_OS, 0, 3) == WIN ) -die (skip - function not supported on Windows); -? +if (!function_exists(acosh)) { + die(SKIP acosh - not supported\n); +} +? --INI-- precision = 10 --FILE-- Modified: php/php-src/branches/PHP_5_2/ext/standard/tests/math/asinh_basic.phpt === --- php/php-src/branches/PHP_5_2/ext/standard/tests/math/asinh_basic.phpt 2009-08-17 15:53:19 UTC (rev 287420) +++ php/php-src/branches/PHP_5_2/ext/standard/tests/math/asinh_basic.phpt 2009-08-17 15:54:51 UTC (rev 287421) @@ -2,9 +2,10 @@ Test return type and value for expected input asinh() --SKIPIF-- ?php -if(substr(PHP_OS, 0, 3) == WIN) - die (skip - function not supported on Windows); -? +if (!function_exists(asinh)) { + die(SKIP asinh - not supported\n); +} +? --INI-- precision = 14 --FILE-- Modified: php/php-src/branches/PHP_5_2/ext/standard/tests/math/asinh_basiclong_64bit.phpt === --- php/php-src/branches/PHP_5_2/ext/standard/tests/math/asinh_basiclong_64bit.phpt 2009-08-17 15:53:19 UTC (rev 287420) +++ php/php-src/branches/PHP_5_2/ext/standard/tests/math/asinh_basiclong_64bit.phpt 2009-08-17 15:54:51 UTC (rev 287421)
[PHP-CVS] svn: /php/php-src/ branches/PHP_5_2/main/SAPI.c branches/PHP_5_3/main/SAPI.c trunk/main/SAPI.c
jani Mon, 17 Aug 2009 16:54:39 + Revision: http://svn.php.net/viewvc?view=revisionrevision=287422 Log: - Try disabling zlib.output_compression always for images. (zlib extension might be compiled as shared and not same time as the main PHP binary) Changed paths: U php/php-src/branches/PHP_5_2/main/SAPI.c U php/php-src/branches/PHP_5_3/main/SAPI.c U php/php-src/trunk/main/SAPI.c Modified: php/php-src/branches/PHP_5_2/main/SAPI.c === --- php/php-src/branches/PHP_5_2/main/SAPI.c2009-08-17 15:54:51 UTC (rev 287421) +++ php/php-src/branches/PHP_5_2/main/SAPI.c2009-08-17 16:54:39 UTC (rev 287422) @@ -610,11 +610,12 @@ ptr++; len--; } -#if HAVE_ZLIB - if(!strncmp(ptr, image/, sizeof(image/)-1)) { + + /* Disable possible output compression for images */ + if (!strncmp(ptr, image/, sizeof(image/)-1)) { zend_alter_ini_entry(zlib.output_compression, sizeof(zlib.output_compression), 0, sizeof(0) - 1, PHP_INI_USER, PHP_INI_STAGE_RUNTIME); } -#endif + mimetype = estrdup(ptr); newlen = sapi_apply_default_charset(mimetype, len TSRMLS_CC); if (!SG(sapi_headers).mimetype){ Modified: php/php-src/branches/PHP_5_3/main/SAPI.c === --- php/php-src/branches/PHP_5_3/main/SAPI.c2009-08-17 15:54:51 UTC (rev 287421) +++ php/php-src/branches/PHP_5_3/main/SAPI.c2009-08-17 16:54:39 UTC (rev 287422) @@ -637,11 +637,12 @@ ptr++; len--; } -#if HAVE_ZLIB - if(!strncmp(ptr, image/, sizeof(image/)-1)) { + + /* Disable possible output compression for images */ + if (!strncmp(ptr, image/, sizeof(image/)-1)) { zend_alter_ini_entry(zlib.output_compression, sizeof(zlib.output_compression), 0, sizeof(0) - 1, PHP_INI_USER, PHP_INI_STAGE_RUNTIME); } -#endif + mimetype = estrdup(ptr); newlen = sapi_apply_default_charset(mimetype, len TSRMLS_CC); if (!SG(sapi_headers).mimetype){ Modified: php/php-src/trunk/main/SAPI.c === --- php/php-src/trunk/main/SAPI.c 2009-08-17 15:54:51 UTC (rev 287421) +++ php/php-src/trunk/main/SAPI.c 2009-08-17 16:54:39 UTC (rev 287422) @@ -29,9 +29,6 @@ #include php_ini.h #include ext/standard/php_string.h #include ext/standard/pageinfo.h -#if HAVE_ZLIB -#include ext/zlib/php_zlib.h -#endif #ifdef ZTS #include TSRM.h #endif @@ -657,11 +654,12 @@ ptr++; len--; } -#if HAVE_ZLIB + + /* Disable possible output compression for images */ if (!strncmp(ptr, image/, sizeof(image/)-1)) { zend_alter_ini_entry(zlib.output_compression, sizeof(zlib.output_compression), 0, sizeof(0) - 1, PHP_INI_USER, PHP_INI_STAGE_RUNTIME); } -#endif + mimetype = estrdup(ptr); newlen = sapi_apply_default_charset(mimetype, len TSRMLS_CC); if (!SG(sapi_headers).mimetype){ -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] svn: /php/php-src/branches/ PHP_5_2/ext/zlib/zlib.c PHP_5_2/main/SAPI.c PHP_5_3/ext/zlib/zlib.c PHP_5_3/main/SAPI.c
jani Mon, 17 Aug 2009 17:30:32 + Revision: http://svn.php.net/viewvc?view=revisionrevision=287423 Log: - Fixed bug #49248 by fixing bug #48994 properly Bugs: http://bugs.php.net/49248 (Assigned) undefined reference to `zlib_globals' http://bugs.php.net/48994 (Closed) zlib.output_compression does not ouput HTTP headers when set to a string value Changed paths: U php/php-src/branches/PHP_5_2/ext/zlib/zlib.c U php/php-src/branches/PHP_5_2/main/SAPI.c U php/php-src/branches/PHP_5_3/ext/zlib/zlib.c U php/php-src/branches/PHP_5_3/main/SAPI.c Modified: php/php-src/branches/PHP_5_2/ext/zlib/zlib.c === --- php/php-src/branches/PHP_5_2/ext/zlib/zlib.c2009-08-17 16:54:39 UTC (rev 287422) +++ php/php-src/branches/PHP_5_2/ext/zlib/zlib.c2009-08-17 17:30:32 UTC (rev 287423) @@ -993,6 +993,19 @@ } else { do_start = (mode PHP_OUTPUT_HANDLER_START ? 1 : 0); do_end = (mode PHP_OUTPUT_HANDLER_END ? 1 : 0); + + if (do_start !SG(headers_sent) !SG(request_info).no_headers) { + switch (ZLIBG(compression_coding)) { + case CODING_GZIP: + sapi_add_header_ex(ZEND_STRL(Content-Encoding: gzip), 1, 1 TSRMLS_CC); + break; + case CODING_DEFLATE: + sapi_add_header_ex(ZEND_STRL(Content-Encoding: deflate), 1, 1 TSRMLS_CC); + break; + } + sapi_add_header_ex(ZEND_STRL(Vary: Accept-Encoding), 1, 1 TSRMLS_CC); + } + if (php_deflate_string(output, output_len, handled_output, handled_output_len, do_start, do_end TSRMLS_CC) != SUCCESS) { zend_error(E_ERROR, Compression failed); } Modified: php/php-src/branches/PHP_5_2/main/SAPI.c === --- php/php-src/branches/PHP_5_2/main/SAPI.c2009-08-17 16:54:39 UTC (rev 287422) +++ php/php-src/branches/PHP_5_2/main/SAPI.c2009-08-17 17:30:32 UTC (rev 287423) @@ -32,9 +32,6 @@ #if (HAVE_PCRE || HAVE_BUNDLED_PCRE) !defined(COMPILE_DL_PCRE) #include ext/pcre/php_pcre.h #endif -#if HAVE_ZLIB -#include ext/zlib/php_zlib.h -#endif #ifdef ZTS #include TSRM.h #endif @@ -765,36 +762,6 @@ return SUCCESS; } -#if HAVE_ZLIB - /* Add output compression headers at this late stage in order to make - it possible to switch it off inside the script. */ - - if (ZLIBG(output_compression)) { - zval nm_zlib_get_coding_type; - zval *uf_result = NULL; - - ZVAL_STRINGL(nm_zlib_get_coding_type, zlib_get_coding_type, sizeof(zlib_get_coding_type) - 1, 0); - - if (call_user_function_ex(CG(function_table), NULL, nm_zlib_get_coding_type, uf_result, 0, NULL, 1, NULL TSRMLS_CC) != FAILURE uf_result != NULL Z_TYPE_P(uf_result) == IS_STRING) { - char buf[128]; - int len; - - assert(Z_STRVAL_P(uf_result) != NULL); - - len = slprintf(buf, sizeof(buf), Content-Encoding: %s, Z_STRVAL_P(uf_result)); - if (len = 0 || sapi_add_header(buf, len, 1) == FAILURE) { - return FAILURE; - } - if (sapi_add_header_ex(Vary: Accept-Encoding, sizeof(Vary: Accept-Encoding) - 1, 1, 0 TSRMLS_CC) == FAILURE) { - return FAILURE; - } - } - if (uf_result != NULL) { - zval_ptr_dtor(uf_result); - } - } -#endif - /* Success-oriented. We set headers_sent to 1 here to avoid an infinite loop * in case of an error situation. */ Modified: php/php-src/branches/PHP_5_3/ext/zlib/zlib.c === --- php/php-src/branches/PHP_5_3/ext/zlib/zlib.c2009-08-17 16:54:39 UTC (rev 287422) +++ php/php-src/branches/PHP_5_3/ext/zlib/zlib.c2009-08-17 17:30:32 UTC (rev 287423) @@ -1045,6 +1045,19 @@ } else { do_start = (mode PHP_OUTPUT_HANDLER_START ? 1 : 0); do_end = (mode PHP_OUTPUT_HANDLER_END ? 1 : 0); + + if (do_start !SG(headers_sent) !SG(request_info).no_headers) { + switch (ZLIBG(compression_coding)) { + case CODING_GZIP: + sapi_add_header_ex(ZEND_STRL(Content-Encoding: gzip), 1, 1 TSRMLS_CC); + break; + case
[PHP-CVS] svn: /php/php-src/ branches/PHP_5_2/NEWS branches/PHP_5_3/NEWS branches/PHP_5_3/ext/pdo_mysql/config.m4 trunk/ext/pdo_mysql/config.m4
jani Mon, 17 Aug 2009 17:57:40 + Revision: http://svn.php.net/viewvc?view=revisionrevision=287424 Log: - Fixed bug #49236 (Missing PHP_SUBST(PDO_MYSQL_SHARED_LIBADD)). Bug: http://bugs.php.net/49236 (Open) Missing PHP_SUBST(PDO_MYSQL_SHARED_LIBADD) Changed paths: U php/php-src/branches/PHP_5_2/NEWS U php/php-src/branches/PHP_5_3/NEWS U php/php-src/branches/PHP_5_3/ext/pdo_mysql/config.m4 U php/php-src/trunk/ext/pdo_mysql/config.m4 Modified: php/php-src/branches/PHP_5_2/NEWS === --- php/php-src/branches/PHP_5_2/NEWS 2009-08-17 17:30:32 UTC (rev 287423) +++ php/php-src/branches/PHP_5_2/NEWS 2009-08-17 17:57:40 UTC (rev 287424) @@ -1,11 +1,12 @@ PHPNEWS ||| ?? ??? 2009, PHP 5.2.11 +- Added missing sanity checks around exif processing (Ilia) + - Fixed bug #49269 (Ternary operator fails on Iterator object when used inside foreach declaration). (Etienne, Dmitry) +- Fixed bug #49236 (Missing PHP_SUBST(PDO_MYSQL_SHARED_LIBADD)). (Jani) -- Added missing sanity checks around exif processing (Ilia) - 13 Aug 2009, PHP 5.2.11RC1 - Fixed regression in cURL extension that prevented flush of data to output defined as a file handle. (Ilia) Modified: php/php-src/branches/PHP_5_3/NEWS === --- php/php-src/branches/PHP_5_3/NEWS 2009-08-17 17:30:32 UTC (rev 287423) +++ php/php-src/branches/PHP_5_3/NEWS 2009-08-17 17:57:40 UTC (rev 287424) @@ -24,6 +24,7 @@ - Fixed bug #49269 (Ternary operator fails on Iterator object when used inside foreach declaration). (Etienne, Dmitry) +- Fixed bug #49236 (Missing PHP_SUBST(PDO_MYSQL_SHARED_LIBADD)). (Jani) - Fixed bug #49193 (gdJpegGetVersionString() inside gd_compact identifies wrong type in declaration). (Ilia) - Fixed bug #49183 (dns_get_record does not return NAPTR records). (Pierre) Modified: php/php-src/branches/PHP_5_3/ext/pdo_mysql/config.m4 === --- php/php-src/branches/PHP_5_3/ext/pdo_mysql/config.m42009-08-17 17:30:32 UTC (rev 287423) +++ php/php-src/branches/PHP_5_3/ext/pdo_mysql/config.m42009-08-17 17:57:40 UTC (rev 287424) @@ -171,5 +171,6 @@ ]) PDO_MYSQL_MODULE_TYPE=external + PHP_SUBST(PDO_MYSQL_SHARED_LIBADD) PHP_SUBST_OLD(PDO_MYSQL_MODULE_TYPE) fi Modified: php/php-src/trunk/ext/pdo_mysql/config.m4 === --- php/php-src/trunk/ext/pdo_mysql/config.m4 2009-08-17 17:30:32 UTC (rev 287423) +++ php/php-src/trunk/ext/pdo_mysql/config.m4 2009-08-17 17:57:40 UTC (rev 287424) @@ -172,5 +172,6 @@ ]) PDO_MYSQL_MODULE_TYPE=external + PHP_SUBST(PDO_MYSQL_SHARED_LIBADD) PHP_SUBST_OLD(PDO_MYSQL_MODULE_TYPE) fi -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] svn: /php/php-src/ branches/PHP_5_2/NEWS branches/PHP_5_2/ext/soap/php_schema.c branches/PHP_5_2/ext/soap/php_sdl.c branches/PHP_5_2/ext/soap/php_sdl.h branches/PHP_5_3/NEWS branches/PHP_5_3
dmitry Mon, 17 Aug 2009 18:23:48 + Revision: http://svn.php.net/viewvc?view=revisionrevision=287425 Log: Fixed bug #49144 (import of schema from different host transmits original authentication details) Bug: http://bugs.php.net/49144 (Assigned) import of schema from different host transmits original authentication details Changed paths: U php/php-src/branches/PHP_5_2/NEWS U php/php-src/branches/PHP_5_2/ext/soap/php_schema.c U php/php-src/branches/PHP_5_2/ext/soap/php_sdl.c U php/php-src/branches/PHP_5_2/ext/soap/php_sdl.h U php/php-src/branches/PHP_5_3/NEWS U php/php-src/branches/PHP_5_3/ext/soap/php_schema.c U php/php-src/branches/PHP_5_3/ext/soap/php_sdl.c U php/php-src/branches/PHP_5_3/ext/soap/php_sdl.h U php/php-src/trunk/ext/soap/php_schema.c U php/php-src/trunk/ext/soap/php_sdl.c U php/php-src/trunk/ext/soap/php_sdl.h Modified: php/php-src/branches/PHP_5_2/NEWS === --- php/php-src/branches/PHP_5_2/NEWS 2009-08-17 17:57:40 UTC (rev 287424) +++ php/php-src/branches/PHP_5_2/NEWS 2009-08-17 18:23:48 UTC (rev 287425) @@ -6,6 +6,8 @@ - Fixed bug #49269 (Ternary operator fails on Iterator object when used inside foreach declaration). (Etienne, Dmitry) - Fixed bug #49236 (Missing PHP_SUBST(PDO_MYSQL_SHARED_LIBADD)). (Jani) +- Fixed bug #49144 (import of schema from different host transmits original + authentication details). (Dmitry) 13 Aug 2009, PHP 5.2.11RC1 - Fixed regression in cURL extension that prevented flush of data to output Modified: php/php-src/branches/PHP_5_2/ext/soap/php_schema.c === --- php/php-src/branches/PHP_5_2/ext/soap/php_schema.c 2009-08-17 17:57:40 UTC (rev 287424) +++ php/php-src/branches/PHP_5_2/ext/soap/php_schema.c 2009-08-17 18:23:48 UTC (rev 287425) @@ -102,7 +102,10 @@ xmlNodePtr schema; xmlAttrPtr new_tns; + sdl_set_uri_credentials(ctx, (char*)location TSRMLS_CC); doc = soap_xmlParseFile((char*)location TSRMLS_CC); + sdl_restore_uri_credentials(ctx TSRMLS_CC); + if (doc == NULL) { soap_error1(E_ERROR, Parsing Schema: can't import schema from '%s', location); } Modified: php/php-src/branches/PHP_5_2/ext/soap/php_sdl.c === --- php/php-src/branches/PHP_5_2/ext/soap/php_sdl.c 2009-08-17 17:57:40 UTC (rev 287424) +++ php/php-src/branches/PHP_5_2/ext/soap/php_sdl.c 2009-08-17 18:23:48 UTC (rev 287425) @@ -226,6 +226,64 @@ return 1; } +void sdl_set_uri_credentials(sdlCtx *ctx, char *uri TSRMLS_DC) +{ + char *s; + int l1, l2; + zval *context = NULL; + zval **header = NULL; + + /* check if we load xsd from the same server */ + s = strstr(ctx-sdl-source, ://); + if (!s) return; + s = strchr(s+3, '/'); + l1 = s - ctx-sdl-source; + s = strstr((char*)uri, ://); + if (!s) return; + s = strchr(s+3, '/'); + l2 = s - (char*)uri; + if (l1 != l2 || memcmp(ctx-sdl-source, uri, l1) != 0) { + /* another server. clear authentication credentals */ + context = php_libxml_switch_context(NULL TSRMLS_CC); + php_libxml_switch_context(context TSRMLS_CC); + if (context) { + ctx-context = php_stream_context_from_zval(context, 1); + + if (ctx-context + php_stream_context_get_option(ctx-context, http, header, header) == SUCCESS) { +s = strstr(Z_STRVAL_PP(header), Authorization: Basic); +if (s (s == Z_STRVAL_PP(header) || *(s-1) == '\n' || *(s-1) == '\r')) { + char *rest = strstr(s, \r\n); + if (rest) { + zval new_header; + + rest += 2; + Z_TYPE(new_header) = IS_STRING; + Z_STRLEN(new_header) = Z_STRLEN_PP(header) - (rest - s); + Z_STRVAL(new_header) = emalloc(Z_STRLEN_PP(header) + 1); + memcpy(Z_STRVAL(new_header), Z_STRVAL_PP(header), s - Z_STRVAL_PP(header)); + memcpy(Z_STRVAL(new_header) + (s - Z_STRVAL_PP(header)), rest, Z_STRLEN_PP(header) - (rest - Z_STRVAL_PP(header)) + 1); + ctx-old_header = *header; + ctx-old_header-refcount++; + php_stream_context_set_option(ctx-context, http, header, new_header); + zval_dtor(new_header); + } +} + } + } + } +} + +void sdl_restore_uri_credentials(sdlCtx *ctx TSRMLS_DC) +{ + if (ctx-old_header) { + php_stream_context_set_option(ctx-context, http, header, ctx-old_header); + zval_ptr_dtor(ctx-old_header); + ctx-old_header = NULL; + } + ctx-context = NULL; +} + static void load_wsdl_ex(zval *this_ptr, char *struri, sdlCtx *ctx, int include TSRMLS_DC) { sdlPtr tmpsdl = ctx-sdl; @@ -237,7 +295,9 @@ return; } + sdl_set_uri_credentials(ctx, struri TSRMLS_CC); wsdl = soap_xmlParseFile(struri TSRMLS_CC); + sdl_restore_uri_credentials(ctx TSRMLS_CC); if (!wsdl) { xmlErrorPtr xmlErrorPtr = xmlGetLastError(); Modified: php/php-src/branches/PHP_5_2/ext/soap/php_sdl.h
[PHP-CVS] svn: /php/win-installer/trunk/ PHPInstallerBase52.wxs PHPInstallerBase52NTS.wxs PHPInstallerBase53.wxs PHPInstallerBase53NTS.wxs PHPInstallerBase60.wxs PHPInstallerBase60NTS.wxs
jmertic Mon, 17 Aug 2009 19:39:02 + Revision: http://svn.php.net/viewvc?view=revisionrevision=287426 Log: Correctly quote the error_log attribute value. Changed paths: U php/win-installer/trunk/PHPInstallerBase52.wxs U php/win-installer/trunk/PHPInstallerBase52NTS.wxs U php/win-installer/trunk/PHPInstallerBase53.wxs U php/win-installer/trunk/PHPInstallerBase53NTS.wxs U php/win-installer/trunk/PHPInstallerBase60.wxs U php/win-installer/trunk/PHPInstallerBase60NTS.wxs Modified: php/win-installer/trunk/PHPInstallerBase52.wxs === --- php/win-installer/trunk/PHPInstallerBase52.wxs 2009-08-17 18:23:48 UTC (rev 287425) +++ php/win-installer/trunk/PHPInstallerBase52.wxs 2009-08-17 19:39:02 UTC (rev 287426) @@ -302,7 +302,7 @@ Section=PHP Value=On / IniFile Id=errorlogINI Action=addLine Key=error_log Directory=INSTALLDIR Name=php.ini - Section=PHP Value=[TempFolder]\php-errors.log / + Section=PHP Value=quot;[TempFolder]\php-errors.logquot; / /Component Component Id=php5tsDLL DiskId=1 Modified: php/win-installer/trunk/PHPInstallerBase52NTS.wxs === --- php/win-installer/trunk/PHPInstallerBase52NTS.wxs 2009-08-17 18:23:48 UTC (rev 287425) +++ php/win-installer/trunk/PHPInstallerBase52NTS.wxs 2009-08-17 19:39:02 UTC (rev 287426) @@ -280,7 +280,7 @@ Section=PHP Value=On / IniFile Id=errorlogINI Action=addLine Key=error_log Directory=INSTALLDIR Name=php.ini - Section=PHP Value=[TempFolder]\php-errors.log / + Section=PHP Value=quot;[TempFolder]\php-errors.logquot; / /Component Component Id=php5DLL DiskId=1 Modified: php/win-installer/trunk/PHPInstallerBase53.wxs === --- php/win-installer/trunk/PHPInstallerBase53.wxs 2009-08-17 18:23:48 UTC (rev 287425) +++ php/win-installer/trunk/PHPInstallerBase53.wxs 2009-08-17 19:39:02 UTC (rev 287426) @@ -295,7 +295,7 @@ Section=PHP Value=On / IniFile Id=errorlogINI Action=addLine Key=error_log Directory=INSTALLDIR Name=php.ini - Section=PHP Value=[TempFolder]\php-errors.log / + Section=PHP Value=quot;[TempFolder]\php-errors.logquot; / /Component Component Id=php5tsDLL DiskId=1 Modified: php/win-installer/trunk/PHPInstallerBase53NTS.wxs === --- php/win-installer/trunk/PHPInstallerBase53NTS.wxs 2009-08-17 18:23:48 UTC (rev 287425) +++ php/win-installer/trunk/PHPInstallerBase53NTS.wxs 2009-08-17 19:39:02 UTC (rev 287426) @@ -273,7 +273,7 @@ Section=PHP Value=On / IniFile Id=errorlogINI Action=addLine Key=error_log Directory=INSTALLDIR Name=php.ini - Section=PHP Value=[TempFolder]\php-errors.log / + Section=PHP Value=quot;[TempFolder]\php-errors.logquot; / /Component Component Id=php5DLL DiskId=1 Modified: php/win-installer/trunk/PHPInstallerBase60.wxs === --- php/win-installer/trunk/PHPInstallerBase60.wxs 2009-08-17 18:23:48 UTC (rev 287425) +++ php/win-installer/trunk/PHPInstallerBase60.wxs 2009-08-17 19:39:02 UTC (rev 287426) @@ -295,7 +295,7 @@ Section=PHP Value=On / IniFile Id=errorlogINI Action=addLine Key=error_log Directory=INSTALLDIR Name=php.ini - Section=PHP Value=[TempFolder]\php-errors.log / + Section=PHP Value=quot;[TempFolder]\php-errors.logquot; / /Component Component Id=php6tsDLL DiskId=1 Modified: php/win-installer/trunk/PHPInstallerBase60NTS.wxs === --- php/win-installer/trunk/PHPInstallerBase60NTS.wxs 2009-08-17 18:23:48 UTC (rev 287425) +++ php/win-installer/trunk/PHPInstallerBase60NTS.wxs 2009-08-17 19:39:02 UTC (rev 287426) @@ -273,7 +273,7 @@ Section=PHP Value=On / IniFile Id=errorlogINI Action=addLine Key=error_log Directory=INSTALLDIR Name=php.ini - Section=PHP Value=[TempFolder]\php-errors.log / + Section=PHP Value=quot;[TempFolder]\php-errors.logquot; / /Component Component Id=php6DLL DiskId=1 -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] svn: /php/php-src/branches/ PHP_5_2/NEWS PHP_5_3/NEWS
jani Mon, 17 Aug 2009 20:14:25 + Revision: http://svn.php.net/viewvc?view=revisionrevision=287427 Log: - Fix news Changed paths: U php/php-src/branches/PHP_5_2/NEWS U php/php-src/branches/PHP_5_3/NEWS Modified: php/php-src/branches/PHP_5_2/NEWS === --- php/php-src/branches/PHP_5_2/NEWS 2009-08-17 19:39:02 UTC (rev 287426) +++ php/php-src/branches/PHP_5_2/NEWS 2009-08-17 20:14:25 UTC (rev 287427) @@ -6,9 +6,10 @@ - Fixed bug #49269 (Ternary operator fails on Iterator object when used inside foreach declaration). (Etienne, Dmitry) - Fixed bug #49236 (Missing PHP_SUBST(PDO_MYSQL_SHARED_LIBADD)). (Jani) -- Fixed bug #49144 (import of schema from different host transmits original +- Fixed bug #49144 (Import of schema from different host transmits original authentication details). (Dmitry) + 13 Aug 2009, PHP 5.2.11RC1 - Fixed regression in cURL extension that prevented flush of data to output defined as a file handle. (Ilia) Modified: php/php-src/branches/PHP_5_3/NEWS === --- php/php-src/branches/PHP_5_3/NEWS 2009-08-17 19:39:02 UTC (rev 287426) +++ php/php-src/branches/PHP_5_3/NEWS 2009-08-17 20:14:25 UTC (rev 287427) @@ -1,9 +1,12 @@ PHPNEWS ||| ?? ??? 2009, PHP 5.3.1 -- Added missing sanity checks around exif processing. (Ilia) - Upgraded bundled sqlite to version 3.6.17. (Scott) +- Added missing sanity checks around exif processing. (Ilia) +- Added error constant when json_encode() detects an invalid UTF-8 sequence. + (Scott) + - Improved dns_get_record support on windows. Always available when IPv6 is support is installed, format is now the same than on unix. (Pierre) - Improved the DNS functions on OSX to use newer APIs, also use Bind 9 API @@ -11,9 +14,6 @@ - Improved shared extension loading on OSX to use the standard Unix dlopen() API. (Scott) -- Added error constant when json_encode() detects an invalid UTF-8 sequence. - (Scott) - - Fixed spl_autoload_unregister/spl_autoload_functions wrt. Closures and Functors. (Christian Seiler) - Fixed open_basedir circumvention for mail.log. (Maksymilian Arciemowicz, @@ -28,7 +28,7 @@ - Fixed bug #49193 (gdJpegGetVersionString() inside gd_compact identifies wrong type in declaration). (Ilia) - Fixed bug #49183 (dns_get_record does not return NAPTR records). (Pierre) -- Fixed bug #49144 (import of schema from different host transmits original +- Fixed bug #49144 (Import of schema from different host transmits original authentication details). (Dmitry) - Fixed bug #49132 (posix_times returns false without error). (phpbugs at gunnu dot us) -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] svn: /php/php-src/ branches/PHP_5_3/ext/hash/hash.c trunk/ext/hash/hash.c
garretts Mon, 17 Aug 2009 21:28:22 + Revision: http://svn.php.net/viewvc?view=revisionrevision=287429 Log: - Fix for bug #49223 Inconsistency using get_defined_constants(true) Bug: http://bugs.php.net/49223 (Open) Inconsistency using get_defined_constants(true) Changed paths: U php/php-src/branches/PHP_5_3/ext/hash/hash.c U php/php-src/trunk/ext/hash/hash.c Modified: php/php-src/branches/PHP_5_3/ext/hash/hash.c === --- php/php-src/branches/PHP_5_3/ext/hash/hash.c2009-08-17 20:38:54 UTC (rev 287428) +++ php/php-src/branches/PHP_5_3/ext/hash/hash.c2009-08-17 21:28:22 UTC (rev 287429) @@ -643,8 +643,7 @@ len = slprintf(buf, 127, MHASH_%s, algorithm.mhash_name, strlen(algorithm.mhash_name)); zend_register_long_constant(buf, len + 1, algorithm.value, CONST_CS | CONST_PERSISTENT, module_number TSRMLS_CC); } - - zend_register_module_ex(mhash_module_entry TSRMLS_CC); + zend_register_internal_module(mhash_module_entry TSRMLS_CC); } /* {{{ proto string mhash(int hash, string data [, string key]) Modified: php/php-src/trunk/ext/hash/hash.c === --- php/php-src/trunk/ext/hash/hash.c 2009-08-17 20:38:54 UTC (rev 287428) +++ php/php-src/trunk/ext/hash/hash.c 2009-08-17 21:28:22 UTC (rev 287429) @@ -812,8 +812,7 @@ len = slprintf(buf, 127, MHASH_%s, algorithm.mhash_name, strlen(algorithm.mhash_name)); zend_register_long_constant(buf, len + 1, algorithm.value, CONST_CS | CONST_PERSISTENT, module_number TSRMLS_CC); } - - zend_register_module_ex(mhash_module_entry TSRMLS_CC); + zend_register_internal_module(mhash_module_entry TSRMLS_CC); } /* {{{ proto binary mhash(int hash, binary data [, binary key]) U -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-CVS] svn: /php/php-src/ branches/PHP_5_3/ext/hash/hash.c trunk/ext/hash/hash.c
hi Garrett, Don't forget the NEWS entry in 5.3 :) Cheers, On Mon, Aug 17, 2009 at 11:28 PM, Garrett Serackgarre...@php.net wrote: garretts Mon, 17 Aug 2009 21:28:22 + Revision: http://svn.php.net/viewvc?view=revisionrevision=287429 Log: - Fix for bug #49223 Inconsistency using get_defined_constants(true) Bug: http://bugs.php.net/49223 (Open) Inconsistency using get_defined_constants(true) Changed paths: U php/php-src/branches/PHP_5_3/ext/hash/hash.c U php/php-src/trunk/ext/hash/hash.c Modified: php/php-src/branches/PHP_5_3/ext/hash/hash.c === --- php/php-src/branches/PHP_5_3/ext/hash/hash.c 2009-08-17 20:38:54 UTC (rev 287428) +++ php/php-src/branches/PHP_5_3/ext/hash/hash.c 2009-08-17 21:28:22 UTC (rev 287429) @@ -643,8 +643,7 @@ len = slprintf(buf, 127, MHASH_%s, algorithm.mhash_name, strlen(algorithm.mhash_name)); zend_register_long_constant(buf, len + 1, algorithm.value, CONST_CS | CONST_PERSISTENT, module_number TSRMLS_CC); } - - zend_register_module_ex(mhash_module_entry TSRMLS_CC); + zend_register_internal_module(mhash_module_entry TSRMLS_CC); } /* {{{ proto string mhash(int hash, string data [, string key]) Modified: php/php-src/trunk/ext/hash/hash.c === --- php/php-src/trunk/ext/hash/hash.c 2009-08-17 20:38:54 UTC (rev 287428) +++ php/php-src/trunk/ext/hash/hash.c 2009-08-17 21:28:22 UTC (rev 287429) @@ -812,8 +812,7 @@ len = slprintf(buf, 127, MHASH_%s, algorithm.mhash_name, strlen(algorithm.mhash_name)); zend_register_long_constant(buf, len + 1, algorithm.value, CONST_CS | CONST_PERSISTENT, module_number TSRMLS_CC); } - - zend_register_module_ex(mhash_module_entry TSRMLS_CC); + zend_register_internal_module(mhash_module_entry TSRMLS_CC); } /* {{{ proto binary mhash(int hash, binary data [, binary key]) U -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- Pierre http://blog.thepimp.net | http://www.libgd.org -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] svn: /php/php-src/ branches/PHP_5_3/ext/snmp/snmp.c trunk/ext/snmp/snmp.c
stas Mon, 17 Aug 2009 22:15:18 + Revision: http://svn.php.net/viewvc?view=revisionrevision=287430 Log: fix parameter parsing for SNMP Changed paths: U php/php-src/branches/PHP_5_3/ext/snmp/snmp.c U php/php-src/trunk/ext/snmp/snmp.c Modified: php/php-src/branches/PHP_5_3/ext/snmp/snmp.c === --- php/php-src/branches/PHP_5_3/ext/snmp/snmp.c 2009-08-17 21:28:22 UTC (rev 287429) +++ php/php-src/branches/PHP_5_3/ext/snmp/snmp.c 2009-08-17 22:15:18 UTC (rev 287430) @@ -775,22 +775,21 @@ */ static void php_snmp(INTERNAL_FUNCTION_PARAMETERS, int st, int version) { - char *a1, **a2, **a3; + char *a1, *a2, *a3; int a1_len, a2_len, a3_len; - zval **a4 = NULL, **a5 = NULL; - long a6 = 0, a7 = 0; struct snmp_session session; long timeout = SNMP_DEFAULT_TIMEOUT; long retries = SNMP_DEFAULT_RETRIES; char type = (char) 0; - char *value = (char *) 0; + char *value = (char *) 0, *stype = ; + int value_len, stype_len; char hostname[MAX_NAME_LEN]; int remote_port = 161; char *pptr; int argc = ZEND_NUM_ARGS(); if (st == SNMP_CMD_SET) { - if (zend_parse_parameters(argc TSRMLS_CC, sssZZ|ll, a1, a1_len, a2, a2_len, a3, a3_len, a4, a5, a6, a7) == FAILURE) { + if (zend_parse_parameters(argc TSRMLS_CC, s|ll, a1, a1_len, a2, a2_len, a3, a3_len, stype, stype_len, value, value_len, timeout, retries) == FAILURE) { return; } } else { @@ -799,37 +798,15 @@ * SNMP_CMD_WALK * SNMP_CMD_REALWALK */ - if (zend_parse_parameters(argc TSRMLS_CC, sss|ZZ, a1, a1_len, a2, a2_len, a3, a3_len, a4, a5) == FAILURE) { + if (zend_parse_parameters(argc TSRMLS_CC, sss|ll, a1, a1_len, a2, a2_len, a3, a3_len, timeout, retries) == FAILURE) { return; } } if (st == SNMP_CMD_SET) { - convert_to_string_ex(a4); - convert_to_string_ex(a5); + type = stype[0]; + } - if (argc 5) { - timeout = a6; - } - - if (argc 6) { - retries = a7; - } - - type = Z_STRVAL_PP(a4)[0]; - value = Z_STRVAL_PP(a5); - } else { - if (argc 3) { - convert_to_long_ex(a4); - timeout = Z_LVAL_PP(a4); - } - - if (argc 4) { - convert_to_long_ex(a5); - retries = Z_LVAL_PP(a5); - } - } - snmp_sess_init(session); strlcpy(hostname, a1, sizeof(hostname)); if ((pptr = strchr (hostname, ':'))) { @@ -1201,23 +1178,22 @@ */ static void php_snmpv3(INTERNAL_FUNCTION_PARAMETERS, int st) { - zval **a9 = NULL, **a10 = NULL; char *a1, *a2, *a3, *a4, *a5, *a6, *a7, *a8; int a1_len, a2_len, a3_len, a4_len, a5_len, a6_len, a7_len, a8_len; - long a11 = 0, a12 = 0; struct snmp_session session; long timeout = SNMP_DEFAULT_TIMEOUT; long retries = SNMP_DEFAULT_RETRIES; char type = (char) 0; - char *value = (char *) 0; + char *value = (char *) 0, *stype = ; + int stype_len, value_len; char hostname[MAX_NAME_LEN]; int remote_port = 161; char *pptr; int argc = ZEND_NUM_ARGS(); if (st == SNMP_CMD_SET) { - if (zend_parse_parameters(argc TSRMLS_CC, ZZ|ll, a1, a1_len, a2, a2_len, a3, a3_len, - a4, a4_len, a5, a5_len, a6, a6_len, a7, a7_len, a8, a8_len, a9, a10, a11, a12) == FAILURE) { + if (zend_parse_parameters(argc TSRMLS_CC, ss|ll, a1, a1_len, a2, a2_len, a3, a3_len, + a4, a4_len, a5, a5_len, a6, a6_len, a7, a7_len, a8, a8_len, stype, stype_len, value, value_len, timeout, retries) == FAILURE) { return; } } else { @@ -1226,8 +1202,8 @@ * SNMP_CMD_WALK * SNMP_CMD_REALWALK */ - if (zend_parse_parameters(argc TSRMLS_CC, |ZZ, a1, a1_len, a2, a2_len, a3, a3_len, - a4, a4_len, a5, a5_len, a6, a6_len, a7, a7_len, a8, a8_len, a9, a10) == FAILURE) { + if (zend_parse_parameters(argc TSRMLS_CC, |ll, a1, a1_len, a2, a2_len, a3, a3_len, + a4, a4_len, a5, a5_len, a6, a6_len, a7, a7_len, a8, a8_len, timeout, retries) == FAILURE) { return; } } @@ -1281,25 +1257,7 @@ } if (st == SNMP_CMD_SET) { - if (argc 10) { - timeout = a11; - } - if (argc 11) { - retries = a12; - } - convert_to_string_ex(a9); - convert_to_string_ex(a10); - type = Z_STRVAL_PP(a9)[0]; - value = Z_STRVAL_PP(a10); - } else { - if (argc 8) { - convert_to_long_ex(a9); - timeout = Z_LVAL_PP(a9); - } - if (argc 9) { - convert_to_long_ex(a10); - retries = Z_LVAL_PP(a10); - } + type = stype[0]; } session.retries = retries; Modified: php/php-src/trunk/ext/snmp/snmp.c === --- php/php-src/trunk/ext/snmp/snmp.c 2009-08-17 21:28:22 UTC (rev 287429) +++ php/php-src/trunk/ext/snmp/snmp.c 2009-08-17 22:15:18 UTC (rev 287430) @@ -775,22 +775,21 @@ */ static void php_snmp(INTERNAL_FUNCTION_PARAMETERS, int st, int version) { - char *a1, **a2, **a3; + char *a1, *a2, *a3; int a1_len, a2_len, a3_len; - zval **a4 = NULL, **a5 = NULL; - long a6 = 0, a7 = 0; struct snmp_session session; long timeout = SNMP_DEFAULT_TIMEOUT; long retries = SNMP_DEFAULT_RETRIES; char type
[PHP-CVS] svn: /php/php-src/ branches/PHP_5_3/ext/xmlrpc/tests/001.phpt branches/PHP_5_3/ext/xmlrpc/tests/002.phpt branches/PHP_5_3/ext/xmlrpc/tests/bug42189.phpt branches/PHP_5_3/ext/xmlrpc/xmlrpc-ep
stas Tue, 18 Aug 2009 00:41:43 + Revision: http://svn.php.net/viewvc?view=revisionrevision=287434 Log: cleanup parameter parsing Changed paths: U php/php-src/branches/PHP_5_3/ext/xmlrpc/tests/001.phpt U php/php-src/branches/PHP_5_3/ext/xmlrpc/tests/002.phpt U php/php-src/branches/PHP_5_3/ext/xmlrpc/tests/bug42189.phpt U php/php-src/branches/PHP_5_3/ext/xmlrpc/xmlrpc-epi-php.c U php/php-src/trunk/ext/xmlrpc/tests/001.phpt U php/php-src/trunk/ext/xmlrpc/tests/002.phpt U php/php-src/trunk/ext/xmlrpc/tests/bug42189.phpt U php/php-src/trunk/ext/xmlrpc/xmlrpc-epi-php.c Modified: php/php-src/branches/PHP_5_3/ext/xmlrpc/tests/001.phpt === --- php/php-src/branches/PHP_5_3/ext/xmlrpc/tests/001.phpt 2009-08-17 23:51:49 UTC (rev 287433) +++ php/php-src/branches/PHP_5_3/ext/xmlrpc/tests/001.phpt 2009-08-18 00:41:43 UTC (rev 287434) @@ -38,19 +38,8 @@ /methodCall -Notice: Array to string conversion in %s on line %d -string(177) ?xml version=1.0 encoding=iso-8859-1? -methodCall -methodNameArray/methodName -params - param - value - int1/int - /value - /param -/params -/methodCall - +Warning: xmlrpc_encode_request() expects parameter 1 to be string, array given in %s on line %d +NULL string(175) ?xml version=1.0 encoding=iso-8859-1? methodCall methodName3.4/methodName Modified: php/php-src/branches/PHP_5_3/ext/xmlrpc/tests/002.phpt === --- php/php-src/branches/PHP_5_3/ext/xmlrpc/tests/002.phpt 2009-08-17 23:51:49 UTC (rev 287433) +++ php/php-src/branches/PHP_5_3/ext/xmlrpc/tests/002.phpt 2009-08-18 00:41:43 UTC (rev 287434) @@ -47,10 +47,7 @@ } string(2) -1 -Notice: Array to string conversion in %s on line %d -array(1) { - [0]= - int(1) -} -string(5) Array +Warning: xmlrpc_encode_request() expects parameter 1 to be string, array given in %s on line %d +NULL +string(2) -1 Done Modified: php/php-src/branches/PHP_5_3/ext/xmlrpc/tests/bug42189.phpt === --- php/php-src/branches/PHP_5_3/ext/xmlrpc/tests/bug42189.phpt 2009-08-17 23:51:49 UTC (rev 287433) +++ php/php-src/branches/PHP_5_3/ext/xmlrpc/tests/bug42189.phpt 2009-08-18 00:41:43 UTC (rev 287434) @@ -11,5 +11,5 @@ echo Done\n; ? --EXPECT-- -bool(true) +bool(false) Done Modified: php/php-src/branches/PHP_5_3/ext/xmlrpc/xmlrpc-epi-php.c === --- php/php-src/branches/PHP_5_3/ext/xmlrpc/xmlrpc-epi-php.c 2009-08-17 23:51:49 UTC (rev 287433) +++ php/php-src/branches/PHP_5_3/ext/xmlrpc/xmlrpc-epi-php.c 2009-08-18 00:41:43 UTC (rev 287434) @@ -682,10 +682,12 @@ { XMLRPC_REQUEST xRequest = NULL; char *outBuf; - zval **method, **vals, *out_opts = NULL; + zval *vals, *out_opts = NULL; + char *method = NULL; + int method_len; php_output_options out; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, ZZ|a, method, vals, out_opts) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, s!z|a, method, method_len, vals, out_opts) == FAILURE) { return; } @@ -696,15 +698,14 @@ if (xRequest) { XMLRPC_RequestSetOutputOptions(xRequest, out.xmlrpc_out); - if (Z_TYPE_PP(method) == IS_NULL) { + if (method == NULL) { XMLRPC_RequestSetRequestType(xRequest, xmlrpc_request_response); } else { -convert_to_string_ex(method); -XMLRPC_RequestSetMethodName(xRequest, Z_STRVAL_PP(method)); +XMLRPC_RequestSetMethodName(xRequest, method); XMLRPC_RequestSetRequestType(xRequest, xmlrpc_request_call); } - if (Z_TYPE_PP(vals) != IS_NULL) { -XMLRPC_RequestSetData(xRequest, PHP_to_XMLRPC(*vals TSRMLS_CC)); + if (Z_TYPE_P(vals) != IS_NULL) { +XMLRPC_RequestSetData(xRequest, PHP_to_XMLRPC(vals TSRMLS_CC)); } outBuf = XMLRPC_REQUEST_ToXML(xRequest, 0); @@ -794,7 +795,6 @@ return; } - convert_to_string_ex(method); if (return_value_used) { zval* retval = decode_request_worker(xml, xml_len, encoding_len ? encoding : NULL, *method); @@ -1055,20 +1055,20 @@ XMLRPC_REQUEST xRequest; STRUCT_XMLRPC_REQUEST_INPUT_OPTIONS input_opts; xmlrpc_server_data* server; - zval **caller_params, *handle, **output_opts = NULL; + zval **caller_params, *handle, *output_opts = NULL; char *rawxml; int rawxml_len, type; php_output_options out; int argc =ZEND_NUM_ARGS(); - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, rsZ|Z, handle, rawxml, rawxml_len, caller_params, output_opts) != SUCCESS) { + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, rsZ|a, handle, rawxml, rawxml_len, caller_params, output_opts) != SUCCESS) { return; } /* user output options */ if (argc == 3) { set_output_options(out, NULL); } else { - set_output_options(out, *output_opts); + set_output_options(out, output_opts); } server =