Closed (fixed)
Project:
Drupal core
Version:
6.x-dev
Component:
xml-rpc system
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
7 Jan 2010 at 07:53 UTC
Updated:
3 Jan 2014 at 01:08 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
jurgenhaasConverted line endings and included filepaths
Comment #3
mr.baileysGood catch. I agree that the extra check is necessary here, as XMLRPC handlers can return any type of data.
isset()is not required here: $result will exist no matter what.Powered by Dreditor.
Comment #4
jurgenhaasGood point. Rerolled the patch and removed isset().
Comment #5
mr.baileysHas the testbot's approval: http://qa.drupal.org/pifr/test/38758 (and mine too)
Comment #6
mr.baileysWhile trying to figure out whether or not this needed backporting to D6, it seems it was fixed in D6. The if-statement also looks slightly different in that fix, so setting this back to CNW.
Comment #7
jurgenhaasRight, here is the next version.
Comment #8
mr.baileysThanks. Looks good and follows the same approach as the D6 fix, so RTBC.
Comment #9
dries commentedThere are a number of
if ($result->is_error) {in the code and this patch only addresses one. I wonder if they all need to be addressed.Comment #10
jurgenhaasI found one more.
Comment #11
mr.baileysDouble-checked the patch in #10 now fixes all instances in core where $result->is_error is used without first ensuring that it's an object. The second hunk will need to be backported to D6 since this was missed in #208195: remove xmlrpcs.inc notice.
Comment #12
dries commentedCommitted to CVS HEAD. Thanks.
Comment #13
mr.baileysThanks!
@jurgenhaas: interested in providing a D6 patch too?
Comment #14
jurgenhaasComment #15
jurgenhaasSorry, submitted without a comment:
Here is the patch for D6. One of the occurances of $result->is_error was covered already, the second one is handled by the attched patch.
Comment #16
mr.baileysThanks, applied and reviewed, RTBC.
Comment #17
fgmI wonder: in this case, is
if (is_object($result) && !empty($result->is_error))any better than just:
if (is_object($result) && $result->is_error)Comment #18
mr.baileys@fgm: see #208195: remove xmlrpcs.inc notice for some info on why !empty($result->is_error) is used instead if $result->is_error. My understanding is that the first option prevents notices in the unlikely event that $result is an object but does not have an is_error property.
Comment #19
gábor hojtsyThanks, committed.