ferrarilongato / phpquery

Automatically exported from code.google.com/p/phpquery
0 stars 0 forks source link

text() will not set text to an empty string or "0" #84

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. $div = pq('<div>old text</div>')->text('0');
2. echo $div;

What is the expected output? What do you see instead?
Expected "<div>0</div>", got "old text". The old text value is returned
instead of updating the text.

What version of the product are you using? On what operating system?
phpQuery version 0.9.5.304, Windows XP

Please provide any additional information below.
html('') and html('0') both work as expected.
Changing line 2221 in phpQueryObject.php from
    if ($text)
to
    if (isset($text))
works as expected.

Original issue reported on code.google.com by mcdesig...@gmail.com on 2 Dec 2008 at 6:41

GoogleCodeExporter commented 8 years ago
Fixed in r315. Thx for the fix.

Original comment by tobiasz....@gmail.com on 2 Dec 2008 at 9:44