From df0ba5ff87c684141982ec33c4ba0aa1197e256c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?P=C3=B6r=C3=B6s=20D=C3=A1vid?= Date: Tue, 23 Oct 2018 12:52:17 +0200 Subject: [PATCH 1/2] Replace split with explode #25 --- phpQuery/phpQuery/phpQueryObject.php | 2 +- test-cases/xpath.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/phpQuery/phpQuery/phpQueryObject.php b/phpQuery/phpQuery/phpQueryObject.php index 9693cb9..550c14a 100644 --- a/phpQuery/phpQuery/phpQueryObject.php +++ b/phpQuery/phpQuery/phpQueryObject.php @@ -3091,7 +3091,7 @@ public function whois($oneNode = null) { .($node->getAttribute('id') ? '#'.$node->getAttribute('id'):'') .($node->getAttribute('class') - ? '.'.join('.', split(' ', $node->getAttribute('class'))):'') + ? '.'.join('.', explode(' ', $node->getAttribute('class'))):'') .($node->getAttribute('name') ? '[name="'.$node->getAttribute('name').'"]':'') .($node->getAttribute('value') && strpos($node->getAttribute('value'), '<'.'?php') === false diff --git a/test-cases/xpath.php b/test-cases/xpath.php index aaa05d1..be6a2f1 100644 --- a/test-cases/xpath.php +++ b/test-cases/xpath.php @@ -15,7 +15,7 @@ function whois($nodeList) { .($node->getAttribute('id') ? '#'.$node->getAttribute('id'):'') .($node->getAttribute('class') - ? '.'.join('.', split(' ', $node->getAttribute('class'))):'') + ? '.'.join('.', explode(' ', $node->getAttribute('class'))):'') ); } print "
";

From 931a0dce3c34ef141aff9d2a7863b3398286f03f Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?P=C3=B6r=C3=B6s=20D=C3=A1vid?= 
Date: Tue, 23 Oct 2018 12:53:10 +0200
Subject: [PATCH 2/2] replace

---
 phpQuery/phpQuery/phpQueryObject.php     | 4 ++--
 phpQuery/phpQuery/plugins/WebBrowser.php | 2 +-
 test-cases/xpath.php                     | 2 +-
 3 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/phpQuery/phpQuery/phpQueryObject.php b/phpQuery/phpQuery/phpQueryObject.php
index 550c14a..3f1d26d 100644
--- a/phpQuery/phpQuery/phpQueryObject.php
+++ b/phpQuery/phpQuery/phpQueryObject.php
@@ -3069,7 +3069,7 @@ protected function getNodeXpath($oneNode = null, $namespace = null) {
 					: "{$node->tagName}[{$i}]";
 				$node = $node->parentNode;
 			}
-			$xpath = join('/', array_reverse($xpath));
+			$xpath = implode('/', array_reverse($xpath));
 			$return[] = '/'.$xpath;
 		}
 		return $oneNode
@@ -3091,7 +3091,7 @@ public function whois($oneNode = null) {
 					.($node->getAttribute('id')
 						? '#'.$node->getAttribute('id'):'')
 					.($node->getAttribute('class')
-						? '.'.join('.', explode(' ', $node->getAttribute('class'))):'')
+						? '.'.implode('.', explode(' ', $node->getAttribute('class'))):'')
 					.($node->getAttribute('name')
 						? '[name="'.$node->getAttribute('name').'"]':'')
 					.($node->getAttribute('value') && strpos($node->getAttribute('value'), '<'.'?php') === false
diff --git a/phpQuery/phpQuery/plugins/WebBrowser.php b/phpQuery/phpQuery/plugins/WebBrowser.php
index 6688d3f..4b284af 100644
--- a/phpQuery/phpQuery/plugins/WebBrowser.php
+++ b/phpQuery/phpQuery/plugins/WebBrowser.php
@@ -397,7 +397,7 @@ function resolve_url($base, $url) {
                         $path[] = $end;
                 }
                 // Step 6h
-                $base['path'] = join('/', $path);
+                $base['path'] = implode('/', $path);
 
         }
         // Step 7
diff --git a/test-cases/xpath.php b/test-cases/xpath.php
index be6a2f1..7809219 100644
--- a/test-cases/xpath.php
+++ b/test-cases/xpath.php
@@ -15,7 +15,7 @@ function whois($nodeList) {
 			.($node->getAttribute('id')
 				? '#'.$node->getAttribute('id'):'')
 			.($node->getAttribute('class')
-				? '.'.join('.', explode(' ', $node->getAttribute('class'))):'')
+				? '.'.implode('.', explode(' ', $node->getAttribute('class'))):'')
 		);
 	}
 	print "
";