1
0
mirror of https://github.com/Chouchen/shorturl.git synced 2018-06-07 06:34:38 +02:00

Added security with files and folders

This commit is contained in:
Shikiryu 2011-02-28 13:33:13 +00:00
parent d494349802
commit d9ddc18a5b

View File

@ -31,7 +31,7 @@ class ShortURL extends XMLSQL{
} }
public function shortThisUrl($longUrl, $shortName){ public function shortThisUrl($longUrl, $shortName){
if($this->pkAlreadyExists($shortName, 'url')){ if($this->pkAlreadyExists($shortName, 'url') || file_exists($shortName)){
return self::STATE_ALREADY_EXIST; return self::STATE_ALREADY_EXIST;
}else{ }else{
return $this->insert(array('url'=>$longUrl,'hit'=>'0'), rawurlencode($shortName))->into('url')->query(); return $this->insert(array('url'=>$longUrl,'hit'=>'0'), rawurlencode($shortName))->into('url')->query();