File 1dbb111720a6c6fc092c0b5a670d4a48a7305fb0.patch of Package mlmmj-webarchiver

From 1dbb111720a6c6fc092c0b5a670d4a48a7305fb0 Mon Sep 17 00:00:00 2001
From: pingswept <brandon@pingswept.org>
Date: Tue, 28 Apr 2015 11:09:51 -0400
Subject: [PATCH] Filter out images and style directories; fix call-time
 pass-by-reference problem for PHP5 (I think?)

---
 mlmmj-webarchiver/index.php.newlist  | 2 +-
 mlmmj-webarchiver/search.php.newlist | 4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/mlmmj-webarchiver/index.php.newlist b/mlmmj-webarchiver/index.php.newlist
index e760230..425d4b2 100644
--- a/mlmmj-webarchiver/index.php.newlist
+++ b/mlmmj-webarchiver/index.php.newlist
@@ -3,7 +3,7 @@ $path = getcwd();
 $mlist = substr(strrchr($path, "/"), 1);
 $handle = @opendir($path) or die("Unable to open $path");
 while($file = readdir($handle)) {
-  if(is_dir($path . "/" . $file) && $file != "." && $file != "..") {
+  if(is_dir($path . "/" . $file) && $file != "." && $file != ".." && $file != "images" && $file != "style") {
     $files[] = $file;
   }
 }
diff --git a/mlmmj-webarchiver/search.php.newlist b/mlmmj-webarchiver/search.php.newlist
index 1606580..c4ecbed 100644
--- a/mlmmj-webarchiver/search.php.newlist
+++ b/mlmmj-webarchiver/search.php.newlist
@@ -31,13 +31,13 @@
 		$html=array();
 		$count=0;
 		$maxresults=##MAX_RESULTS##;
-		exec("find -type f -name '0*.html' | xargs egrep -roi '$words' | perl -pe 's/:.*//' | sort | uniq",&$output);
+		exec("find -type f -name '0*.html' | xargs egrep -roi '$words' | perl -pe 's/:.*//' | sort | uniq",$output);
 		while(isset($output[$count]) && $count<$maxresults)
 		{
 			$file=$output[$count++];
 			$content=file_get_contents($file);
 			$matches=array();
-			if (preg_match('/<em>Subject<\/em>: ([^<]*)<\/li>[\S\s]+From<\/em>: ([^<]*)<\/li>[\S\s]+Date<\/em>: ([^<]*)<\/li>/',$content,&$matches))
+			if (preg_match('/<em>Subject<\/em>: ([^<]*)<\/li>[\S\s]+From<\/em>: ([^<]*)<\/li>[\S\s]+Date<\/em>: ([^<]*)<\/li>/',$content,$matches))
 			{
 				$html[]="<li><a href='$file'>$matches[1]</a>, $matches[2], $matches[3]</li>";
 			}
-- 
GitLab

openSUSE Build Service is sponsored by