Page 1 of 1

Printview converts some external URLs to ?print

Posted: Thu Sep 11, 2014 12:36 pm
by cmb
Hello Community,

I received a bug report from Olaf who noticed, that external URLs without a path (e.g. http://example.com instead of http://example.com/) are converted to ?print in the print view. That is caused by my silly mistake to negate a boolean AND expression without heeding De Morgan's laws; the following code in XH_isInternalUrl() in cmsimple/functions.php is nonsense, of course:

Code: Select all

    $ok = !isset(
        $urlParts['scheme'], $urlParts['host'], $urlParts['port'],
        $urlParts['user'], $urlParts['pass']
    ); 
It should rather be:

Code: Select all

    $ok = true;
    foreach (array('scheme', 'host', 'port', 'user', 'pass') as $key) {
        $ok = $ok && !isset($urlParts[$key]);
    } 
Christoph

Re: Printview converts some external URLs to ?print

Posted: Thu Sep 11, 2014 12:41 pm
by cmb
Fixed (r1368).