#4016 closed defect (bug) (fixed)
PHP Parse error: syntax error, unexpected T_STRING
Reported by: | j.conti | Owned by: | |
---|---|---|---|
Milestone: | 1.5.5 | Priority: | normal |
Severity: | minor | Version: | 1.5.3 |
Component: | Core | Keywords: | |
Cc: |
Description
There is a problem with BuddyPress 1.5.4
All my BuddyPress has started to create an error_log with this error:
[16-Feb-2012 21:21:21 UTC] PHP Parse error: syntax error, unexpected T_STRING in /home/xxxxxxx/public_html/wp-content/plugins/buddypress/bp-members/bp-members-signup.php(116) : runtime-created function on line 1
[16-Feb-2012 21:21:21 UTC] PHP Warning: call_user_func_array() expects parameter 1 to be a valid callback, no array or string given in /home/xxxxxxx/public_html/wp-includes/plugin.php on line 405
My server has PHP 5.3.10
Change History (11)
#2
@
13 years ago
- Milestone changed from Awaiting Review to 1.5.5
Some function is missing. Any idea if the same error happens on trunk?
#3
@
13 years ago
- Keywords reporter-feedback added
I can't reproduce it. I'm guessing that an error is being registered in $bp->signup->errors that isn't structured properly as key-value, so that either $fieldname or $error_message is ending up undefined, and the create_function() command therefore failing because of mauled syntax. If that's right, we can fix this by checking to make sure that $fieldname and $error_message are non-empty before attempting to create the function. But that seems a bit random, if we can't recreate the error to begin with.
j.conti, are you running any plugins or any other modifications to the registration process?
#4
@
13 years ago
Hi,
We find the issue. The issue is with quotes. If the error message has quotes, it screen the error.
We fixed adding addslashes() to the error message http://plugins.trac.wordpress.org/browser/wangguard/trunk/wangguard-admin.php#L476
#6
@
13 years ago
- Severity changed from normal to minor
Good find. The issue is specific to the syntax of create_function() and the way that we're concatenating the content of the function. The good news is that it'll only affect instances where plugins are registering their own messages in $bp->signup->errors, which is probably very few.
I'm going to fix this by adding our own addslashes()/stripslashes(), but it'll break what you've done in WangGuard - the content will be double-slashed. So you'll have to remove your own addslashes(). Hope that's OK! Thanks for your help tracking this down.
#9
@
13 years ago
Ok,
Only show that error to bots, this is why at first we did not find the issue.
In a couple of days we release WangGuard 1.4.
Right now I do not know if release WangGuard with or without the fix ...
Do you know when you release BuddyPress 1.5.5?
#10
@
13 years ago
Do you know when you release BuddyPress 1.5.5?
No, I don't know, unfortunately.
If I were you, I would release without the addslashes(). Since the problem only arises for bots, hopefully it won't be a big deal if the error pops up between the release of WangGuard 1.4 and BP 1.5.5 (would probably only be the matter of a week or two).
More info.
I cannot reproduce the error.
Is a random error. I made a lot of combinations and the error was not on error_log again.
Few hours later, the error appeared again with a new user registration...
Is a very strange error.