[wp-trac] [WordPress Trac] #24539: Imagick gives E_STRICT notice on PHP 5.4 due to queryFormats() static call

WordPress Trac noreply at wordpress.org
Sat Jun 8 00:52:54 UTC 2013


#24539: Imagick gives E_STRICT notice on PHP 5.4 due to queryFormats() static call
--------------------------+-----------------------------
 Reporter:  DH-Shredder   |      Owner:
     Type:  defect (bug)  |     Status:  new
 Priority:  normal        |  Milestone:  Awaiting Review
Component:  Media         |    Version:  3.5
 Severity:  normal        |   Keywords:  has-patch
--------------------------+-----------------------------
 While using imagick, an E_STRICT notice is generated when queryFormats()
 is called statically:
 https://bugs.php.net/bug.php?id=64945

 If a PHP module specifies ZEND_ACC_ALLOW_STATIC, then calling that method
 statically creates this warning:
 Strict Standards: Non-static method Imagick:queryformats() should not be
 called
 statically in /wp-includes/class-wp-image-editor-imagick.php on line 100

 Since the author is intentionally allowing static calls (and this
 particular check does not depend on the specific instance), it's not ideal
 that PHP has this behavior, since we are using the module as it is
 intended.

 It seems like there are a couple of options:
 1) We could add an @ in front of the call
 2) We could temporarily create an Imagick object that we don't load
 anything into, and use that, then destroy it.

 I don't particularly like either option, but there it is.

 Initial patches attached.

--
Ticket URL: <http://core.trac.wordpress.org/ticket/24539>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list