mirror of
https://github.com/processwire/processwire.git
synced 2025-08-17 20:11:46 +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:
@@ -118,8 +118,17 @@ class Pagefile extends WireData {
|
||||
*
|
||||
*/
|
||||
protected function ___install($filename) {
|
||||
|
||||
$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($filename, true, false, true);
|
||||
$basename = $this->pagefiles->cleanBasename($basename, true, false, true);
|
||||
$pathInfo = pathinfo($basename);
|
||||
$basename = basename($basename, ".$pathInfo[extension]");
|
||||
|
||||
|
Reference in New Issue
Block a user