Replace urlencode by rawurlencode

Send image if url are not valide in get method
This commit is contained in:
Knah Tsaeb 2013-03-26 15:30:36 +01:00
parent 21f406bd6b
commit 73f5564569

View file

@ -199,10 +199,12 @@ if ($_GET) {
die('I take a chips and give it to Godzilla. I print a shoes and .............. KAMOULOX ! Well done Jean Pierre.');
}
$ui['url'] = urldecode($ui['url']);
$ui['url'] = rawurldecode($ui['url']);
$testUrl = testValidUrl($ui['url']);
if ($testUrl !== true) {
echo $testUrl['msg'];
header("Content-type: image/png");
header("Expires: Sat, 26 Jul 1997 05:00:00 GMT");
echo file_get_contents('bin/error.png');
exit();
}
@ -245,7 +247,7 @@ if ($_POST) {
}
verifToken($ui['token']);
$ui['url'] = urldecode($ui['url']);
$ui['url'] = rawurldecode($ui['url']);
$testUrl = testValidUrl($ui['url']);
if ($testUrl !== true) {
@ -315,9 +317,9 @@ if (empty($defUrl)) {
<?php
if (!empty($success)) {
if ($GLOBALS['config']['onlyThumb'] === true) {
echo '<img src="', $success['thumb'], '?r=', time(), '"/>';
echo '<img src="', $success['thumb'], '?r=', time(), '"/>';
} else {
echo '<a href="', $success['normal'], '"><img src="', $success['thumb'], '?r=', time(), '"/></a>';
echo '<a href="', $success['normal'], '"><img src="', $success['thumb'], '?r=', time(), '"/></a>';
}
}
?>