aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorpingswept <brandon@pingswept.org>2015-04-28 11:09:51 -0400
committerAndreas Schneider <asn@cryptomilk.org>2015-09-24 13:05:23 +0200
commit1dbb111720a6c6fc092c0b5a670d4a48a7305fb0 (patch)
tree35f9448b5f6552efe828fac87cd7d2faec9fc3a2
parent791273ccc6b33bb94a611180601bcf030efff877 (diff)
downloadmlmmj-webarchiver-1dbb111720a6c6fc092c0b5a670d4a48a7305fb0.tar.gz
mlmmj-webarchiver-1dbb111720a6c6fc092c0b5a670d4a48a7305fb0.tar.xz
mlmmj-webarchiver-1dbb111720a6c6fc092c0b5a670d4a48a7305fb0.zip
Filter out images and style directories; fix call-time pass-by-reference problem for PHP5 (I think?)
-rw-r--r--mlmmj-webarchiver/index.php.newlist2
-rw-r--r--mlmmj-webarchiver/search.php.newlist4
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>";
}