| 1 | Index: wp-includes/functions.php |
|---|
| 2 | =================================================================== |
|---|
| 3 | --- wp-includes/functions.php (revision 19925) |
|---|
| 4 | +++ wp-includes/functions.php (working copy) |
|---|
| 5 | @@ -395,71 +395,6 @@ |
|---|
| 6 | } |
|---|
| 7 | |
|---|
| 8 | /** |
|---|
| 9 | - * Open the file handle for debugging. |
|---|
| 10 | - * |
|---|
| 11 | - * This function is used for XMLRPC feature, but it is general purpose enough |
|---|
| 12 | - * to be used in anywhere. |
|---|
| 13 | - * |
|---|
| 14 | - * @see fopen() for mode options. |
|---|
| 15 | - * @package WordPress |
|---|
| 16 | - * @subpackage Debug |
|---|
| 17 | - * @since 0.71 |
|---|
| 18 | - * @uses $debug Used for whether debugging is enabled. |
|---|
| 19 | - * |
|---|
| 20 | - * @param string $filename File path to debug file. |
|---|
| 21 | - * @param string $mode Same as fopen() mode parameter. |
|---|
| 22 | - * @return bool|resource File handle. False on failure. |
|---|
| 23 | - */ |
|---|
| 24 | -function debug_fopen( $filename, $mode ) { |
|---|
| 25 | - global $debug; |
|---|
| 26 | - if ( 1 == $debug ) { |
|---|
| 27 | - $fp = fopen( $filename, $mode ); |
|---|
| 28 | - return $fp; |
|---|
| 29 | - } else { |
|---|
| 30 | - return false; |
|---|
| 31 | - } |
|---|
| 32 | -} |
|---|
| 33 | - |
|---|
| 34 | -/** |
|---|
| 35 | - * Write contents to the file used for debugging. |
|---|
| 36 | - * |
|---|
| 37 | - * Technically, this can be used to write to any file handle when the global |
|---|
| 38 | - * $debug is set to 1 or true. |
|---|
| 39 | - * |
|---|
| 40 | - * @package WordPress |
|---|
| 41 | - * @subpackage Debug |
|---|
| 42 | - * @since 0.71 |
|---|
| 43 | - * @uses $debug Used for whether debugging is enabled. |
|---|
| 44 | - * |
|---|
| 45 | - * @param resource $fp File handle for debugging file. |
|---|
| 46 | - * @param string $string Content to write to debug file. |
|---|
| 47 | - */ |
|---|
| 48 | -function debug_fwrite( $fp, $string ) { |
|---|
| 49 | - global $debug; |
|---|
| 50 | - if ( 1 == $debug ) |
|---|
| 51 | - fwrite( $fp, $string ); |
|---|
| 52 | -} |
|---|
| 53 | - |
|---|
| 54 | -/** |
|---|
| 55 | - * Close the debugging file handle. |
|---|
| 56 | - * |
|---|
| 57 | - * Technically, this can be used to close any file handle when the global $debug |
|---|
| 58 | - * is set to 1 or true. |
|---|
| 59 | - * |
|---|
| 60 | - * @package WordPress |
|---|
| 61 | - * @subpackage Debug |
|---|
| 62 | - * @since 0.71 |
|---|
| 63 | - * @uses $debug Used for whether debugging is enabled. |
|---|
| 64 | - * |
|---|
| 65 | - * @param resource $fp Debug File handle. |
|---|
| 66 | - */ |
|---|
| 67 | -function debug_fclose( $fp ) { |
|---|
| 68 | - global $debug; |
|---|
| 69 | - if ( 1 == $debug ) |
|---|
| 70 | - fclose( $fp ); |
|---|
| 71 | -} |
|---|
| 72 | - |
|---|
| 73 | -/** |
|---|
| 74 | * Check content for video and audio links to add as enclosures. |
|---|
| 75 | * |
|---|
| 76 | * Will not add enclosures that have already been added and will |
|---|
| 77 | @@ -480,9 +415,7 @@ |
|---|
| 78 | //TODO: Tidy this ghetto code up and make the debug code optional |
|---|
| 79 | include_once( ABSPATH . WPINC . '/class-IXR.php' ); |
|---|
| 80 | |
|---|
| 81 | - $log = debug_fopen( ABSPATH . 'enclosures.log', 'a' ); |
|---|
| 82 | $post_links = array(); |
|---|
| 83 | - debug_fwrite( $log, 'BEGIN ' . date( 'YmdHis', time() ) . "\n" ); |
|---|
| 84 | |
|---|
| 85 | $pung = get_enclosed( $post_ID ); |
|---|
| 86 | |
|---|
| 87 | @@ -493,9 +426,6 @@ |
|---|
| 88 | |
|---|
| 89 | preg_match_all( "{\b http : [$any] +? (?= [$punc] * [^$any] | $)}x", $content, $post_links_temp ); |
|---|
| 90 | |
|---|
| 91 | - debug_fwrite( $log, 'Post contents:' ); |
|---|
| 92 | - debug_fwrite( $log, $content . "\n" ); |
|---|
| 93 | - |
|---|
| 94 | foreach ( $pung as $link_test ) { |
|---|
| 95 | if ( !in_array( $link_test, $post_links_temp[0] ) ) { // link no longer in post |
|---|
| 96 | $mid = $wpdb->get_col( $wpdb->prepare("SELECT meta_id FROM $wpdb->postmeta WHERE post_id = %d AND meta_key = 'enclosure' AND meta_value LIKE (%s)", $post_ID, like_escape( $link_test ) . '%') ); |
|---|
| 97 | Index: wp-includes/class-wp-xmlrpc-server.php |
|---|
| 98 | =================================================================== |
|---|
| 99 | --- wp-includes/class-wp-xmlrpc-server.php (revision 19925) |
|---|
| 100 | +++ wp-includes/class-wp-xmlrpc-server.php (working copy) |
|---|
| 101 | @@ -2700,8 +2700,6 @@ |
|---|
| 102 | |
|---|
| 103 | $this->attach_uploads( $post_ID, $post_content ); |
|---|
| 104 | |
|---|
| 105 | - logIO('O', "Posted ! ID: $post_ID"); |
|---|
| 106 | - |
|---|
| 107 | return $post_ID; |
|---|
| 108 | } |
|---|
| 109 | |
|---|
| 110 | @@ -3046,7 +3044,6 @@ |
|---|
| 111 | $post_category = array(); |
|---|
| 112 | if ( isset( $content_struct['categories'] ) ) { |
|---|
| 113 | $catnames = $content_struct['categories']; |
|---|
| 114 | - logIO('O', 'Post cats: ' . var_export($catnames,true)); |
|---|
| 115 | |
|---|
| 116 | if ( is_array($catnames) ) { |
|---|
| 117 | foreach ($catnames as $cat) { |
|---|
| 118 | @@ -3088,8 +3085,6 @@ |
|---|
| 119 | if ( !$post_ID ) |
|---|
| 120 | return new IXR_Error(500, __('Sorry, your entry could not be posted. Something wrong happened.')); |
|---|
| 121 | |
|---|
| 122 | - logIO('O', "Posted ! ID: $post_ID"); |
|---|
| 123 | - |
|---|
| 124 | return strval($post_ID); |
|---|
| 125 | } |
|---|
| 126 | |
|---|
| 127 | @@ -3381,8 +3376,6 @@ |
|---|
| 128 | if ( isset( $content_struct['wp_post_format'] ) ) |
|---|
| 129 | wp_set_post_terms( $post_ID, array( 'post-format-' . $content_struct['wp_post_format'] ), 'post_format' ); |
|---|
| 130 | |
|---|
| 131 | - logIO('O',"(MW) Edited ! ID: $post_ID"); |
|---|
| 132 | - |
|---|
| 133 | return true; |
|---|
| 134 | } |
|---|
| 135 | |
|---|
| 136 | @@ -3695,15 +3688,12 @@ |
|---|
| 137 | $type = $data['type']; |
|---|
| 138 | $bits = $data['bits']; |
|---|
| 139 | |
|---|
| 140 | - logIO('O', '(MW) Received '.strlen($bits).' bytes'); |
|---|
| 141 | - |
|---|
| 142 | if ( !$user = $this->login($username, $password) ) |
|---|
| 143 | return $this->error; |
|---|
| 144 | |
|---|
| 145 | do_action('xmlrpc_call', 'metaWeblog.newMediaObject'); |
|---|
| 146 | |
|---|
| 147 | if ( !current_user_can('upload_files') ) { |
|---|
| 148 | - logIO('O', '(MW) User does not have upload_files capability'); |
|---|
| 149 | $this->error = new IXR_Error(401, __('You are not allowed to upload files to this site.')); |
|---|
| 150 | return $this->error; |
|---|
| 151 | } |
|---|
| 152 | @@ -3732,7 +3722,6 @@ |
|---|
| 153 | $upload = wp_upload_bits($name, null, $bits); |
|---|
| 154 | if ( ! empty($upload['error']) ) { |
|---|
| 155 | $errorString = sprintf(__('Could not write file %1$s (%2$s)'), $name, $upload['error']); |
|---|
| 156 | - logIO('O', '(MW) ' . $errorString); |
|---|
| 157 | return new IXR_Error(500, $errorString); |
|---|
| 158 | } |
|---|
| 159 | // Construct the attachment array |
|---|
| 160 | @@ -4119,8 +4108,6 @@ |
|---|
| 161 | } |
|---|
| 162 | $post_ID = (int) $post_ID; |
|---|
| 163 | |
|---|
| 164 | - logIO("O","(PB) URL='$pagelinkedto' ID='$post_ID' Found='$way'"); |
|---|
| 165 | - |
|---|
| 166 | $post = get_post($post_ID); |
|---|
| 167 | |
|---|
| 168 | if ( !$post ) // Post_ID not found |
|---|
| 169 | Index: wp-includes/deprecated.php |
|---|
| 170 | =================================================================== |
|---|
| 171 | --- wp-includes/deprecated.php (revision 19925) |
|---|
| 172 | +++ wp-includes/deprecated.php (working copy) |
|---|
| 173 | @@ -2564,7 +2564,7 @@ |
|---|
| 174 | * Is the current admin page generated by a plugin? |
|---|
| 175 | * |
|---|
| 176 | * @since 1.5.0 |
|---|
| 177 | - * @deprecated 3.1 |
|---|
| 178 | + * @deprecated 3.1.0 |
|---|
| 179 | * @deprecated Use global $plugin_page and/or get_plugin_page_hookname() hooks. |
|---|
| 180 | * |
|---|
| 181 | * @global $plugin_page |
|---|
| 182 | @@ -2590,7 +2590,7 @@ |
|---|
| 183 | * for updating the category cache. |
|---|
| 184 | * |
|---|
| 185 | * @since 1.5.0 |
|---|
| 186 | - * @deprecated 3.1 |
|---|
| 187 | + * @deprecated 3.1.0 |
|---|
| 188 | * |
|---|
| 189 | * @return bool Always return True |
|---|
| 190 | */ |
|---|
| 191 | @@ -2604,7 +2604,7 @@ |
|---|
| 192 | * Check for PHP timezone support |
|---|
| 193 | * |
|---|
| 194 | * @since 2.9.0 |
|---|
| 195 | - * @deprecated 3.2 |
|---|
| 196 | + * @deprecated 3.2.0 |
|---|
| 197 | * |
|---|
| 198 | * @return bool |
|---|
| 199 | */ |
|---|
| 200 | @@ -2618,7 +2618,9 @@ |
|---|
| 201 | * Display editor: TinyMCE, HTML, or both. |
|---|
| 202 | * |
|---|
| 203 | * @since 2.1.0 |
|---|
| 204 | - * @deprecated 3.3 |
|---|
| 205 | + * @deprecated 3.3.0 |
|---|
| 206 | + * @deprecated Use wp_editor() |
|---|
| 207 | + * @see wp_editor() |
|---|
| 208 | * |
|---|
| 209 | * @param string $content Textarea content. |
|---|
| 210 | * @param string $id Optional, default is 'content'. HTML ID attribute value. |
|---|
| 211 | @@ -2627,6 +2629,7 @@ |
|---|
| 212 | * @param int $tab_index Optional, not used |
|---|
| 213 | */ |
|---|
| 214 | function the_editor($content, $id = 'content', $prev_id = 'title', $media_buttons = true, $tab_index = 2, $extended = true) { |
|---|
| 215 | + _deprecated_function( __FUNCTION__, '3.3', 'wp_editor()' ); |
|---|
| 216 | |
|---|
| 217 | wp_editor( $content, $id, array( 'media_buttons' => $media_buttons ) ); |
|---|
| 218 | return; |
|---|
| 219 | @@ -2636,6 +2639,8 @@ |
|---|
| 220 | * Perform the query to get the $metavalues array(s) needed by _fill_user and _fill_many_users |
|---|
| 221 | * |
|---|
| 222 | * @since 3.0.0 |
|---|
| 223 | + * @deprecated 3.3.0 |
|---|
| 224 | + * |
|---|
| 225 | * @param array $ids User ID numbers list. |
|---|
| 226 | * @return array of arrays. The array is indexed by user_id, containing $metavalues object arrays. |
|---|
| 227 | */ |
|---|
| 228 | @@ -2668,7 +2673,6 @@ |
|---|
| 229 | * |
|---|
| 230 | * @since 2.3.0 |
|---|
| 231 | * @deprecated 3.3.0 |
|---|
| 232 | - * @uses sanitize_user_field() Used to sanitize the fields. |
|---|
| 233 | * |
|---|
| 234 | * @param object|array $user The User Object or Array |
|---|
| 235 | * @param string $context Optional, default is 'display'. How to sanitize user fields. |
|---|
| 236 | @@ -2705,7 +2709,7 @@ |
|---|
| 237 | * Can either be start or end post relational link. |
|---|
| 238 | * |
|---|
| 239 | * @since 2.8.0 |
|---|
| 240 | - * @deprecated 3.3 |
|---|
| 241 | + * @deprecated 3.3.0 |
|---|
| 242 | * |
|---|
| 243 | * @param string $title Optional. Link title format. |
|---|
| 244 | * @param bool $in_same_cat Optional. Whether link should be in a same category. |
|---|
| 245 | @@ -2745,7 +2749,7 @@ |
|---|
| 246 | * Display relational link for the first post. |
|---|
| 247 | * |
|---|
| 248 | * @since 2.8.0 |
|---|
| 249 | - * @deprecated 3.3 |
|---|
| 250 | + * @deprecated 3.3.0 |
|---|
| 251 | * |
|---|
| 252 | * @param string $title Optional. Link title format. |
|---|
| 253 | * @param bool $in_same_cat Optional. Whether link should be in a same category. |
|---|
| 254 | @@ -2761,7 +2765,7 @@ |
|---|
| 255 | * Get site index relational link. |
|---|
| 256 | * |
|---|
| 257 | * @since 2.8.0 |
|---|
| 258 | - * @deprecated 3.3 |
|---|
| 259 | + * @deprecated 3.3.0 |
|---|
| 260 | * |
|---|
| 261 | * @return string |
|---|
| 262 | */ |
|---|
| 263 | @@ -2776,7 +2780,7 @@ |
|---|
| 264 | * Display relational link for the site index. |
|---|
| 265 | * |
|---|
| 266 | * @since 2.8.0 |
|---|
| 267 | - * @deprecated 3.3 |
|---|
| 268 | + * @deprecated 3.3.0 |
|---|
| 269 | */ |
|---|
| 270 | function index_rel_link() { |
|---|
| 271 | _deprecated_function( __FUNCTION__, '3.3' ); |
|---|
| 272 | @@ -2788,7 +2792,7 @@ |
|---|
| 273 | * Get parent post relational link. |
|---|
| 274 | * |
|---|
| 275 | * @since 2.8.0 |
|---|
| 276 | - * @deprecated 3.3 |
|---|
| 277 | + * @deprecated 3.3.0 |
|---|
| 278 | * |
|---|
| 279 | * @param string $title Optional. Link title format. |
|---|
| 280 | * @return string |
|---|
| 281 | @@ -2819,7 +2823,7 @@ |
|---|
| 282 | * Display relational link for parent item |
|---|
| 283 | * |
|---|
| 284 | * @since 2.8.0 |
|---|
| 285 | - * @deprecated 3.3 |
|---|
| 286 | + * @deprecated 3.3.0 |
|---|
| 287 | */ |
|---|
| 288 | function parent_post_rel_link($title = '%title') { |
|---|
| 289 | _deprecated_function( __FUNCTION__, '3.3' ); |
|---|
| 290 | @@ -2831,7 +2835,7 @@ |
|---|
| 291 | * Add the "Dashboard"/"Visit Site" menu. |
|---|
| 292 | * |
|---|
| 293 | * @since 3.2.0 |
|---|
| 294 | - * @deprecated 3.3 |
|---|
| 295 | + * @deprecated 3.3.0 |
|---|
| 296 | */ |
|---|
| 297 | function wp_admin_bar_dashboard_view_site_menu( $wp_admin_bar ) { |
|---|
| 298 | _deprecated_function( __FUNCTION__, '3.3' ); |
|---|
| 299 | @@ -2852,7 +2856,7 @@ |
|---|
| 300 | * Checks if the current user belong to a given blog. |
|---|
| 301 | * |
|---|
| 302 | * @since MU |
|---|
| 303 | - * @deprecated 3.3 |
|---|
| 304 | + * @deprecated 3.3.0 |
|---|
| 305 | * @deprecated Use is_user_member_of_blog() |
|---|
| 306 | * @see is_user_member_of_blog() |
|---|
| 307 | * |
|---|
| 308 | @@ -2864,3 +2868,41 @@ |
|---|
| 309 | |
|---|
| 310 | return is_user_member_of_blog( get_current_user_id(), $blog_id ); |
|---|
| 311 | } |
|---|
| 312 | + |
|---|
| 313 | +/** |
|---|
| 314 | + * Open the file handle for debugging. |
|---|
| 315 | + * |
|---|
| 316 | + * @since 0.71 |
|---|
| 317 | + * @deprecated Use error_log() |
|---|
| 318 | + * @link http://www.php.net/manual/en/function.error-log.php |
|---|
| 319 | + * @deprecated 3.4.0 |
|---|
| 320 | + */ |
|---|
| 321 | +function debug_fopen( $filename, $mode ) { |
|---|
| 322 | + _deprecated_function( __FUNCTION__, 'error_log' ); |
|---|
| 323 | + return false; |
|---|
| 324 | +} |
|---|
| 325 | + |
|---|
| 326 | +/** |
|---|
| 327 | + * Write contents to the file used for debugging. |
|---|
| 328 | + * |
|---|
| 329 | + * @since 0.71 |
|---|
| 330 | + * @deprecated Use error_log() instead. |
|---|
| 331 | + * @link http://www.php.net/manual/en/function.error-log.php |
|---|
| 332 | + * @deprecated 3.4.0 |
|---|
| 333 | + */ |
|---|
| 334 | +function debug_fwrite( $fp, $string ) { |
|---|
| 335 | + _deprecated_function( __FUNCTION__, 'error_log' ); |
|---|
| 336 | + error_log( $string ); |
|---|
| 337 | +} |
|---|
| 338 | + |
|---|
| 339 | +/** |
|---|
| 340 | + * Close the debugging file handle. |
|---|
| 341 | + * |
|---|
| 342 | + * @since 0.71 |
|---|
| 343 | + * @deprecated Use error_log() |
|---|
| 344 | + * @link http://www.php.net/manual/en/function.error-log.php |
|---|
| 345 | + * @deprecated 3.4.0 |
|---|
| 346 | + */ |
|---|
| 347 | +function debug_fclose( $fp ) { |
|---|
| 348 | + _deprecated_function( __FUNCTION__, 'error_log' ); |
|---|
| 349 | +} |
|---|
| 350 | \ No newline at end of file |
|---|
| 351 | Index: wp-app.php |
|---|
| 352 | =================================================================== |
|---|
| 353 | --- wp-app.php (revision 19925) |
|---|
| 354 | +++ wp-app.php (working copy) |
|---|
| 355 | @@ -24,14 +24,6 @@ |
|---|
| 356 | $_SERVER['PATH_INFO'] = preg_replace( '/.*\/wp-app\.php/', '', $_SERVER['REQUEST_URI'] ); |
|---|
| 357 | |
|---|
| 358 | /** |
|---|
| 359 | - * Whether to enable Atom Publishing Protocol Logging. |
|---|
| 360 | - * |
|---|
| 361 | - * @name app_logging |
|---|
| 362 | - * @var int|bool |
|---|
| 363 | - */ |
|---|
| 364 | -$app_logging = 0; |
|---|
| 365 | - |
|---|
| 366 | -/** |
|---|
| 367 | * Whether to always authenticate user. Permanently set to true. |
|---|
| 368 | * |
|---|
| 369 | * @name always_authenticate |
|---|
| 370 | @@ -44,21 +36,17 @@ |
|---|
| 371 | * Writes logging info to a file. |
|---|
| 372 | * |
|---|
| 373 | * @since 2.2.0 |
|---|
| 374 | - * @uses $app_logging |
|---|
| 375 | - * @package WordPress |
|---|
| 376 | - * @subpackage Logging |
|---|
| 377 | + * @deprecated 3.4.0 |
|---|
| 378 | + * @deprecated Use error_log() |
|---|
| 379 | + * @link http://www.php.net/manual/en/function.error-log.php |
|---|
| 380 | * |
|---|
| 381 | * @param string $label Type of logging |
|---|
| 382 | * @param string $msg Information describing logging reason. |
|---|
| 383 | */ |
|---|
| 384 | -function log_app($label,$msg) { |
|---|
| 385 | - global $app_logging; |
|---|
| 386 | - if ($app_logging) { |
|---|
| 387 | - $fp = fopen( 'wp-app.log', 'a+'); |
|---|
| 388 | - $date = gmdate( 'Y-m-d H:i:s' ); |
|---|
| 389 | - fwrite($fp, "\n\n$date - $label\n$msg\n"); |
|---|
| 390 | - fclose($fp); |
|---|
| 391 | - } |
|---|
| 392 | +function log_app( $label, $msg ) { |
|---|
| 393 | + _deprecated_function( __FUNCTION__, '3.4', 'error_log()' ); |
|---|
| 394 | + if ( ! empty( $GLOBALS['app_logging'] ) ) |
|---|
| 395 | + error_log( $label . ' - ' . $message ); |
|---|
| 396 | } |
|---|
| 397 | |
|---|
| 398 | /** |
|---|
| 399 | @@ -268,8 +256,6 @@ |
|---|
| 400 | |
|---|
| 401 | $method = $_SERVER['REQUEST_METHOD']; |
|---|
| 402 | |
|---|
| 403 | - log_app('REQUEST',"$method $path\n================"); |
|---|
| 404 | - |
|---|
| 405 | $this->process_conditionals(); |
|---|
| 406 | //$this->process_conditionals(); |
|---|
| 407 | |
|---|
| 408 | @@ -319,8 +305,6 @@ |
|---|
| 409 | * @since 2.2.0 |
|---|
| 410 | */ |
|---|
| 411 | function get_service() { |
|---|
| 412 | - log_app('function','get_service()'); |
|---|
| 413 | - |
|---|
| 414 | if ( !current_user_can( 'edit_posts' ) ) |
|---|
| 415 | $this->auth_required( __( 'Sorry, you do not have the right to access this site.' ) ); |
|---|
| 416 | |
|---|
| 417 | @@ -360,8 +344,6 @@ |
|---|
| 418 | * @since 2.2.0 |
|---|
| 419 | */ |
|---|
| 420 | function get_categories_xml() { |
|---|
| 421 | - log_app('function','get_categories_xml()'); |
|---|
| 422 | - |
|---|
| 423 | if ( !current_user_can( 'edit_posts' ) ) |
|---|
| 424 | $this->auth_required( __( 'Sorry, you do not have the right to access this site.' ) ); |
|---|
| 425 | |
|---|
| 426 | @@ -397,8 +379,6 @@ |
|---|
| 427 | |
|---|
| 428 | $entry = array_pop($parser->feed->entries); |
|---|
| 429 | |
|---|
| 430 | - log_app('Received entry:', print_r($entry,true)); |
|---|
| 431 | - |
|---|
| 432 | $catnames = array(); |
|---|
| 433 | foreach ( $entry->categories as $cat ) { |
|---|
| 434 | array_push($catnames, $cat["term"]); |
|---|
| 435 | @@ -436,7 +416,6 @@ |
|---|
| 436 | $post_data = compact('blog_ID', 'post_author', 'post_date', 'post_date_gmt', 'post_content', 'post_title', 'post_category', 'post_status', 'post_excerpt', 'post_name'); |
|---|
| 437 | |
|---|
| 438 | $this->escape($post_data); |
|---|
| 439 | - log_app('Inserting Post. Data:', print_r($post_data,true)); |
|---|
| 440 | |
|---|
| 441 | $postID = wp_insert_post($post_data); |
|---|
| 442 | if ( is_wp_error( $postID ) ) |
|---|
| 443 | @@ -455,7 +434,6 @@ |
|---|
| 444 | |
|---|
| 445 | $output = $this->get_entry($postID); |
|---|
| 446 | |
|---|
| 447 | - log_app('function',"create_post($postID)"); |
|---|
| 448 | $this->created($postID, $output); |
|---|
| 449 | } |
|---|
| 450 | |
|---|
| 451 | @@ -474,7 +452,6 @@ |
|---|
| 452 | |
|---|
| 453 | $this->set_current_entry($postID); |
|---|
| 454 | $output = $this->get_entry($postID); |
|---|
| 455 | - log_app('function',"get_post($postID)"); |
|---|
| 456 | $this->output($output); |
|---|
| 457 | |
|---|
| 458 | } |
|---|
| 459 | @@ -497,8 +474,6 @@ |
|---|
| 460 | |
|---|
| 461 | $parsed = array_pop($parser->feed->entries); |
|---|
| 462 | |
|---|
| 463 | - log_app('Received UPDATED entry:', print_r($parsed,true)); |
|---|
| 464 | - |
|---|
| 465 | // check for not found |
|---|
| 466 | global $entry; |
|---|
| 467 | $this->set_current_entry($postID); |
|---|
| 468 | @@ -531,7 +506,6 @@ |
|---|
| 469 | |
|---|
| 470 | do_action( 'atompub_put_post', $ID, $parsed ); |
|---|
| 471 | |
|---|
| 472 | - log_app('function',"put_post($postID)"); |
|---|
| 473 | $this->ok(); |
|---|
| 474 | } |
|---|
| 475 | |
|---|
| 476 | @@ -560,7 +534,6 @@ |
|---|
| 477 | $this->internal_error(__('For some strange yet very annoying reason, this post could not be deleted.')); |
|---|
| 478 | } |
|---|
| 479 | |
|---|
| 480 | - log_app('function',"delete_post($postID)"); |
|---|
| 481 | $this->ok(); |
|---|
| 482 | } |
|---|
| 483 | |
|---|
| 484 | @@ -582,7 +555,6 @@ |
|---|
| 485 | } else { |
|---|
| 486 | $this->set_current_entry($postID); |
|---|
| 487 | $output = $this->get_entry($postID, 'attachment'); |
|---|
| 488 | - log_app('function',"get_attachment($postID)"); |
|---|
| 489 | $this->output($output); |
|---|
| 490 | } |
|---|
| 491 | } |
|---|
| 492 | @@ -617,8 +589,6 @@ |
|---|
| 493 | $slug = sanitize_file_name( "$slug.$ext" ); |
|---|
| 494 | $file = wp_upload_bits( $slug, null, $bits); |
|---|
| 495 | |
|---|
| 496 | - log_app('wp_upload_bits returns:',print_r($file,true)); |
|---|
| 497 | - |
|---|
| 498 | $url = $file['url']; |
|---|
| 499 | $file = $file['file']; |
|---|
| 500 | |
|---|
| 501 | @@ -643,7 +613,6 @@ |
|---|
| 502 | $output = $this->get_entry($postID, 'attachment'); |
|---|
| 503 | |
|---|
| 504 | $this->created($postID, $output, 'attachment'); |
|---|
| 505 | - log_app('function',"create_attachment($postID)"); |
|---|
| 506 | } |
|---|
| 507 | |
|---|
| 508 | /** |
|---|
| 509 | @@ -688,7 +657,6 @@ |
|---|
| 510 | if ( !$result ) |
|---|
| 511 | $this->internal_error(__('For some strange yet very annoying reason, this post could not be edited.')); |
|---|
| 512 | |
|---|
| 513 | - log_app('function',"put_attachment($postID)"); |
|---|
| 514 | $this->ok(); |
|---|
| 515 | } |
|---|
| 516 | |
|---|
| 517 | @@ -700,8 +668,6 @@ |
|---|
| 518 | * @param int $postID Post ID. |
|---|
| 519 | */ |
|---|
| 520 | function delete_attachment($postID) { |
|---|
| 521 | - log_app('function',"delete_attachment($postID). File '$location' deleted."); |
|---|
| 522 | - |
|---|
| 523 | // check for not found |
|---|
| 524 | global $entry; |
|---|
| 525 | $this->set_current_entry($postID); |
|---|
| 526 | @@ -724,7 +690,6 @@ |
|---|
| 527 | if ( !$result ) |
|---|
| 528 | $this->internal_error(__('For some strange yet very annoying reason, this post could not be deleted.')); |
|---|
| 529 | |
|---|
| 530 | - log_app('function',"delete_attachment($postID). File '$location' deleted."); |
|---|
| 531 | $this->ok(); |
|---|
| 532 | } |
|---|
| 533 | |
|---|
| 534 | @@ -770,7 +735,6 @@ |
|---|
| 535 | status_header ('404'); |
|---|
| 536 | } |
|---|
| 537 | |
|---|
| 538 | - log_app('function',"get_file($postID)"); |
|---|
| 539 | exit; |
|---|
| 540 | } |
|---|
| 541 | |
|---|
| 542 | @@ -828,7 +792,6 @@ |
|---|
| 543 | |
|---|
| 544 | wp_update_attachment_metadata( $postID, wp_generate_attachment_metadata( $postID, $location ) ); |
|---|
| 545 | |
|---|
| 546 | - log_app('function',"put_file($postID)"); |
|---|
| 547 | $this->ok(); |
|---|
| 548 | } |
|---|
| 549 | |
|---|
| 550 | @@ -939,7 +902,6 @@ |
|---|
| 551 | |
|---|
| 552 | $url = $this->app_base . $this->ENTRY_PATH . "/$postID"; |
|---|
| 553 | |
|---|
| 554 | - log_app('function',"get_entry_url() = $url"); |
|---|
| 555 | return $url; |
|---|
| 556 | } |
|---|
| 557 | |
|---|
| 558 | @@ -970,7 +932,6 @@ |
|---|
| 559 | |
|---|
| 560 | $url = $this->app_base . $this->MEDIA_SINGLE_PATH ."/file/$postID"; |
|---|
| 561 | |
|---|
| 562 | - log_app('function',"get_media_url() = $url"); |
|---|
| 563 | return $url; |
|---|
| 564 | } |
|---|
| 565 | |
|---|
| 566 | @@ -994,7 +955,6 @@ |
|---|
| 567 | */ |
|---|
| 568 | function set_current_entry($postID) { |
|---|
| 569 | global $entry; |
|---|
| 570 | - log_app('function',"set_current_entry($postID)"); |
|---|
| 571 | |
|---|
| 572 | if (!isset($postID)) { |
|---|
| 573 | // $this->bad_request(); |
|---|
| 574 | @@ -1018,7 +978,6 @@ |
|---|
| 575 | * @param string $post_type Optional, default is 'post'. Post Type. |
|---|
| 576 | */ |
|---|
| 577 | function get_posts($page = 1, $post_type = 'post') { |
|---|
| 578 | - log_app('function',"get_posts($page, '$post_type')"); |
|---|
| 579 | $feed = $this->get_feed($page, $post_type); |
|---|
| 580 | $this->output($feed); |
|---|
| 581 | } |
|---|
| 582 | @@ -1032,7 +991,6 @@ |
|---|
| 583 | * @param string $post_type Optional, default is 'attachment'. Post type. |
|---|
| 584 | */ |
|---|
| 585 | function get_attachments($page = 1, $post_type = 'attachment') { |
|---|
| 586 | - log_app('function',"get_attachments($page, '$post_type')"); |
|---|
| 587 | $GLOBALS['post_type'] = $post_type; |
|---|
| 588 | $feed = $this->get_feed($page, $post_type); |
|---|
| 589 | $this->output($feed); |
|---|
| 590 | @@ -1049,7 +1007,6 @@ |
|---|
| 591 | */ |
|---|
| 592 | function get_feed($page = 1, $post_type = 'post') { |
|---|
| 593 | global $post, $wp, $wp_query, $posts, $wpdb, $blog_id; |
|---|
| 594 | - log_app('function',"get_feed($page, '$post_type')"); |
|---|
| 595 | ob_start(); |
|---|
| 596 | |
|---|
| 597 | $this->ENTRY_PATH = $post_type; |
|---|
| 598 | @@ -1069,9 +1026,7 @@ |
|---|
| 599 | $wp_query = $GLOBALS['wp_query']; |
|---|
| 600 | $wpdb = $GLOBALS['wpdb']; |
|---|
| 601 | $blog_id = (int) $GLOBALS['blog_id']; |
|---|
| 602 | - log_app('function',"query_posts(# " . print_r($wp_query, true) . "#)"); |
|---|
| 603 | |
|---|
| 604 | - log_app('function',"total_count(# $wp_query->max_num_pages #)"); |
|---|
| 605 | $last_page = $wp_query->max_num_pages; |
|---|
| 606 | $next_page = (($page + 1) > $last_page) ? null : $page + 1; |
|---|
| 607 | $prev_page = ($page - 1) < 1 ? null : $page - 1; |
|---|
| 608 | @@ -1116,7 +1071,6 @@ |
|---|
| 609 | * @return string. |
|---|
| 610 | */ |
|---|
| 611 | function get_entry($postID, $post_type = 'post') { |
|---|
| 612 | - log_app('function',"get_entry($postID, '$post_type')"); |
|---|
| 613 | ob_start(); |
|---|
| 614 | switch($post_type) { |
|---|
| 615 | case 'post': |
|---|
| 616 | @@ -1132,14 +1086,12 @@ |
|---|
| 617 | while ( have_posts() ) { |
|---|
| 618 | the_post(); |
|---|
| 619 | $this->echo_entry(); |
|---|
| 620 | - log_app('$post',print_r($GLOBALS['post'],true)); |
|---|
| 621 | $entry = ob_get_contents(); |
|---|
| 622 | break; |
|---|
| 623 | } |
|---|
| 624 | } |
|---|
| 625 | ob_end_clean(); |
|---|
| 626 | |
|---|
| 627 | - log_app('get_entry returning:',$entry); |
|---|
| 628 | return $entry; |
|---|
| 629 | } |
|---|
| 630 | |
|---|
| 631 | @@ -1190,7 +1142,6 @@ |
|---|
| 632 | * @since 2.2.0 |
|---|
| 633 | */ |
|---|
| 634 | function ok() { |
|---|
| 635 | - log_app('Status','200: OK'); |
|---|
| 636 | header('Content-Type: text/plain'); |
|---|
| 637 | status_header('200'); |
|---|
| 638 | exit; |
|---|
| 639 | @@ -1202,7 +1153,6 @@ |
|---|
| 640 | * @since 2.2.0 |
|---|
| 641 | */ |
|---|
| 642 | function no_content() { |
|---|
| 643 | - log_app('Status','204: No Content'); |
|---|
| 644 | header('Content-Type: text/plain'); |
|---|
| 645 | status_header('204'); |
|---|
| 646 | echo "Moved to Trash."; |
|---|
| 647 | @@ -1217,7 +1167,6 @@ |
|---|
| 648 | * @param string $msg Optional. Status string. |
|---|
| 649 | */ |
|---|
| 650 | function internal_error($msg = 'Internal Server Error') { |
|---|
| 651 | - log_app('Status','500: Server Error'); |
|---|
| 652 | header('Content-Type: text/plain'); |
|---|
| 653 | status_header('500'); |
|---|
| 654 | echo $msg; |
|---|
| 655 | @@ -1230,7 +1179,6 @@ |
|---|
| 656 | * @since 2.2.0 |
|---|
| 657 | */ |
|---|
| 658 | function bad_request() { |
|---|
| 659 | - log_app('Status','400: Bad Request'); |
|---|
| 660 | header('Content-Type: text/plain'); |
|---|
| 661 | status_header('400'); |
|---|
| 662 | exit; |
|---|
| 663 | @@ -1242,7 +1190,6 @@ |
|---|
| 664 | * @since 2.2.0 |
|---|
| 665 | */ |
|---|
| 666 | function length_required() { |
|---|
| 667 | - log_app('Status','411: Length Required'); |
|---|
| 668 | header("HTTP/1.1 411 Length Required"); |
|---|
| 669 | header('Content-Type: text/plain'); |
|---|
| 670 | status_header('411'); |
|---|
| 671 | @@ -1255,7 +1202,6 @@ |
|---|
| 672 | * @since 2.2.0 |
|---|
| 673 | */ |
|---|
| 674 | function invalid_media() { |
|---|
| 675 | - log_app('Status','415: Unsupported Media Type'); |
|---|
| 676 | header("HTTP/1.1 415 Unsupported Media Type"); |
|---|
| 677 | header('Content-Type: text/plain'); |
|---|
| 678 | exit; |
|---|
| 679 | @@ -1267,7 +1213,6 @@ |
|---|
| 680 | * @since 2.6.0 |
|---|
| 681 | */ |
|---|
| 682 | function forbidden($reason='') { |
|---|
| 683 | - log_app('Status','403: Forbidden'); |
|---|
| 684 | header('Content-Type: text/plain'); |
|---|
| 685 | status_header('403'); |
|---|
| 686 | echo $reason; |
|---|
| 687 | @@ -1280,7 +1225,6 @@ |
|---|
| 688 | * @since 2.2.0 |
|---|
| 689 | */ |
|---|
| 690 | function not_found() { |
|---|
| 691 | - log_app('Status','404: Not Found'); |
|---|
| 692 | header('Content-Type: text/plain'); |
|---|
| 693 | status_header('404'); |
|---|
| 694 | exit; |
|---|
| 695 | @@ -1292,7 +1236,6 @@ |
|---|
| 696 | * @since 2.2.0 |
|---|
| 697 | */ |
|---|
| 698 | function not_allowed($allow) { |
|---|
| 699 | - log_app('Status','405: Not Allowed'); |
|---|
| 700 | header('Allow: ' . join(',', $allow)); |
|---|
| 701 | status_header('405'); |
|---|
| 702 | exit; |
|---|
| 703 | @@ -1304,8 +1247,6 @@ |
|---|
| 704 | * @since 2.3.0 |
|---|
| 705 | */ |
|---|
| 706 | function redirect($url) { |
|---|
| 707 | - |
|---|
| 708 | - log_app('Status','302: Redirect'); |
|---|
| 709 | $escaped_url = esc_attr($url); |
|---|
| 710 | $content = <<<EOD |
|---|
| 711 | <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN"> |
|---|
| 712 | @@ -1334,7 +1275,6 @@ |
|---|
| 713 | * @since 2.2.0 |
|---|
| 714 | */ |
|---|
| 715 | function client_error($msg = 'Client Error') { |
|---|
| 716 | - log_app('Status','400: Client Error'); |
|---|
| 717 | header('Content-Type: text/plain'); |
|---|
| 718 | status_header('400'); |
|---|
| 719 | exit; |
|---|
| 720 | @@ -1348,7 +1288,6 @@ |
|---|
| 721 | * @since 2.2.0 |
|---|
| 722 | */ |
|---|
| 723 | function created($post_ID, $content, $post_type = 'post') { |
|---|
| 724 | - log_app('created()::$post_ID',"$post_ID, $post_type"); |
|---|
| 725 | $edit = $this->get_entry_url($post_ID); |
|---|
| 726 | switch($post_type) { |
|---|
| 727 | case 'post': |
|---|
| 728 | @@ -1375,7 +1314,6 @@ |
|---|
| 729 | * @param string $msg Status header content and HTML content. |
|---|
| 730 | */ |
|---|
| 731 | function auth_required($msg) { |
|---|
| 732 | - log_app('Status','401: Auth Required'); |
|---|
| 733 | nocache_headers(); |
|---|
| 734 | header('WWW-Authenticate: Basic realm="WordPress Atom Protocol"'); |
|---|
| 735 | header("HTTP/1.1 401 $msg"); |
|---|
| 736 | @@ -1416,7 +1354,6 @@ |
|---|
| 737 | header('Date: '. date('r')); |
|---|
| 738 | if ($this->do_output) |
|---|
| 739 | echo $xml; |
|---|
| 740 | - log_app('function', "output:\n$xml"); |
|---|
| 741 | exit; |
|---|
| 742 | } |
|---|
| 743 | |
|---|
| 744 | @@ -1449,8 +1386,6 @@ |
|---|
| 745 | * @return bool |
|---|
| 746 | */ |
|---|
| 747 | function authenticate() { |
|---|
| 748 | - log_app("authenticate()",print_r($_ENV, true)); |
|---|
| 749 | - |
|---|
| 750 | // if using mod_rewrite/ENV hack |
|---|
| 751 | // http://www.besthostratings.com/articles/http-auth-php-cgi.html |
|---|
| 752 | if (isset($_SERVER['HTTP_AUTHORIZATION'])) { |
|---|
| 753 | @@ -1465,12 +1400,9 @@ |
|---|
| 754 | |
|---|
| 755 | // If Basic Auth is working... |
|---|
| 756 | if (isset($_SERVER['PHP_AUTH_USER']) && isset($_SERVER['PHP_AUTH_PW'])) { |
|---|
| 757 | - log_app("Basic Auth",$_SERVER['PHP_AUTH_USER']); |
|---|
| 758 | - |
|---|
| 759 | $user = wp_authenticate($_SERVER['PHP_AUTH_USER'], $_SERVER['PHP_AUTH_PW']); |
|---|
| 760 | if ( $user && !is_wp_error($user) ) { |
|---|
| 761 | wp_set_current_user($user->ID); |
|---|
| 762 | - log_app("authenticate()", $user->user_login); |
|---|
| 763 | return true; |
|---|
| 764 | } |
|---|
| 765 | } |
|---|
| 766 | @@ -1499,7 +1431,6 @@ |
|---|
| 767 | $type = $_SERVER['CONTENT_TYPE']; |
|---|
| 768 | list($type,$subtype) = explode('/',$type); |
|---|
| 769 | list($subtype) = explode(";",$subtype); // strip MIME parameters |
|---|
| 770 | - log_app("get_accepted_content_type", "type=$type, subtype=$subtype"); |
|---|
| 771 | |
|---|
| 772 | foreach($types as $t) { |
|---|
| 773 | list($acceptedType,$acceptedSubtype) = explode('/',$t); |
|---|
| 774 | Index: xmlrpc.php |
|---|
| 775 | =================================================================== |
|---|
| 776 | --- xmlrpc.php (revision 19925) |
|---|
| 777 | +++ xmlrpc.php (working copy) |
|---|
| 778 | @@ -54,9 +54,6 @@ |
|---|
| 779 | include_once(ABSPATH . WPINC . '/class-IXR.php'); |
|---|
| 780 | include_once(ABSPATH . WPINC . '/class-wp-xmlrpc-server.php'); |
|---|
| 781 | |
|---|
| 782 | -// Turn off all warnings and errors. |
|---|
| 783 | -// error_reporting(0); |
|---|
| 784 | - |
|---|
| 785 | /** |
|---|
| 786 | * Posts submitted via the xmlrpc interface get that title |
|---|
| 787 | * @name post_default_title |
|---|
| 788 | @@ -65,39 +62,20 @@ |
|---|
| 789 | $post_default_title = ""; |
|---|
| 790 | |
|---|
| 791 | /** |
|---|
| 792 | - * Whether to enable XMLRPC Logging. |
|---|
| 793 | - * |
|---|
| 794 | - * @name xmlrpc_logging |
|---|
| 795 | - * @var int|bool |
|---|
| 796 | - */ |
|---|
| 797 | -$xmlrpc_logging = 0; |
|---|
| 798 | - |
|---|
| 799 | -/** |
|---|
| 800 | * logIO() - Writes logging info to a file. |
|---|
| 801 | * |
|---|
| 802 | - * @uses $xmlrpc_logging |
|---|
| 803 | - * @package WordPress |
|---|
| 804 | - * @subpackage Logging |
|---|
| 805 | + * @deprecated 3.4.0 |
|---|
| 806 | + * @deprecated Use error_log() |
|---|
| 807 | * |
|---|
| 808 | * @param string $io Whether input or output |
|---|
| 809 | * @param string $msg Information describing logging reason. |
|---|
| 810 | - * @return bool Always return true |
|---|
| 811 | */ |
|---|
| 812 | -function logIO($io,$msg) { |
|---|
| 813 | - global $xmlrpc_logging; |
|---|
| 814 | - if ($xmlrpc_logging) { |
|---|
| 815 | - $fp = fopen("../xmlrpc.log","a+"); |
|---|
| 816 | - $date = gmdate("Y-m-d H:i:s "); |
|---|
| 817 | - $iot = ($io == "I") ? " Input: " : " Output: "; |
|---|
| 818 | - fwrite($fp, "\n\n".$date.$iot.$msg); |
|---|
| 819 | - fclose($fp); |
|---|
| 820 | - } |
|---|
| 821 | - return true; |
|---|
| 822 | +function logIO( $io, $msg ) { |
|---|
| 823 | + _deprecated_function( __FUNCTION__, '3.4', 'error_log()' ); |
|---|
| 824 | + if ( ! empty( $GLOBALS['xmlrpc_logging'] ) ) |
|---|
| 825 | + erorr_log( $io . ' - ' . $msg ); |
|---|
| 826 | } |
|---|
| 827 | |
|---|
| 828 | -if ( isset($HTTP_RAW_POST_DATA) ) |
|---|
| 829 | - logIO("I", $HTTP_RAW_POST_DATA); |
|---|
| 830 | - |
|---|
| 831 | // Allow for a plugin to insert a different class to handle requests. |
|---|
| 832 | $wp_xmlrpc_server_class = apply_filters('wp_xmlrpc_server_class', 'wp_xmlrpc_server'); |
|---|
| 833 | $wp_xmlrpc_server = new $wp_xmlrpc_server_class; |
|---|