Make WordPress Core

Changeset 5098 for trunk/xmlrpc.php


Ignore:
Timestamp:
03/25/2007 03:53:33 AM (20 years ago)
Author:
ryan
Message:

XMLRPC fixes from Joseph Scott. 404 for invalid post ids. Return empty array if no pages are present.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/xmlrpc.php

    r5089 r5098  
    262262
    263263                // Lookup info on pages.
    264                 $pages = array();
    265264                $pages = get_pages();
    266265                $num_pages = count($pages);
    … …  
    281280                // If no pages were found return an error.
    282281                else {
    283                         return(new IXR_Error(404, "Sorry, no pages were found."));
     282                        return(array());
    284283                }
    285284        }
    … …  
    10911090
    10921091          $postdata = wp_get_single_post($post_ID, ARRAY_A);
     1092
     1093                // If there is no post data for the give post id, stop
     1094                // now and return an error.  Other wise a new post will be
     1095                // created (which was the old behavior).
     1096                if(empty($postdata["ID"])) {
     1097                        return(new IXR_Error(404, "Invalid post id."));
     1098                }
     1099
    10931100          extract($postdata);
    10941101                $this->escape($postdata);
Note: See TracChangeset for help on using the changeset viewer.