Skip to content
This repository was archived by the owner on Apr 26, 2020. It is now read-only.

Commit c084e1b

Browse files
committed
Merge pull request #8 from lauripiisang/fixed-0index-getString
Fixed 0index getString null check
2 parents 3a10e8d + 4e27b07 commit c084e1b

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

phpQuery/phpQuery/phpQueryObject.php

+2-2
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 != null && is_int($index))
505+
if (!is_null($index) && 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 != null && is_int($index))
532+
if (!is_null($index) && is_int($index))
533533
$return = $this->eq($index)->text();
534534
else {
535535
$return = array();

0 commit comments

Comments
 (0)