mirror of
https://github.com/Chouchen/shorturl.git
synced 2018-06-07 06:34:38 +02:00
JS corrections
This commit is contained in:
parent
4007da6e9d
commit
a3f7e375d4
8
add.php
8
add.php
@ -28,6 +28,12 @@ elseif($ret === ShortURL::STATE_ALREADY_EXIST){
|
|||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
else{
|
else{
|
||||||
echo 'alert("Raccourci créé : http://'.$_SERVER['SERVER_NAME'].$folder.rawurlencode($newname).'");';
|
$URI = $_SERVER['REQUEST_URI'];
|
||||||
|
$folders = explode('/', $URI);
|
||||||
|
if(count($folders) > 2){
|
||||||
|
$folder = '/'.$folders[1].'/';
|
||||||
|
}else
|
||||||
|
$folder = '/';
|
||||||
|
echo 'alert("'.ShortURL::STATE_CREATED.' : http://'.$_SERVER['SERVER_NAME'].$folder.rawurlencode($s).'");window.clipboardData.setData("Text", "http://'.$_SERVER['SERVER_NAME'].$folder.rawurlencode($s).'");';
|
||||||
exit;
|
exit;
|
||||||
}
|
}
|
Loading…
Reference in New Issue
Block a user