Elxis CMS Forum
Support => Elxis 4.x/5.x DEV => Topic started by: Amigamerlin on September 25, 2012, 20:43:46
-
Hello Datahell,
Just installed download plugin and published it.
I create a new article and using plugin I uploaded a PDF file. All went ok but when I try to download the file inside the article I get an "Invalid request!".
and no error in log files.
Apache log, no error too.
Apache acces log :
"GET /nautilus/components/com_content/plugins/download/includes/dl.php?m=0&c=UmEHLV5mB34EPgcuU2JadltpUjFQPwA0UGwKYAMzAWwJOg== HTTP/1.1" 1 36 "http://localhost/nautilus/index.php/elxis/test-upload.html" "Mozilla/5.0 (Windows NT 5.1; rv:15.0) Gecko/20100101 Firefox/15.0.1"
I hope this can help you .
Spec:
Apache 2.2.17
MySQL 5.1.53-community
PHP 5.3.4
Elxis Nautilus Beta 1297
Let me know.
Thank you
-
The download plugin uses a system to prevent direct linking from external sites.
For some reason the validation fails.
Try this: refresh the page and click again. Still the same error? Do this 2-3 times.
If this doesn't work you need to debug the plugin.
Here is how you will do it.
Open file components/com_content/plugins/download/includes/dl.php
Find all occurrences of "invalid request" string and append a unique integer next to it.
Example:
dlend('Invalid request! 1');
....
dlend('Invalid request! 2');
...etc
Now click again the download link and see the message. It will display something like Invalid request! X, where X the integer you wrote.
Copy-paste me the source code around this message, or write me the source line number, to see what the download script does there in order to understand why the validation fails.
Note: the download plugin links expire after 30 minutes ! So always refresh the page before testing. If the page is cached it is normal to get invalid request response due to expired links...
-
The download plugin uses a system to prevent direct linking from external sites.
For some reason the validation fails.
Try this: refresh the page and click again. Still the same error? Do this 2-3 times.
If this doesn't work you need to debug the plugin.
Here is how you will do it.
Open file components/com_content/plugins/download/includes/dl.php
Find all occurrences of "invalid request" string and append a unique integer next to it.
Example:
dlend('Invalid request! 1');
....
dlend('Invalid request! 2');
...etc
Now click again the download link and see the message. It will display something like Invalid request! X, where X the integer you wrote.
Copy-paste me the source code around this message, or write me the source line number, to see what the download script does there in order to understand why the validation fails.
Note: the download plugin links expire after 30 minutes ! So always refresh the page before testing. If the page is cached it is normal to get invalid request response due to expired links...
done as you described above .
Got "Invalid request!4"
line 50 to 54
$c = isset($_GET['c']) ? trim(urlencode($_GET['c'])) : '';
if ($c == '') { dlend('Invalid request!3'); }
$c2 = preg_replace("/[^a-zA-Z0-9\s\+\=\-\!\/]/", '', $c);
if ($c2 != $c) { dlend('Invalid request!4'); }
Ciao
-
It can't be that...
the characters preg_replace removes are not in $_GET['c'] variable.
c=UmEHLV5mB34EPgcuU2JadltpUjFQPwA0UGwKYAMzAWwJOg==
Do this, replace:
$c = isset($_GET['c']) ? trim(urlencode($_GET['c'])) : '';
with this:
$c = isset($_GET['c']) ? trim($_GET['c']) : '';
and retry
-
It can't be that...
the characters preg_replace removes are not in $_GET['c'] variable.
c=UmEHLV5mB34EPgcuU2JadltpUjFQPwA0UGwKYAMzAWwJOg==
Do this, replace:
$c = isset($_GET['c']) ? trim(urlencode($_GET['c'])) : '';
with this:
$c = isset($_GET['c']) ? trim($_GET['c']) : '';
and retry
done ...
Get invalid Request! 5
Line 60 - 69
if ($m > 0) {
$confpath = ELXIS_PATH.'/configuration.php';
} else {
$confpath = ELXIS_PATH.'/config'.$m.'.php';
}
if (!file_exists($confpath)) { dlend('Invalid request!5'); }
include($confpath);
if (!class_exists('elxisConfig', false)) { dlend('Invalid request!6'); }
-
Oooooops, my mistake! I have the if stament reversed. Sorry!
Please replace this:
if ($m > 0) {
$confpath = ELXIS_PATH.'/configuration.php';
} else {
$confpath = ELXIS_PATH.'/config'.$m.'.php';
}
With this:
if ($m > 0) {
$confpath = ELXIS_PATH.'/config'.$m.'.php';
} else {
$confpath = ELXIS_PATH.'/configuration.php';
}
The listing on EDC was updated, thanks for the bug report!
-
Thank you to you Datahell for Nautilus, this amazing cms !!!