mirror of
https://github.com/processwire/processwire.git
synced 2025-08-18 20:41:16 +02:00
Fix issue processwire/processwire-issues#329 Pagefile::install() method when used with URL argument that contains a query string was screwing up the file extension in the basename
This commit is contained in:
@@ -119,7 +119,16 @@ class Pagefile extends WireData {
|
|||||||
*/
|
*/
|
||||||
protected function ___install($filename) {
|
protected function ___install($filename) {
|
||||||
|
|
||||||
$basename = $this->pagefiles->cleanBasename($filename, true, false, true);
|
$basename = $filename;
|
||||||
|
|
||||||
|
if(strpos($basename, '?') !== false) {
|
||||||
|
list($basename, $queryString) = explode('?', $basename);
|
||||||
|
if($queryString) {} // do not use in basename
|
||||||
|
}
|
||||||
|
|
||||||
|
if(empty($basename)) throw new WireException("Empty filename");
|
||||||
|
|
||||||
|
$basename = $this->pagefiles->cleanBasename($basename, true, false, true);
|
||||||
$pathInfo = pathinfo($basename);
|
$pathInfo = pathinfo($basename);
|
||||||
$basename = basename($basename, ".$pathInfo[extension]");
|
$basename = basename($basename, ".$pathInfo[extension]");
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user