[wp-trac] [WordPress Trac] #14889: Memory Comparison Broken / WordPress Memory Limit

WordPress Trac wp-trac at lists.automattic.com
Wed Feb 2 22:31:50 UTC 2011


#14889: Memory Comparison Broken / WordPress Memory Limit
---------------------------------+-----------------------------
 Reporter:  hakre                |       Owner:
     Type:  defect (bug)         |      Status:  new
 Priority:  normal               |   Milestone:  Future Release
Component:  General              |     Version:  3.0
 Severity:  normal               |  Resolution:
 Keywords:  has-patch 3.2-early  |
---------------------------------+-----------------------------

Comment (by chrisbliss18):

 The ini_get function returns the value as it was set. So if I set in my
 php.ini "7.5G" (which is invalid and treated as 7G by PHP), it still
 returns "7.5G".

 I tested to confirm that 7.5G does indeed translate into 7G in PHP, and it
 does. Since this is the case, I force the value to an int since that is
 how PHP works with it.

 As for the test cases you propose, the first is invalid as it was already
 determined earlier in the conversation that WP_MEMORY_LIMIT will be
 restricted to only supplying a meg format. The second one works as
 expected with the patch I supplied.

 I've tested the code supplied and have provided my test code for review.
 Can I please get someone that is willing to try the code to sign off on it
 so we can get this in 3.1? I'm helping at least 3 people a week fix this
 problem.

-- 
Ticket URL: <http://core.trac.wordpress.org/ticket/14889#comment:13>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list