Make WordPress Core

Changeset 1679 for trunk/xmlrpc.php


Ignore:
Timestamp:
09/17/2004 10:35:41 AM (22 years ago)
Author:
michelvaldrighi
Message:

returning actual fault codes in pingback.ping

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/xmlrpc.php

    r1672 r1679  
    11071107                $pos1 = strpos($pagelinkedto, str_replace('http://', '', str_replace('www.', '', get_settings('home'))));
    11081108                if(!$pos1) {
    1109                         return '0';
     1109                        return new IXR_Error(0, '');
    11101110                }
    11111111
    … …  
    11431143                                if (! ($post_ID = $wpdb->get_var($sql)) ) {
    11441144                                        // returning unknown error '0' is better than die()ing
    1145                                         return '0';
     1145                                        return new IXR_Error(0, '');
    11461146                                }
    11471147                                $way = 'from the fragment (title)';
    … …  
    11491149                } else {
    11501150                        // TODO: Attempt to extract a post ID from the given URL
    1151                         return '0x0021';
     1151                        return new IXR_Error(33, 'The specified target URI cannot be used as a target. It either doesn\'t exist, or it is not a pingback-enabled resource.');
    11521152                }
    11531153
    … …  
    11601160                if (!$wpdb->num_rows) {
    11611161                        // Post_ID not found
    1162                         return '0x0021';
     1162                        return new IXR_Error(33, 'The specified target URI cannot be used as a target. It either doesn\'t exist, or it is not a pingback-enabled resource.');
    11631163                }
    11641164
    … …  
    11741174                if ($wpdb->num_rows) {
    11751175                        // We already have a Pingback from this URL
    1176                         return '0x0030';
     1176                        return new IXR_Error(48, 'The pingback has already been registered.');
    11771177                }
    11781178
    … …  
    11851185                if (!$fp) {
    11861186                        // The source URI does not exist
    1187                         return '0x0010';
     1187                        return new IXR_Error(16, 'The source URI does not exist.');
    11881188                }
    11891189
    … …  
    12171217                if (empty($context)) {
    12181218                        // URL pattern not found
    1219                         return '0x0011';
     1219                        return new IXR_Error(17, 'The source URI does not contain a link to the target URI, and so cannot be used as a source.');
    12201220                }
    12211221
    … …  
    12241224                $pingstatus = $wpdb->get_var("SELECT ping_status FROM $wpdb->posts WHERE ID = $post_ID");
    12251225                if ('closed' == $pingstatus) {
    1226                         return '0x0021';
     1226                        return new IXR_Error(33, 'The specified target URI cannot be used as a target. It either doesn\'t exist, or it is not a pingback-enabled resource.');
    12271227                }
    12281228
    … …  
    12451245                // Check if the entry allows pings
    12461246                if( !check_comment($title, '', $pagelinkedfrom, $context, $user_ip, $user_agent) ) {
    1247                         return '0x0031';
     1247                        return new IXR_Error(49, 'Pingbacks not allowed on this entry.');
    12481248                }
    12491249
    … …  
    12791279                if (!$post_ID) {
    12801280                        // We aren't sure that the resource is available and/or pingback enabled
    1281                         return '0x0021';
     1281                        return new IXR_Error(33, 'The specified target URI cannot be used as a target. It either doesn\'t exist, or it is not a pingback-enabled resource.');
    12821282                }
    12831283
    … …  
    12861286                if (!$actual_post) {
    12871287                        // No such post = resource not found
    1288                         return '0x0020';
     1288                        return new IXR_Error(32, 'The specified target URI does not exist.');
    12891289                }
    12901290
Note: See TracChangeset for help on using the changeset viewer.