Version 4.5.0

This commit is contained in:
Neo committed 2025-12-19 05:51:58 -08:00
1 parent 1a0c7fd3c2
commit f79dcf067a
3791 files changed
+248032 -76372

No files matched your search

+5 -5
View File
@@ -2162,7 +2162,7 @@ class phpQueryObject
if (! $param)
break;
// nth-child(n+b) to nth-child(1n+b)
if ($param{0} == 'n')
if ($param[0] == 'n')
$param = '1'.$param;
// :nth-child(index/even/odd/equation)
if ($param == 'even' || $param == 'odd')
@@ -2178,17 +2178,17 @@ class phpQueryObject
},
new CallbackParam(), $param
);
else if (mb_strlen($param) > 1 && $param{1} == 'n')
else if (mb_strlen($param) > 1 && $param[1] == 'n')
// an+b
$mapped = $this->map(
function( $node, $param ) {
$prevs = pq($node)->prevAll()->size();
$index = 1+$prevs;
$b = mb_strlen($param) > 3
? $param{3}
? $param[3]
: 0;
$a = $param{0};
if ($b && $param{2} == "-")
$a = $param[0];
if ($b && $param[2] == "-")
$b = -$b;
if ($a > 0) {
return ($index-$b)%$a == 0