Skip to:
Content

bbPress.org

Opened 12 years ago

Closed 12 years ago

#1214 closed defect (bug) (fixed)

XML-RPC array_merge warning

Reported by: timskii Owned by: chrishajer
Milestone: 1.0.3 Priority: normal
Severity: major Version: 1.0.2
Component: Back-end Keywords: has-patch tested
Cc: gautam.2011@…

Description

With pingback enabled, a PHP warning is logged:

array_merge() [function.array-merge]: Argument #1 is not an array in ..forums/xmlrpc.php on line 164

Part of BB_XMLRPC_Server() . Probably only an issue for PHP 5, which no longer accepts non-arrays in array_merge(). I assume $this->methods isn't supposed to be an array.

Attachments (1)

xmlrpc.php.diff (495 bytes) - added by Gautam Gupta 12 years ago.
Use typecasting to prevent error

Download all attachments as: .zip

Change History (8)

#1 @Gautam Gupta
12 years ago

  • Keywords needs-patch added
  • Milestone set to 1.1

@Gautam Gupta
12 years ago

Use typecasting to prevent error

#2 @Gautam Gupta
12 years ago

  • Cc gautam.2011@… added
  • Keywords has-patch tested added; needs-patch removed
  • Milestone changed from 1.1 to 1.0.3
  • Severity changed from normal to major

Attached the patch. It uses typecasting (as suggested here - http://php.net/manual/en/function.array-merge.php).

#3 @chrishajer
12 years ago

  • Owner set to chrishajer

Where would I see this warning? I'd like to see it before I patch and see that it's resolved. Thanks

#4 @GautamGupta
12 years ago

  • Keywords xmlrpc removed
  • Summary changed from xmlrpc array_merge warning to XML-RPC array_merge warning

Steps to reproduce:


1) Go to Settings -> Discussion and ensure that "Enable Pingbacks" is checked.
2) Go to Settings -> Writing and ensure that "XML-RPC" option is unchecked.
3) Go to yourforum.com/xmlrpc.php, and you should see an error like this:

Warning:  array_merge() [<a href='function.array-merge'>function.array-merge</a>]: Argument #1 is not an array in <b>/home/.../yourforum.com/xmlrpc.php</b> on line <b>164</b><br />

If you dont see the error (should not be the case, but still), then uncheck both the options and then check the "Enable Pingbacks" option.

#5 @chrishajer
12 years ago

OK, testing: enable pingbacks == true, XML-RPC == false. I do get this exact error. Will apply patch now and test again.

#6 @chrishajer
12 years ago

After apply patch, this is the result (as expected):

XML-RPC server accepts POST requests only. Will commit patch now. Thanks

#7 @chrishajer
12 years ago

  • Resolution set to fixed
  • Status changed from new to closed

(In [2410]) Cleanup array_merge PHP5 warning when pingbacks are enabled by typecasting array. Fixes #1214, props Gautam Gupta

Note: See TracTickets for help on using tickets.