Merge pull request #39 from harshvardhanmalpani/patch-1
removes Query string from img url to get file namepull/58/head
commit
599d35cec2
|
@ -92,7 +92,7 @@ class Upload {
|
|||
}
|
||||
|
||||
// Save the source name
|
||||
$this->source_name = G\get_filename_without_extension($this->type == "url" ? $this->source : $this->source["name"]);
|
||||
$this->source_name = G\get_filename_without_extension($this->type == "url" ? $this->getNameFromURL($this->source) : $this->source["name"]);
|
||||
|
||||
// Set file extension
|
||||
$this->extension = $this->source_image_fileinfo["extension"];
|
||||
|
@ -184,6 +184,16 @@ class Upload {
|
|||
return explode(',', $formats);
|
||||
}
|
||||
|
||||
//remove query string from url to get correct image name
|
||||
protected function getNameFromURL()
|
||||
{
|
||||
if(strpos($this->source, '?')) {
|
||||
return substr($this->source, 0, strpos($this->source, '?'));
|
||||
} else {
|
||||
return $this->source;
|
||||
}
|
||||
}
|
||||
|
||||
// Failover since v3.8.12
|
||||
public static function getEnabledImageFormats() {
|
||||
return Image::getEnabledImageFormats();
|
||||
|
|
|
@ -318,7 +318,7 @@ class DB {
|
|||
|
||||
$query = 'SELECT * FROM '.$table;
|
||||
|
||||
if($join) {
|
||||
if(isset($join) && $join) {
|
||||
$query .= ' ' . $join . ' ';
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue