The following warnings occurred:
Warning [2] Undefined array key "allowautourl" - Line: 584 - File: inc/class_parser.php PHP 8.1.31 (Linux)
File Line Function
/inc/class_error.php 153 errorHandler->error
/inc/class_parser.php 584 errorHandler->error_callback
/inc/class_parser.php 228 postParser->parse_mycode
/printthread.php 203 postParser->parse_message
Warning [2] Undefined array key "allowautourl" - Line: 584 - File: inc/class_parser.php PHP 8.1.31 (Linux)
File Line Function
/inc/class_error.php 153 errorHandler->error
/inc/class_parser.php 584 errorHandler->error_callback
/inc/class_parser.php 228 postParser->parse_mycode
/printthread.php 203 postParser->parse_message
Warning [2] Undefined array key "allowautourl" - Line: 584 - File: inc/class_parser.php PHP 8.1.31 (Linux)
File Line Function
/inc/class_error.php 153 errorHandler->error
/inc/class_parser.php 584 errorHandler->error_callback
/inc/class_parser.php 228 postParser->parse_mycode
/printthread.php 203 postParser->parse_message
Warning [2] Undefined array key "allowautourl" - Line: 584 - File: inc/class_parser.php PHP 8.1.31 (Linux)
File Line Function
/inc/class_error.php 153 errorHandler->error
/inc/class_parser.php 584 errorHandler->error_callback
/inc/class_parser.php 228 postParser->parse_mycode
/printthread.php 203 postParser->parse_message



GetSimple Support Forum
404 management - Printable Version

+- GetSimple Support Forum (http://get-simple.info/forums)
+-- Forum: GetSimple (http://get-simple.info/forums/forumdisplay.php?fid=3)
+--- Forum: General Questions and Problems (http://get-simple.info/forums/forumdisplay.php?fid=16)
+--- Thread: 404 management (/showthread.php?tid=691)



404 management - spilarix - 2010-05-07

404 errors seems to not be catch.
When I look the code, I don't understand how it is supposed to work.
You can see my comments in the code below.
Code:
if (! file_exists($file)) {
    if (file_exists($file_404))    {
        $file = $file_404;
        exec_action('error-404');
    }
}

/*******************************
Why is there no "else" here ? it sould avoid notices on $data_index properties if the file doesn't exists
********************************/

$data_index = getXML($file);
[...]
$url = $data_index->url;
[...]

/*******************************
I think there are some problems between 403 and 404 and a test on $url is useless because in the case of 404, the url will be empty
********************************/
# if page is private, send to 404 error page
if ($private == 'Y') {
    header('Location: 403');
    exit;
}

# if page does not exist, throw 404 error
if ($url == '403') {
    header('HTTP/1.0 404 Not Found');
}



404 management - Zegnåt - 2010-05-08

Well, let me see whether I can help you with this Smile

Code:
if (! file_exists($file)) {
    if (file_exists($file_404))    {
        $file = $file_404;
        exec_action('error-404');
    }
}
spilarix Wrote:Why is there no “else” here? It [w]ould avoid notices on $data_index properties if the file doesn’t exists.
You’re completely right. The answer to your question would be something along the lines of: this is how the first version of GetSimple was written. As it started out as a little system for Chris to use he could be pretty confident of the existence of the 404 file.

Code:
# if page is private, send to 404 error page
if ($private == 'Y') {
    header('Location: 403');
    exit;
}
spilarix Wrote:I think there are some problems between 403 and 404
I believe Chris once mentioned having had a long night when he wrote that part of the code. I don’t know whether it’s really of any importance to modify the variable names.

Code:
# if page does not exist, throw 404 error
if ($url == '403') {
    header('HTTP/1.0 404 Not Found');
}
spilarix Wrote:A test on $url is useless because in the case of 404, the url will be empty.
No, when the script has read the XML-data of the 404 file it will have set $url to 403. This is the URL specified by 403.xml.

Anything else?


404 management - spilarix - 2010-05-08

Thanks for your answers.

Zegnåt Wrote:No, when the script has read the XML-data of the 404 file it will have set $url to 403. This is the URL specified by 403.xml.
- Where is it set ?
- Could you give me an example of 403.xml file ? (It would be interessant to put a default file in the package)


404 management - Zegnåt - 2010-05-08

spilarix Wrote:Where is it set?
Code:
if (! file_exists($file)) {
    if (file_exists($file_404))    {
        $file = $file_404;
        exec_action('error-404');
    }
}
This put the path to the 404 file in $file, later in the GetSimple core this file is read just like any other page-file. The path is set on the line just above that if-clause:
Code:
$file_404 = "data/other/404.xml";
spilarix Wrote:Could you give me an example of 403.xml file? (It would be interessant to put a default file in the package)
Check the folder I mentioned above. You’ll find every GetSimple installation should already have a default 404.xml file in /data/other/.