Linkchecker in 1.6.5

A place to report and discuss bugs - please mention CMSimple-version, server, platform and browser version
cmb
Posts: 14225
Joined: Tue Jun 21, 2011 11:04 am
Location: Bingen, RLP, DE
Contact:

Re: Linkchecker in 1.6.5

Post by cmb » Sat Jan 24, 2015 2:44 pm

manu wrote:I try to better distinguish the cases wether the link target is a file or not.
A link to a directory does not necessarily need a trailing slash, e.g. http://3-magi.net/demo/presentation. What about the following:

Code: Select all

Index: LinkChecker.php
===================================================================
--- LinkChecker.php   (Revision 1464)
+++ LinkChecker.php   (Arbeitskopie)
@@ -199,10 +199,12 @@
     {
         global $c, $u, $cl, $pth, $cf;
 
-        if (isset($test['path']) && !isset($test['query'])) {
+        if (isset($test['path'])) {
             $filename = $test['path'];
             if (is_file($filename) && is_readable($filename)) {
                 return '200';
+            } elseif (!is_dir($filename)) {
+                return 'file not found';
             }
         }
         if (!isset($test['query'])) {
I haven't tested either variant, though. Especially, it's still not clear what to do with ./index.php?Some_page links; these would be detected as valid, even if Some_page doesn't exist.
Christoph M. Becker – Plugins for CMSimple_XH

manu
Posts: 1090
Joined: Wed Jun 04, 2008 12:05 pm
Location: St. Gallen - Schweiz
Contact:

Re: Linkchecker in 1.6.5

Post by manu » Sat Jan 24, 2015 3:57 pm

you are right. this is more accurate. Some tests behave a little bit different now..

Post Reply