forum.coppermine-gallery.net

Support => cpg1.5.x Support => cpg1.5 miscellaneous => Topic started by: flapane on June 15, 2012, 05:42:27 pm

Title: w3c validation for "<"
Post by: flapane on June 15, 2012, 05:42:27 pm
While waiting to solve the resizing thing using Imagemagik, I noticed that there are a few errors which involve the sql char "<".

Quote
Line 717, Column 65 (http://validator.w3.org/check?uri=http%3A%2F%2Fwww.flapane.com%2Fgallery%2F&charset=%28detect+automatically%29&doctype=Inline&ss=1&group=0&user-agent=W3C_Validator%2F1.3#line-717): character "<" is the first character of a delimiter but occurred as data

[2] => DELETE FROM `flapanec_db`.cpg132_sessions WHERE time < 1339770630 AND remember = 0 [bridge/coppermine.inc.php:247] (0 ms)

This message may appear in several cases:

    You tried to include the "<" character in your page: you should escape it as "&lt;"
    You used an unescaped ampersand "&": this may be valid in some contexts, but it is recommended to use "&amp;", which is always safe.
    Another possibility is that you forgot to close quotes in a previous tag.
Title: Re: w3c validation for "<"
Post by: Αndré on July 02, 2012, 02:21:12 pm
That's just the debug output which is usually disabled for the public. However, to create valid HTML code for even that cases, open include/functions.inc.php, find
Code: [Select]
    echo "USER: ";
    echo $debug_underline;
    print_r($USER);
    echo $debug_separate;
    echo "USER DATA:";
    echo $debug_underline;
    print_r($USER_DATA);
    echo $debug_separate;
    echo "Queries:";
    echo $debug_underline;
    print_r($queries);
    echo $debug_separate;
    echo "GET :";
    echo $debug_underline;
    print_r($superCage->get->_source);
    echo $debug_separate;
    echo "POST :";
    echo $debug_underline;
    print_r($superCage->post->_source);
    echo $debug_separate;
    echo "COOKIE :";
    echo $debug_underline;
    print_r($superCage->cookie->_source);
    echo $debug_separate;

    if ($superCage->cookie->keyExists('PHPSESSID')) {
        echo "SESSION :";
        echo $debug_underline;
        if(!isset($_SESSION)){
            session_id($superCage->cookie->getAlnum('PHPSESSID'));
            session_start();
        }
        print_r($_SESSION);
        echo $debug_separate;
    }
and replace with
Code: [Select]
    echo "USER: ";
    echo $debug_underline;
    echo htmlentities(print_r($USER, true));
    echo $debug_separate;
    echo "USER DATA:";
    echo $debug_underline;
    echo htmlentities(print_r($USER_DATA, true));
    echo $debug_separate;
    echo "Queries:";
    echo $debug_underline;
    echo htmlentities(print_r($queries, true));
    echo $debug_separate;
    echo "GET :";
    echo $debug_underline;
    echo htmlentities(print_r($superCage->get->_source, true));
    echo $debug_separate;
    echo "POST :";
    echo $debug_underline;
    echo htmlentities(print_r($superCage->post->_source, true));
    echo $debug_separate;
    echo "COOKIE :";
    echo $debug_underline;
    echo htmlentities(print_r($superCage->cookie->_source, true));
    echo $debug_separate;

    if ($superCage->cookie->keyExists('PHPSESSID')) {
        echo "SESSION :";
        echo $debug_underline;
        if(!isset($_SESSION)){
            session_id($superCage->cookie->getAlnum('PHPSESSID'));
            session_start();
        }
        echo htmlentities(print_r($_SESSION, true));
        echo $debug_separate;
    }

Please report the results. I haven't checked for any side-effects yet.
Title: Re: w3c validation for "<"
Post by: flapane on July 02, 2012, 06:24:45 pm
Fixed, thanks. The error disappeared and the debug panel keeps working.
I guess it might be included in the next release.
Title: Re: w3c validation for "<"
Post by: Αndré on July 04, 2012, 10:54:03 am
Committed change in SVN revision 8457.