link checker faulty?

Discussions and requests related to new CMSimple features, plugins, templates etc. and how to develop.
Please don't ask for support at this forums!
Post Reply
manu
Posts: 1090
Joined: Wed Jun 04, 2008 12:05 pm
Location: St. Gallen - Schweiz
Contact:

link checker faulty?

Post by manu » Sat May 03, 2014 8:24 am

I just notice that the linkchecker refuses the following links as faulty even they are valid:
Internal link: ?page#anchor
Internal link: ./userfiles/downloads/file.pdf?v=2014_1 (this query is useful to force file reload in browser)

Just to remember, I'm short of time to do research.

Regards
manu

cmb
Posts: 14225
Joined: Tue Jun 21, 2011 11:04 am
Location: Bingen, RLP, DE
Contact:

Re: link checker faulty?

Post by cmb » Sat May 03, 2014 10:16 am

manu wrote:Internal link: ?page#anchor
Hm, that should work, if there is such an anchor defined on the page (either as name or id attribute of an arbitrary element).
manu wrote:Internal link: ./userfiles/downloads/file.pdf?v=2014_1 (this query is useful to force file reload in browser)
Indeed, this will currently fail:

Code: Select all

        if (isset($test['path']) && !isset($test['query'])) {
            $filename = $test['path'];
            if (is_file($filename) && is_readable($filename)) {
                return '200';
            }
        } 
We may consider to remove the check, that the link doesn't contain a query string.

However, the link checker is known to be broken. I've already documented the following limitations in tests/unit/LinkCheckerTest.php:

Code: Select all

// the following are (current) limitations
array('https://bugs.php.net', 'unknown'), // no HTTPS protocol support
array('./tests/unit/data/', 'internalfail'), // fails, even there's a index.(php|html)
array('anotherxh/?Welcome', '200'), // erroneously checks the same installation
array('anotherxh/?Welcome2', 'internalfail'), // fails, even if anotherxh/ would exist
array('?Secret', '200') // does not respect unpublished pages   
Christoph M. Becker – Plugins for CMSimple_XH

cmb
Posts: 14225
Joined: Tue Jun 21, 2011 11:04 am
Location: Bingen, RLP, DE
Contact:

Re: link checker faulty?

Post by cmb » Mon Sep 15, 2014 12:45 pm

FWIW: due to http://cmsimple.org/forum/viewtopic.php?f=8&t=474 I just noticed that there is another limitation regarding the link checker: it can't deal with IDNs. I have added a respective test case (r1371).
Christoph M. Becker – Plugins for CMSimple_XH

Post Reply