commit 99a2647fd2840a00649a3a10f73baf3c54b35f7c
Author: Kornel Benko <[email protected]>
Date:   Sat Jan 2 22:18:13 2016 +0100

    Cmake URL tests: Better search for error 404, in received html snippet.

diff --git a/development/checkurls/CheckURL.pm 
b/development/checkurls/CheckURL.pm
index 2601e95..b7d0e03 100755
--- a/development/checkurls/CheckURL.pm
+++ b/development/checkurls/CheckURL.pm
@@ -73,9 +73,14 @@ sub check_http_url($$$$)
     print " Read from \"$protocol://$host$getp\" ";
     return 3;
   }
-  if ($buf =~ /\<title\>Error 404\<\/title\>/) {
-    print " Page reports 'Error 404' from \"$protocol://$host$getp\" ";
-    return 3;
+  if ($buf =~ /\<title\>([^\<]*404[^\<]*)\<\/title\>/i) {
+    my $title = $1;
+    $title =~ s/\n/ /g;
+    print "title = \"$title\"\n";
+    if ($title =~ /Error 404|404 Not Found/) {
+      print " Page reports 'Error 404' from \"$protocol://$host$getp\" ";
+      return 3;
+    }
   }
   return 0;
 }

Reply via email to