#36241 [Opn]: explode() crashes
ID: 36241 Updated by: [EMAIL PROTECTED] Reported By: [EMAIL PROTECTED] Status: Open Bug Type: Reproducible crash Operating System: Linux on PowerPC PHP Version: 6CVS-2006-02-10 (CVS) New Comment: I did a fresh check out of php-src from cvs and the problem remains. The latest stable version 5.1.2 works fine. I really don't know what else I could do. [EMAIL PROTECTED]:/home/cvs/php/php-src$ gdb /usr/local/php5-cvs/bin/php GNU gdb 6.4-debian Copyright 2005 Free Software Foundation, Inc. GDB is free software, covered by the GNU General Public License, and you are welcome to change it and/or distribute copies of it under certain conditions. Type show copying to see the conditions. There is absolutely no warranty for GDB. Type show warranty for details. This GDB was configured as powerpc-linux-gnu...Using host libthread_db library /lib/tls/libthread_db.so.1. (gdb) run -r 'explode(,, bal,blo,ble);' Starting program: /home/local/php5-cvs/bin/php -r 'explode(,, bal,blo,ble);'warning: Lowest section in /usr/lib/libicudata.so.34 is .hash at 0094 [Thread debugging using libthread_db enabled] [New Thread 805599168 (LWP 2275)] Program received signal SIGSEGV, Segmentation fault. [Switching to Thread 805599168 (LWP 2275)] php_explode (delim=0xed4025c , delim_len=2147213872, str=0x10 Address 0x10 out of bounds, str_len=248778548, str_type=0 '\0', return_value=0x10600d10, limit=-1) at zend_operators.h:215 215 char ne = needle[needle_len-1]; (gdb) bt #0 php_explode (delim=0xed4025c , delim_len=2147213872, str=0x10 Address 0x10 out of bounds, str_len=248778548, str_type=0 '\0', return_value=0x10600d10, limit=-1) at zend_operators.h:215 #1 0x1023f440 in zif_explode (ht=2, return_value=0x10600d10, return_value_ptr=value optimized out, this_ptr=value optimized out, return_value_used=value optimized out) at /home/cvs/php/php-src/ext/standard/string.c:1138 #2 0x10320944 in zend_do_fcall_common_helper_SPEC (execute_data=0x7ffbe330) at zend_vm_execute.h:209 #3 0x1031fd54 in execute (op_array=0x10600b90) at zend_vm_execute.h:92 #4 0x102da1a4 in zend_u_eval_string (type=value optimized out, string= {s = 0x0, u = 0x0, v = 0x0}, retval_ptr=0x0, string_name=value optimized out) at /home/cvs/php/php-src/Zend/zend_execute_API.c:1214 #5 0x102da43c in zend_u_eval_string_ex (type=92 '\\', str= {s = 0x1023f440 Kÿþô\210\001, u = 0x1023f440, v = 0x1023f440}, retval_ptr=0x10, string_name=0xed40f34 , handle_exceptions=0) at /home/cvs/php/php-src/Zend/zend_execute_API.c:1252 #6 0x102da4ac in zend_eval_string_ex (str=value optimized out, retval_ptr=0x10, string_name=0x1023f440 Kÿþô\210\001, handle_exceptions=0) at /home/cvs/php/php-src/Zend/zend_execute_API.c:1262 #7 0x103eeb4c in main (argc=3, argv=0x7ffbea94) at /home/cvs/php/php-src/sapi/cli/php_cli.c:1122 Previous Comments: [2006-03-03 19:27:19] [EMAIL PROTECTED] I cannot reproduce this on either x86 (BSD) or PPC (OSX). [2006-03-03 18:10:18] [EMAIL PROTECTED] I just did a fresh build of the current cvs on powerpc and i386. The i386 works perfectly [EMAIL PROTECTED]:/software/cvs/php-src$ /usr/local/php5-cvs/bin/php -r 'print_r(explode(,, bal,blaj,alsdj));' Array ( [0] = bal [1] = blaj [2] = alsdj ) [EMAIL PROTECTED]:/software/cvs/php-src$ The powerpc version still crashes. [2006-02-21 01:00:03] php-bugs at lists dot php dot net No feedback was provided for this bug for over a week, so it is being suspended automatically. If you are able to provide the information that was originally requested, please do so and change the status of the bug back to Open. [2006-02-13 19:10:41] [EMAIL PROTECTED] Is Linux on PPC the only platform where you're able to reproduce it? [2006-02-10 09:53:02] [EMAIL PROTECTED] I just updated my cvs working copy and the error has slightly changed but is still there. The following script causes the trouble: ?php $arr = explode(,, bal,blo,ble); ? It's not segm fault anymore but that doesn't make much of a difference. zend_parse_parameters() just returns bogus. Here is a gdb session: [EMAIL PROTECTED]:/tmp$ gdb /usr/local/php5-cvs/bin/php GNU gdb 6.4-debian Copyright 2005 Free Software Foundation, Inc. GDB is free software, covered by the GNU General Public License, and you are welcome to change it and/or distribute copies of it under certain conditions. Type show copying to see the conditions. There is absolutely no warranty for GDB. Type show warranty for details. This GDB was configured as powerpc-linux-gnu...Using host
#36241 [NoF-Opn]: explode() crashes
ID: 36241 Updated by: [EMAIL PROTECTED] Reported By: [EMAIL PROTECTED] -Status: No Feedback +Status: Open Bug Type: Reproducible crash Operating System: Linux on PowerPC PHP Version: 6CVS-2006-02-10 (CVS) New Comment: I just did a fresh build of the current cvs on powerpc and i386. The i386 works perfectly [EMAIL PROTECTED]:/software/cvs/php-src$ /usr/local/php5-cvs/bin/php -r 'print_r(explode(,, bal,blaj,alsdj));' Array ( [0] = bal [1] = blaj [2] = alsdj ) [EMAIL PROTECTED]:/software/cvs/php-src$ The powerpc version still crashes. Previous Comments: [2006-02-21 01:00:03] php-bugs at lists dot php dot net No feedback was provided for this bug for over a week, so it is being suspended automatically. If you are able to provide the information that was originally requested, please do so and change the status of the bug back to Open. [2006-02-13 19:10:41] [EMAIL PROTECTED] Is Linux on PPC the only platform where you're able to reproduce it? [2006-02-10 09:53:02] [EMAIL PROTECTED] I just updated my cvs working copy and the error has slightly changed but is still there. The following script causes the trouble: ?php $arr = explode(,, bal,blo,ble); ? It's not segm fault anymore but that doesn't make much of a difference. zend_parse_parameters() just returns bogus. Here is a gdb session: [EMAIL PROTECTED]:/tmp$ gdb /usr/local/php5-cvs/bin/php GNU gdb 6.4-debian Copyright 2005 Free Software Foundation, Inc. GDB is free software, covered by the GNU General Public License, and you are welcome to change it and/or distribute copies of it under certain conditions. Type show copying to see the conditions. There is absolutely no warranty for GDB. Type show warranty for details. This GDB was configured as powerpc-linux-gnu...Using host libthread_db library /lib/tls/libthread_db.so.1. (gdb) break string.c:1099 Breakpoint 1 at 0x101fada4: file /home/cvs/php/php-src/ext/standard/string.c, line 1099. (gdb) run -f explode.php Starting program: /home/local/php5-cvs/bin/php -f explode.php warning: Lowest section in /usr/lib/libicudata.so.34 is .hash at 0094 [Thread debugging using libthread_db enabled] [New Thread 805588960 (LWP 20645)] [Switching to Thread 805588960 (LWP 20645)] Breakpoint 1, zif_explode (ht=2, return_value=0x1069ca68, return_value_ptr=0x0, this_ptr=0x0, return_value_used=1) at /home/cvs/php/php-src/ext/standard/string.c:1099 1099if ( zend_parse_parameters(argc TSRMLS_CC, TT|l, delim, delim_len, delim_type, (gdb) next 1104if ( delim_len == 0 ) { (gdb) print str $1 = (void *) 0xb7 (gdb) print delim $2 = (void *) 0x1040345c (gdb) print str_len $3 = 16 (gdb) print delim_len $4 = 0 (gdb) print (char *) delim $5 = 0x1040345c /home/cvs/php/php-src/Zend/zend_vm_execute.h If continue the program I get a php error message because the delim string is empty. Uwe [2006-02-01 11:15:33] [EMAIL PROTECTED] Can't reproduce on i386 both in Unicode and regular modes. [2006-02-01 09:23:20] [EMAIL PROTECTED] Description: This simple script causes a segm fault ?php explode(b, kalsljb lasjb basljf); ? php_explode (delim=0xed82208 , delim_len=2147450528, str=0x3c Address 0x3c out of bounds, str_len=249048784, str_type=0 '\0', return_value=0x106ce240, limit=-1) at zend_operators.h:215 215 char ne = needle[needle_len-1]; (gdb) bt #0 php_explode (delim=0xed82208 , delim_len=2147450528, str=0x3c Address 0x3c out of bounds, str_len=249048784, str_type=0 '\0', return_value=0x106ce240, limit=-1) at zend_operators.h:215 #1 0x1022b380 in zif_explode (ht=2, return_value=0x106ce240, return_value_ptr=value optimized out, this_ptr=value optimized out, return_value_used=value optimized out) at /home/cvs/php/php-src/ext/standard/string.c:1137 #2 0x1030b414 in zend_do_fcall_common_helper_SPEC (execute_data=0x7fff7f80) at zend_vm_execute.h:201 #3 0x1030a8e4 in execute (op_array=0x106ce0e8) at zend_vm_execute.h:92 #4 0x102dc0b8 in zend_execute_scripts (type=8, retval=0x1022b380, file_count=3) at /home/cvs/php/php-src/Zend/zend.c:1806 #5 0x1027bf7c in php_execute_script (primary_file=0x7fffa4e4) at /home/cvs/php/php-src/main/main.c:1846 #6 0x103d6348 in main (argc=3, argv=0x7fffaac4) at /home/cvs/php/php-src/sapi/cli/php_cli.c:1090 -- Edit this bug report at http://bugs.php.net/?id=36241edit=1
#36241 [NoF-Opn]: explode causes segm fault
ID: 36241 Updated by: [EMAIL PROTECTED] Reported By: [EMAIL PROTECTED] -Status: No Feedback +Status: Open Bug Type: Reproducible crash Operating System: Linux on PowerPC -PHP Version: 6CVS-2006-02-01 (CVS) +PHP Version: 6CVS-2006-02-10 (CVS) New Comment: I just updated my cvs working copy and the error has slightly changed but is still there. The following script causes the trouble: ?php $arr = explode(,, bal,blo,ble); ? It's not segm fault anymore but that doesn't make much of a difference. zend_parse_parameters() just returns bogus. Here is a gdb session: [EMAIL PROTECTED]:/tmp$ gdb /usr/local/php5-cvs/bin/php GNU gdb 6.4-debian Copyright 2005 Free Software Foundation, Inc. GDB is free software, covered by the GNU General Public License, and you are welcome to change it and/or distribute copies of it under certain conditions. Type show copying to see the conditions. There is absolutely no warranty for GDB. Type show warranty for details. This GDB was configured as powerpc-linux-gnu...Using host libthread_db library /lib/tls/libthread_db.so.1. (gdb) break string.c:1099 Breakpoint 1 at 0x101fada4: file /home/cvs/php/php-src/ext/standard/string.c, line 1099. (gdb) run -f explode.php Starting program: /home/local/php5-cvs/bin/php -f explode.php warning: Lowest section in /usr/lib/libicudata.so.34 is .hash at 0094 [Thread debugging using libthread_db enabled] [New Thread 805588960 (LWP 20645)] [Switching to Thread 805588960 (LWP 20645)] Breakpoint 1, zif_explode (ht=2, return_value=0x1069ca68, return_value_ptr=0x0, this_ptr=0x0, return_value_used=1) at /home/cvs/php/php-src/ext/standard/string.c:1099 1099if ( zend_parse_parameters(argc TSRMLS_CC, TT|l, delim, delim_len, delim_type, (gdb) next 1104if ( delim_len == 0 ) { (gdb) print str $1 = (void *) 0xb7 (gdb) print delim $2 = (void *) 0x1040345c (gdb) print str_len $3 = 16 (gdb) print delim_len $4 = 0 (gdb) print (char *) delim $5 = 0x1040345c /home/cvs/php/php-src/Zend/zend_vm_execute.h If continue the program I get a php error message because the delim string is empty. Uwe Previous Comments: [2006-02-09 01:00:04] php-bugs at lists dot php dot net No feedback was provided for this bug for over a week, so it is being suspended automatically. If you are able to provide the information that was originally requested, please do so and change the status of the bug back to Open. [2006-02-01 11:15:33] [EMAIL PROTECTED] Can't reproduce on i386 both in Unicode and regular modes. [2006-02-01 09:23:20] [EMAIL PROTECTED] Description: This simple script causes a segm fault ?php explode(b, kalsljb lasjb basljf); ? php_explode (delim=0xed82208 , delim_len=2147450528, str=0x3c Address 0x3c out of bounds, str_len=249048784, str_type=0 '\0', return_value=0x106ce240, limit=-1) at zend_operators.h:215 215 char ne = needle[needle_len-1]; (gdb) bt #0 php_explode (delim=0xed82208 , delim_len=2147450528, str=0x3c Address 0x3c out of bounds, str_len=249048784, str_type=0 '\0', return_value=0x106ce240, limit=-1) at zend_operators.h:215 #1 0x1022b380 in zif_explode (ht=2, return_value=0x106ce240, return_value_ptr=value optimized out, this_ptr=value optimized out, return_value_used=value optimized out) at /home/cvs/php/php-src/ext/standard/string.c:1137 #2 0x1030b414 in zend_do_fcall_common_helper_SPEC (execute_data=0x7fff7f80) at zend_vm_execute.h:201 #3 0x1030a8e4 in execute (op_array=0x106ce0e8) at zend_vm_execute.h:92 #4 0x102dc0b8 in zend_execute_scripts (type=8, retval=0x1022b380, file_count=3) at /home/cvs/php/php-src/Zend/zend.c:1806 #5 0x1027bf7c in php_execute_script (primary_file=0x7fffa4e4) at /home/cvs/php/php-src/main/main.c:1846 #6 0x103d6348 in main (argc=3, argv=0x7fffaac4) at /home/cvs/php/php-src/sapi/cli/php_cli.c:1090 -- Edit this bug report at http://bugs.php.net/?id=36241edit=1
#32905 [Asn-Ana]: Bookmark in PDF links to wrong page
ID: 32905 Updated by: [EMAIL PROTECTED] Reported By: sergej dot kurakin at delfi dot lt -Status: Assigned +Status: Analyzed Bug Type: ClibPDF related Operating System: WinXP SP1 / Win2K SP4 PHP Version: 4.3.11 Assigned To: steinm New Comment: This bug seems to be pdf viewer depended. It can be reproduced on: Windows in Adobe Acrobat Reader 5 and 6, Foxit PDF Reader I cannot be reproduced on: Windows in Adobe Acrobat Reader 7 MAC OS X in Adobe Acrobat Reader 6 and 7 Linux Previous Comments: [2005-05-19 08:47:59] sergej dot kurakin at delfi dot lt I'v send a code and pdf, generated on my sistem. [2005-05-18 20:17:05] [EMAIL PROTECTED] I couldn't reproduce this bug on a linux system. Would it be possible for the initial poster to send me the pdf file. [2005-05-18 18:31:53] [EMAIL PROTECTED] Assigned to the maintainer. [2005-05-01 17:25:12] sergej dot kurakin at delfi dot lt Description: Some modified code from manual, create 2 pages in PDF file Reproduce code: --- ?php $cpdf = cpdf_open(0); cpdf_page_init($cpdf, 1, 0, 595, 842, 1.0); $b = cpdf_add_outline($cpdf, 0, 0, 0, 1, Page 1); cpdf_begin_text($cpdf); cpdf_set_font($cpdf, Times-Roman, 30, WinAnsiEncoding); cpdf_set_text_rendering($cpdf, 1); cpdf_text($cpdf, Times Roman outlined, 50, 50); cpdf_end_text($cpdf); cpdf_moveto($cpdf, 50, 50); cpdf_lineto($cpdf, 740, 330); cpdf_stroke($cpdf); cpdf_finalize_page($cpdf, 1); cpdf_page_init($cpdf, 2, 0, 595, 842, 1.0); cpdf_add_outline($cpdf, $b, 0, 0, 2, Page 2); cpdf_begin_text($cpdf); cpdf_set_font($cpdf, Times-Roman, 30, WinAnsiEncoding); cpdf_set_text_rendering($cpdf, 1); cpdf_text($cpdf, Times Roman outlined, 50, 50); cpdf_end_text($cpdf); cpdf_moveto($cpdf, 50, 50); cpdf_lineto($cpdf, 740, 330); cpdf_stroke($cpdf); cpdf_finalize_page($cpdf, 2); cpdf_finalize($cpdf); Header(Content-type: application/pdf); cpdf_output_buffer($cpdf); cpdf_close($cpdf); ? Expected result: 2 Pages + 2 Bookmarks, Bookmark Page 1 refers to first page, Page 2 to second page. Actual result: -- 2 Pages + 2 Bookmarks, Bookmark Page 1 refers to second page, Page 2 to second (or not) page. -- Edit this bug report at http://bugs.php.net/?id=32905edit=1
#32905 [Asn-Ana]: Bookmark in PDF links to wrong page
ID: 32905 Updated by: [EMAIL PROTECTED] Reported By: sergej dot kurakin at delfi dot lt -Status: Assigned +Status: Analyzed Bug Type: ClibPDF related Operating System: WinXP SP1 / Win2K SP4 PHP Version: 4.3.11 Assigned To: steinm New Comment: I couldn't reproduce this bug on a linux system. Would it be possible for the initial poster to send me the pdf file. Previous Comments: [2005-05-18 18:31:53] [EMAIL PROTECTED] Assigned to the maintainer. [2005-05-01 17:25:12] sergej dot kurakin at delfi dot lt Description: Some modified code from manual, create 2 pages in PDF file Reproduce code: --- ?php $cpdf = cpdf_open(0); cpdf_page_init($cpdf, 1, 0, 595, 842, 1.0); $b = cpdf_add_outline($cpdf, 0, 0, 0, 1, Page 1); cpdf_begin_text($cpdf); cpdf_set_font($cpdf, Times-Roman, 30, WinAnsiEncoding); cpdf_set_text_rendering($cpdf, 1); cpdf_text($cpdf, Times Roman outlined, 50, 50); cpdf_end_text($cpdf); cpdf_moveto($cpdf, 50, 50); cpdf_lineto($cpdf, 740, 330); cpdf_stroke($cpdf); cpdf_finalize_page($cpdf, 1); cpdf_page_init($cpdf, 2, 0, 595, 842, 1.0); cpdf_add_outline($cpdf, $b, 0, 0, 2, Page 2); cpdf_begin_text($cpdf); cpdf_set_font($cpdf, Times-Roman, 30, WinAnsiEncoding); cpdf_set_text_rendering($cpdf, 1); cpdf_text($cpdf, Times Roman outlined, 50, 50); cpdf_end_text($cpdf); cpdf_moveto($cpdf, 50, 50); cpdf_lineto($cpdf, 740, 330); cpdf_stroke($cpdf); cpdf_finalize_page($cpdf, 2); cpdf_finalize($cpdf); Header(Content-type: application/pdf); cpdf_output_buffer($cpdf); cpdf_close($cpdf); ? Expected result: 2 Pages + 2 Bookmarks, Bookmark Page 1 refers to first page, Page 2 to second page. Actual result: -- 2 Pages + 2 Bookmarks, Bookmark Page 1 refers to second page, Page 2 to second (or not) page. -- Edit this bug report at http://bugs.php.net/?id=32905edit=1
#25959 [Ver]: dbase_get_record() crashes php on some files
ID: 25959 Updated by: [EMAIL PROTECTED] Reported By: webmaster at pulsarbremen dot de Status: Verified Bug Type: dBase related Operating System: * PHP Version: 4CVS-20031018 New Comment: It looks like your database is in dbase IV format. The first 32 bytes are idenitical to dbase III but the fields specification seems to be different. Actually it doesn't look right for a dbase IV file but I haven't seen to many and could wrong. Do you have more information about the expected table structure? Previous Comments: [2003-10-22 18:35:20] webmaster at pulsarbremen dot de Description: Experiencing the following problem: Using dbase_get_record() or dbase_get_record_with_names() on some files makes php.exe crash. Running php-4.3.3-Win32. You can find the DBF-file at http://www.pulsarbremen.de/DRSMain.DBF These files are generated by a radio automation software (tried to generate a new one: same result), I have no influence on the structure of the files but need to read them. Thanks for any help! Reproduce code: --- $db_path = DRSMain.DBF; $dbh = dbase_open($db_path,0); $rowcount = dbase_numrecords ($dbh); for ($i=1; $i = $rowcount; $i++) { $row = dbase_get_record_with_names($dbh,$i); echo $row[ARTIST]; } Expected result: Script should write contents of the ARTIST-field in every database row. Actual result: -- php.exe crashes (no output), apache shows error 500 (internal server error) -- Edit this bug report at http://bugs.php.net/?id=25959edit=1
Bug #16666 Updated: Ask for re-naming DOM XML extension functions according to W3C DOM
ID: 1 Updated by: [EMAIL PROTECTED] Reported By: [EMAIL PROTECTED] Status: Closed Bug Type: Feature/Change Request Operating System: MS Win2000 (not important) PHP Version: 4.2.0 New Comment: All other functions in php use the '_' notation. I had to decide between php und w3c and decided for php. Previous Comments: [2002-04-17 16:17:32] [EMAIL PROTECTED] justToBeArgumentativeSinceThisIsMyPreferredStyle rather than the fy_i_v_lwwds_t style ;) addSlashes() htmlEntities() quoteMeta() stripSlashes() ucWords() wordWrap() imageCreate() imageFill() rawUrlEncode() And while I know these are all probably encoded as lowercase and the fact they can be uppercased is merely that functions are insensitive, I do believe that it makes the point :) Cheers, Rob. [2002-04-17 16:07:19] [EMAIL PROTECTED] Unlikely to happen. This would break 1000² of scripts. I hope you know what I mean. OTOH, IMHO that's just syntentic sugar. Many people do not like to read in StUYcApS and find this_style_easier_to_read. And, it's the PHP naming convention to use_this_style. I bet you're out of luck. [2002-04-17 14:01:31] [EMAIL PROTECTED] Hello! I like to see DOM XML extension in PHP. I often use it in browser's (client-side) programming using JavaScript, so I am surprised, why the functions of this extension is named as today. It is a confusing for me and think not only form me. According to W3C DOM standards functions looks like getAttribute and not get_attribute etc. I hope, that You know what I mean. Thank You. Steve -- Edit this bug report at http://bugs.php.net/?id=1edit=1
Bug #16647 Updated: DomDocument-get_element_by_id() doesn't work
ID: 16647 Updated by: [EMAIL PROTECTED] Reported By: [EMAIL PROTECTED] -Status: Open +Status: Analyzed Bug Type: DOM XML related Operating System: linux 2.4.4 -PHP Version: 4.0CVS-2002-04-16 +PHP Version: 4.0CVS-2002-04-1 New Comment: get_element_by_id() used xpath_eval as well but searches for //*[@ID = '%s']. If you capitalize the id it should work. Do you have an idea how to search case insensitve? Previous Comments: [2002-04-16 20:04:48] [EMAIL PROTECTED] The following script returns bool(false): ?php $src = _END html headtitle Test /title/head body h1Test/h1 span id=testFoo/span /body /html _END; $doc = domxml_open_mem($src); $n = $doc-get_element_by_id(test); var_dump($n); ? Workaround: Use Xpath expressions to find the node: ?php $src = _END html headtitle Test /title/head body h1Test/h1 span id=testFoo/span /body /html _END; $doc = domxml_open_mem($src); $ctx = $doc-xpath_new_context(); $res = $ctx-xpath_eval(//*[@id='test']); $n = $res-nodeset[0]; var_dump($n); ? -- Edit this bug report at http://bugs.php.net/?id=16647edit=1
Bug #16420 Updated: new_child not working properly
ID: 16420 Updated by: [EMAIL PROTECTED] Reported By: [EMAIL PROTECTED] -Status: Open +Status: Closed Bug Type: DOM XML related Operating System: Windows 2000 Server PHP Version: 4.1.2 New Comment: This bug has been fixed in CVS. The latest cvs version provides better DOM compliance and has a function DomNode-create_text_node() which even accepts a ''. The following works just fine: ?php $doc = domxml_new_doc(1.0); $root = $doc-create_element(HTML); $root = $doc-append_child($root); $head = $doc-create_element(HEAD); $head = $root-append_child($head); $title = $doc-create_element(TITLE); $title = $head-append_child($title); $text = $doc-create_text_node(This is the title); $text = $title-append_child($text); $body = $doc-create_element(BODY); $body = $root-append_child($body); $bodytext1 = $doc-create_text_node(The text of the body); $bodytext2 = $doc-create_text_node(Some more text of the body); $bodytext1 = $body-append_child($bodytext1); $bodytext2 = $body-append_child($bodytext2); echo PRE; echo htmlentities($doc-dump_mem(true)); echo /PRE; Previous Comments: [2002-04-16 20:18:16] [EMAIL PROTECTED] It is the responsibility of the developer to use valid XML when assigning content to a new code. 'elementvalue' is not valid XML. So in my opinion this is not a bug but a developer shooting himself in the foot :) [2002-04-04 04:01:29] [EMAIL PROTECTED] For now I'am using ereg_replace('[][^amp;]','amp;',$value) to correct problem. [2002-04-04 03:50:56] [EMAIL PROTECTED] Description of bug: Placing amperstand '' in 'content' parameter of 'new_child' method produce trim of content at '' position. How to reproduce bug: ? $doc = new_xmldoc(1.0); $root = $doc-add_root('root'); $chld = $root-new_child('element','elementvalue'); $chld-set_attribute('attr','attributevalue'); echo $doc-dumpmem(); ? Output will be: ?xml version=1.0? root element attr=attributeamp;valueelement/element /root Element has only 'element' value instead of 'elementamp;value' -- Edit this bug report at http://bugs.php.net/?id=16420edit=1
Bug #15966 Updated: replace_node incorrect
ID: 15966 Updated by: [EMAIL PROTECTED] Reported By: [EMAIL PROTECTED] -Status: Open +Status: Analyzed Bug Type: DOM XML related Operating System: Linux PHP Version: 4.1.2 New Comment: xmlReplaceNode replaces the node in the first argument, which is the current node, by the new copied node. Sounds reasonable to me. It returns the old node which we don't care about. You should have a reference to the old node anyway. Ok, the old node isn't deleted only unlinked but that is the only way to go since the corresponding PHP variable can't be deleted at this time. Making a copy is actually a point to discuss. But currently it needs to be done because if the same libxml node is returned you will probably end up with two PHP variables pointing to the same libxml node. If one is deleted the other one will lose its libxml node as well. I guess this could be solved with references but I don't know how yet. Previous Comments: [2002-03-08 20:39:22] [EMAIL PROTECTED] When replace_node is used, if the new node being inserted already exists in the xml document, it is to be first removed. Thus, the following lines in the C code are incorrect... if (NULL == (new_repnode = xmlCopyNode(repnode, 1))) { php_error(E_WARNING, %s(): unable to clone node, get_active_function_name(TSRMLS_C)); RETURN_FALSE; } repnode = xmlReplaceNode(nodep, new_repnode); This code is making a copy of the new node, and hence when the libxml2 function xmlReplaceNode is run, it does not remove the node already existing in the document. The call to xmlReplaceNode should be the repnode, not the new_repnode. As a matter of fact, I see no need to even attempt to clone the node, unless it is to check that it is a true node. Thoughts? -- Edit this bug report at http://bugs.php.net/?id=15966edit=1
Bug #16204 Updated: append_child related
ID: 16204 Updated by: [EMAIL PROTECTED] Reported By: [EMAIL PROTECTED] -Status: Open +Status: Closed Bug Type: DOM XML related Operating System: Linux PHP Version: 4.1.2 New Comment: This bug has been fixed in CVS. The current CVS version of php includes a fixed version of append_child() which actually does what its name implies. The current behaviour will be covered by append_sibling. Previous Comments: [2002-03-21 11:12:54] [EMAIL PROTECTED] i use the append_child() , well it does append the xml part into the main xml-object so it should work correkt. But i dont know if its a bug or it but it adds the XML-code one level higer than i wanted it. let me explain better: u have root -| | |-sub1 | and i have a second tree beginning with sub3 -|... so i wanted to add sub3 behind sub1 so i should look like root -| | |-sub1-| | |-sub3 so i used sub1-append_child(sub3); and i didnt get this but the following: root -| | |-sub1 | |-sub3 is this correkt and if it is, how can i solf my problem? (am i using the wrong function perhaps) -- Edit this bug report at http://bugs.php.net/?id=16204edit=1
Bug #15949 Updated: replace_node feature
ID: 15949 Updated by: [EMAIL PROTECTED] Reported By: [EMAIL PROTECTED] -Status: Open +Status: Closed Bug Type: DOM XML related Operating System: Linux PHP Version: 4.1.2 New Comment: This bug has been fixed in CVS. Consider remove_child() instead of remove_node() since remove_child() is part of DOM. Anyway, even remove_node() returns the old node now. Previous Comments: [2002-03-08 02:59:22] [EMAIL PROTECTED] I realize that for replace_node, the W3C recommendation suggests that you should return the node that was removed. However, this presents a problem when you are actually trying to write code with the xml functions. If you create a new node (or import it from another document, or even clone it) and then you do a replace node somewhere, removing the previous node and putting in your new node, there is no way to access the node you just put in. For all intents and purposes, you have lost your place in the document. I don't think the function should change per say, but rather this following distinction. 1. Create a new node and return it to a variable $foo 2. Select a node that will be replaced $bar 3. Replace $bar with $foo using $bar-replace_node($foo) 4. Now, $foo should be a reference to the node in its new location. This argument is based on the recommendation sentence which states if the newChild is already in the tree, it is first removed. Hence, it would be impossible for the reference $foo to exist anywhere else then in its new location. Thoughts? -- Edit this bug report at http://bugs.php.net/?id=15949edit=1