Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PHP 5.3 fault after version 4.6 #52

Closed
crislv90 opened this issue Nov 26, 2016 · 8 comments
Closed

PHP 5.3 fault after version 4.6 #52

crislv90 opened this issue Nov 26, 2016 · 8 comments
Assignees
Labels
Milestone

Comments

@crislv90
Copy link

Hello,
At some point, after I upgraded WordPress automatically, I think to 4.6, the enlighter plugin stopped working. I now get the python $this reference error below:

Fatal error: Using $this when not in object context in /home/username/public_html/wp_name/wp-content/plugins/enlighter/class/ShortcodeFilter.php on line 85

Any idea what I need to do ?
Thanks

@AndiDittrich
Copy link
Member

Sounds like a lambda function issue.
Do you use PHP < 5.4 ?

best regards, Andi

@crislv90
Copy link
Author

Oh, sorry, I meant php not python .. ;-)
Yes, here is my php version:
PHP 5.3.10-1ubuntu3.25 with Suhosin-Patch (cli) (built: Oct 3 2016 17:02:21)
Copyright (c) 1997-2012 The PHP Group
Zend Engine v2.3.0, Copyright (c) 1998-2012 Zend Technologies
with Suhosin v0.9.33, Copyright (c) 2007-2012, by SektionEins GmbH

@AndiDittrich
Copy link
Member

Thanks! i will fix it asap.

@AndiDittrich
Copy link
Member

Please try v3.3-BETA3 (GitHub Master Branch)

@crislv90
Copy link
Author

Almost there ...

You need to change this:

private $_codeFragments = array();

to this:

public $_codeFragments = array();

Otherwise, I get this error:

Fatal error: Cannot access private property Enlighter\ShortcodeFilter::$_codeFragments in /home/username/public_html/wp_name/wp-content/plugins/enlighter/class/ShortcodeFilter.php on line 88

Once I made the array public, it works great .

Thanks

Cris

@AndiDittrich
Copy link
Member

Thanks! I didn't test it yet because i have no php 5.3 installation anymore.

btw. i will drop the PHP 5.3 support in the future. Currently most users use a modern version https://wordpress.org/about/stats/

@crislv90
Copy link
Author

My ISP has php 5.3 .. I will see if they would run the upgrade ..
if not, at least I know your trick of passing "$this" to any lambda as a generic $T .. if I ever need to again ..
Thanks

@AndiDittrich AndiDittrich changed the title python fault after version 4.6 PHP 5.3 fault after version 4.6 Dec 3, 2016
@AndiDittrich
Copy link
Member

v3.3 is out

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants