sleemanj / xinha

WYSIWYG HTML Editor Component (turns <textarea> into HTML editors)
http://trac.xinha.org/
Other
13 stars 2 forks source link

PHP's Strict Standards error using the ExtendedFileManager plugin (Trac #1464) #1464

Closed sleemanj closed 4 years ago

sleemanj commented 15 years ago

Xinha 0.96 beta2, PHP 5.2.6, FireFox 3.0.12

First, a topic on the forum about this: http://xinha.org/punbb/viewtopic.php?id=1253

The problem is: calls to class Files' methods issue a "Strict Standards" error ("non static method Files::xxx should not be called statically"), when you click the editor to add a picture.

My suggestion is: Replace every "function" in Files.php by "static function". This upgrade naturally depends on the version of PHP used.

The solution koto gave in the topic linked above is: switch PHP's directive display_errors to Off. The problem is still there but we just don't see it anymore.

The reason of the problem is: the Files class imported from ImageManager to ExtendedFileManager is defined as "Files Utilities" (koto's code comments), therefore a collection of functions, closer to the static class than to a possible object. However, the Files class must have been written seeking the largest compatibility, probably for old PHP versions which did not support "static" to define a function.

I just begin using Xinha (great work!!!), so there might be other classes needing this kind of upgrade...

I hope this post is at the right place and is not redundant ;o)

Have fun!

Reported by guest, migrated from http://trac.xinha.org/ticket/1464

sleemanj commented 15 years ago

Won't fix, because adding static will break compat with older PHP. Maybe in the future when PHP 4 can be forgotten (when PHP 6 comes out I will consider), there is another ticket.