#14207 closed defect (bug) (worksforme)
streams.php, POMO_FileReader $length parameter of fread
Reported by: |
|
Owned by: |
|
---|---|---|---|
Milestone: | Priority: | normal | |
Severity: | normal | Version: | 3.0 |
Component: | I18N | Keywords: | has-patch reporter-feedback |
Focuses: | Cc: |
Description (last modified by )
the fread function run with an error, when you have the length-paramter ist 0. This is possible on use WP in local engines and intranet.
Small changes on the function: read in class POMO_FileReader
function read($bytes) { if ( isset($bytes) && ( 0 > $bytes ) ) return fread($this->_f, $bytes); else return; }
Attachments (4)
Change History (18)
#1
@
15 years ago
- Component changed from Administration to i18n
- Severity changed from critical to major
#2
@
15 years ago
the warning is an problem when you work with WP_DEBUG true; its not possible to use the backend. Yes, you can change this to empty().
#3
@
14 years ago
- Milestone changed from Awaiting Review to Future Release
- Owner set to nbachiyski
- Status changed from new to assigned
#5
@
14 years ago
"the fread function run with an error, when you have the length-paramter ist 0. This is possible on use WP in local engines and intranet"
when the blog in a landscape without internet-connection
#6
@
14 years ago
Still don't quite understand the connection between intranet and reading .mo files.
However I guess the condition in the patch should be inverted:
if ( !empty($bytes) ) return fread($this->_f, $bytes); else return false;
Uploaded new patch.
#7
@
14 years ago
I have check this on my development-version and now works fine, no errors for fread. Thanks
function read($bytes) { if ( !empty($bytes) ) return fread($this->_f, $bytes); else return false; }
#11
@
13 years ago
- Keywords reporter-feedback added
read()
method is only called for an arbitrary number of bytes in lines 160 and 169 of mo.php
:
http://core.trac.wordpress.org/browser/tags/3.3.1/wp-includes/pomo/mo.php#L160
14207.2.patch makes sure the values passed to read()
are not zero.
I'm still not sure what are we trying to fix here though. I've checked a localized install without Internet access with WP_DEBUG
on and didn't see any warnings.
#12
@
10 years ago
- Keywords dev-feedback added; reporter-feedback removed
- Resolution set to worksforme
- Status changed from assigned to closed
Seems this is an impossible scenario to generate. Closing as worksforme.
Without speaking at all to the validity of the patch, checking for empty() would be much simpler.
Lowering priority a bit as fread() with zero length fires only a warning, not a fatal, and I'm still not sure of the steps to reproduce an instance where 0 is requested.