]> git.lyx.org Git - features.git/commitdiff
Cmake URL tests: Better search for error 404, in received html snippet.
authorKornel Benko <kornel@lyx.org>
Sat, 2 Jan 2016 21:18:13 +0000 (22:18 +0100)
committerKornel Benko <kornel@lyx.org>
Sat, 2 Jan 2016 21:18:13 +0000 (22:18 +0100)
development/checkurls/CheckURL.pm

index 2601e954fa466f137a0d456b8454c086491efff9..b7d0e032d3240b21ea4d355ad97b5cf2b08d6110 100755 (executable)
@@ -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;
 }