Skip to content

Commit 41d97a4

Browse files
committed
Merge pull request electrolinux#1 from lauripiisang/dev-fixed-getstring
Fixed getString(0) and getStrings(0) null check
2 parents 8bd206a + 6c13c01 commit 41d97a4

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

phpQuery/phpQuery/phpQueryObject.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -502,7 +502,7 @@ public function get($index = null, $callback1 = null, $callback2 = null, $callba
502502
* @todo maybe other name...
503503
*/
504504
public function getString($index = null, $callback1 = null, $callback2 = null, $callback3 = null) {
505-
if ($index)
505+
if ($index != null && is_int($index))
506506
$return = $this->eq($index)->text();
507507
else {
508508
$return = array();
@@ -529,7 +529,7 @@ public function getString($index = null, $callback1 = null, $callback2 = null, $
529529
* @todo maybe other name...
530530
*/
531531
public function getStrings($index = null, $callback1 = null, $callback2 = null, $callback3 = null) {
532-
if ($index)
532+
if ($index != null && is_int($index))
533533
$return = $this->eq($index)->text();
534534
else {
535535
$return = array();

0 commit comments

Comments
 (0)