card126 / recaptcha

Automatically exported from code.google.com/p/recaptcha
0 stars 0 forks source link

MediaWiki error: Parameter 1 to ReCaptcha::confirmEdit() expected to be a reference #72

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
Activate recaptcha on a mediawiki installation by saving a page containing
a URL to an external site.

What is the expected output? What do you see instead?

The following error appears.

Warning: Parameter 1 to ReCaptcha::confirmEdit() expected to be a
reference, value given in [...]/includes/Hooks.php on line 117

What version of the product are you using? On what operating system?

PHP 5.3.2, MediaWiki 1.15.3, and recaptcha-mediawiki-1.7 

Please provide any additional information below.

The problem can be fixed with the attached patch.

Original issue reported on code.google.com by d...@aueb.gr on 4 Jun 2010 at 4:41

Attachments:

GoogleCodeExporter commented 8 years ago
The problem appears to be caused by call_user_func_array behaving differently 
in PHP 5.3+. Namely, the callback's function signature is ignored when deciding 
whether to pass arguments by reference.

The "confirmEdit" hook expects the first parameter to be a reference, but since 
call_user_func_array ignores this, it gets a value instead.

I'm not sure how this can be fixed - either by passing the variable as a 
reference explicitly, or by not using call_user_func_array anymore.

Original comment by arancayt...@gmail.com on 6 Sep 2010 at 1:41

GoogleCodeExporter commented 8 years ago
I changed:

        function confirmEdit( &$editPage, $newtext, $section ) {

to 

        function confirmEdit( $editPage, $newtext, $section ) {

in ReCaptcha.php and it seems to have fixed it

Original comment by ba...@091labs.com on 22 Dec 2010 at 7:27

GoogleCodeExporter commented 8 years ago
I tried downloading the latest package today and this fix was not in there.  
Can someone at Google update the package?  The fix is so simple!

Original comment by theplaz....@gmail.com on 5 Aug 2011 at 5:46

GoogleCodeExporter commented 8 years ago
I found the same problem, I made the change suggested in Comment 2 and it fixed 
it. The package isn't still updated. As is said in Comment 3, can someone 
update the package, please? Thank you.

Original comment by cior...@gmail.com on 10 Dec 2011 at 4:00

GoogleCodeExporter commented 8 years ago
comment 2 is right.
add the fix.

Original comment by bla...@googlemail.com on 3 Jan 2012 at 9:28

GoogleCodeExporter commented 8 years ago
I had the same problem and comment 2 fixed it as well.
This is a high-priority bug because it makes the plugin unusable.
I just downloaded it, followed the basic setup instructions and it gave an 
exception.
Anyone not finding this solution would fail to set it up correctly...

Original comment by stevenroose on 8 May 2012 at 12:58