File tree Expand file tree Collapse file tree 2 files changed +9
-1
lines changed Expand file tree Collapse file tree 2 files changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -372,7 +372,10 @@ public static function ext($path)
372372 $ path = preg_replace ('#\?(.*)# ' , '' , $ path );
373373 }
374374
375- return pathinfo ($ path , PATHINFO_EXTENSION );
375+ $ ext = pathinfo ($ path , PATHINFO_EXTENSION );
376+ $ ext = strtolower ($ ext );
377+
378+ return $ ext ;
376379 }
377380
378381 /**
Original file line number Diff line number Diff line change @@ -316,10 +316,15 @@ public function testExt()
316316 isSame ('' , FS ::ext (null ));
317317 isSame ('' , FS ::ext (false ));
318318
319+ // URl
319320 isSame ('txt ' , FS ::ext ('file.txt?some_var=123456 ' ));
320321 isSame ('txt ' , FS ::ext ('file.txt?some_var=123456?invalid=param ' ));
321322 isSame ('php ' , FS ::ext ('http://demo.jbzoo.com/sites/phones/smartfony.php?logic=and&exact=0&controller=search&option=com_zoo&task=filter&type=phone&app_id=1&Itemid=101 ' ));
322323 isSame ('' , FS ::ext ('http://demo.jbzoo.com/sites/phones/smartfony?logic=and&exact=0&controller=search&option=com_zoo&task=filter&type=phone&app_id=1&Itemid=101 ' ));
324+
325+ // to lower
326+ isSame ('png ' , FS ::ext ('image.PNG ' ));
327+ isSame ('png ' , FS ::ext ('image.PnG ' ));
323328 }
324329
325330 public function testBase ()
You can’t perform that action at this time.
0 commit comments