Ticket #592 (closed Bug: wontfix)

Opened 4 months ago

Last modified 4 months ago

file::extension() needs to check for files existance (r2646)

Reported by: brettalton Owned by: Shadowhand
Priority: minor Milestone: 2.2
Component: Helpers Version: SVN HEAD
Keywords: file, extension, preg_replace, pathinfo Cc:

Description

http://trac.kohanaphp.com/browser/trunk/system/helpers/file.php?rev=2646#L14

Please add this to file::extension()

if ( ! file_exists($filename))
	return FALSE;

I also want to draw your attention to PHP's function:

return pathinfo($filename, PATHINFO_EXTENSION);

in case preg_replace() doesn't work as expected.

Change History

Changed 4 months ago by Shadowhand

  • status changed from new to closed
  • resolution set to wontfix

No, it functions exactly as it's intended to. It should not check for the files exists, just return the extension from the filename.

Changed 4 months ago by brettalton

Fair enough.

Note: See TracTickets for help on using tickets.