Skip to content

Commit 728ab38

Browse files
author
tobiasz.cudnik
committed
task 56: contents() and/or wrapInner() seems to don't work
http://code.google.com/p/phpquery/issues/detail?id=56 git-svn-id: http://phpquery.googlecode.com/svn/branches/dev@200 afc5ee8f-4a33-0410-9214-8715c29b7d85
1 parent 25f9120 commit 728ab38

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

phpQuery/phpQuery.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,6 @@ abstract class phpQuery {
122122
* @return false|phpQuery|queryTemplatesFetch|queryTemplatesParse|queryTemplatesPickup
123123
*/
124124
public static function pq($arg1, $context = null) {
125-
// TODO support DOMNodes as $context, find out ownerDocument, search loaded DOMs
126125
if (! $context) {
127126
$domId = self::$lastDomId;
128127
if (! $domId)
@@ -2498,6 +2497,9 @@ public function wrapInnerPHP($wrapper) {
24982497
public function contents() {
24992498
$stack = array();
25002499
foreach( $this->elements as $el ) {
2500+
// FIXME http://code.google.com/p/phpquery/issues/detail?id=56
2501+
if (! isset($el->childNodes))
2502+
continue;
25012503
foreach( $el->childNodes as $node ) {
25022504
$stack[] = $node;
25032505
}

0 commit comments

Comments
 (0)