https://bugzilla.wikimedia.org/show_bug.cgi?id=45663
Web browser: ---
Bug ID: 45663
Summary: URLs can exist, but file_exists says otherwise
Product: MediaWiki
Version: unspecified
Hardware: All
OS: All
Status: NEW
Severity: normal
Priority: Unprioritized
Component: File management
Assignee: [email protected]
Reporter: [email protected]
CC: [email protected], [email protected],
[email protected]
Classification: Unclassified
Mobile Platform: ---
PHP has native stream support for URLs, i.e., if you pass http://www.google.com
to any of fopen, fgets, etc., it will work perfectly. However, since stat()
calls don't work on URLs, calls to file_exists and is_readable will return
false for all URLs, even if the URL actually exists.
This causes problems if a FileBackend instance uses URLs as its local
references, which makes sense because there would be no need to download and
copy the file. BitmapHandler will check file_exists before transforming the
file, and then fail erroneously. (Note: The imagecreatefromjpeg in PHP does
support URLs, so it doesn't need a local copy for thumbnailing to work.)
In cases where a URL would work fine as a file stream, file_exists should be
bypassed in the case a URL is given. It might even be a good idea to make a
global function for this, i.e., wfFileExists, which appropriately checks if the
file exists as a URL or as a file.
--
You are receiving this mail because:
You are on the CC list for the bug.
You are the assignee for the bug.
You are watching all bug changes.
_______________________________________________
Wikibugs-l mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/wikibugs-l