changeset 28:b058736bc9ad

fix old :-( preg bug
author Robert Boland <robert@markup.co.uk>
date Fri, 04 Jan 2019 08:48:00 -0500
parents 1bb0bc3d306a
children f024f2f08994
files php/read/getBookDetails.php us/index.php
diffstat 2 files changed, 3 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/php/read/getBookDetails.php	Fri Jan 04 08:45:42 2019 -0500
+++ b/php/read/getBookDetails.php	Fri Jan 04 08:48:00 2019 -0500
@@ -230,7 +230,7 @@
 		}
 		//echo $out;
 		$mm=array();
-		if (preg_match("<Error>",$out,$mm)) {
+		if (preg_match("/<Error>/",$out,$mm)) {
 		  $xml = new SimpleXMLElement($out);	
 		  $resName=$xml->getName();
 		  $code=$xml->Error->Code;
--- a/us/index.php	Fri Jan 04 08:45:42 2019 -0500
+++ b/us/index.php	Fri Jan 04 08:48:00 2019 -0500
@@ -143,7 +143,7 @@
 					$bookDetails = getAmazonDet($isbn,1,'us'); 
 					$bookXML = new SimpleXMLElement($bookDetails);
 					// HST added this
-					if (preg_match("<Error>",$bookDetails)) {
+					if (preg_match("/<Error>/",$bookDetails)) {
 					  $resName=$bookXML->getName();
 					  $code=$bookXML->Error->Code;
 					  file_put_contents('/var/ywww/debug/phpDebug',"Losing 3: $resName, ".
@@ -218,7 +218,7 @@
 				      $bookLDetails = getAmazonDet($linkedISBN,1,'us'); 
 				      $bookLXML = new SimpleXMLElement($bookLDetails);
 				      // HST added this
-				      if (preg_match("<Error>",$bookLDetails)) {
+				      if (preg_match("/<Error>/",$bookLDetails)) {
 					$resName=$bookLXML->getName();
 					$code=$bookLXML->Error->Code;
 					file_put_contents('/var/ywww/debug/phpDebug',"Losing 2: $resName, ".