Changeset 19935
- Timestamp:
- 02/17/2012 12:02:42 AM (13 years ago)
- Location:
- trunk
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-admin/includes/upgrade.php
r19799 r19935 1360 1360 */ 1361 1361 function maybe_add_column($table_name, $column_name, $create_ddl) { 1362 global $wpdb , $debug;1362 global $wpdb; 1363 1363 foreach ($wpdb->get_col("DESC $table_name", 0) as $column ) { 1364 if ($debug) echo("checking $column == $column_name<br />");1365 1364 if ($column == $column_name) { 1366 1365 return true; -
trunk/wp-admin/install-helper.php
r19712 r19935 10 10 * needing to use these functions a lot, you might experience time outs. If you 11 11 * do, then it is advised to just write the SQL code yourself. 12 *13 * You can turn debugging on, by setting $debug to 1 after you include this14 * file.15 12 * 16 13 * <code> … … 41 38 /** Load WordPress Bootstrap */ 42 39 require_once(dirname(dirname(__FILE__)).'/wp-load.php'); 43 44 /**45 * Turn debugging on or off.46 * @global bool|int $debug47 * @name $debug48 * @var bool|int49 * @since 1.0.050 */51 $debug = 0;52 40 53 41 if ( ! function_exists('maybe_create_table') ) : … … 91 79 * @subpackage Plugin 92 80 * @uses $wpdb 93 * @uses $debug94 81 * 95 82 * @param string $table_name Database table name … … 99 86 */ 100 87 function maybe_add_column($table_name, $column_name, $create_ddl) { 101 global $wpdb , $debug;88 global $wpdb; 102 89 foreach ($wpdb->get_col("DESC $table_name",0) as $column ) { 103 if ($debug) echo("checking $column == $column_name<br />");104 90 105 91 if ($column == $column_name) { … … 180 166 */ 181 167 function check_column($table_name, $col_name, $col_type, $is_null = null, $key = null, $default = null, $extra = null) { 182 global $wpdb , $debug;168 global $wpdb; 183 169 $diffs = 0; 184 170 $results = $wpdb->get_results("DESC $table_name"); 185 171 186 172 foreach ($results as $row ) { 187 if ($debug > 1) print_r($row);188 173 189 174 if ($row->Field == $col_name) { 190 175 // got our column, check the params 191 if ($debug) echo ("checking $row->Type against $col_type\n");192 176 if (($col_type != null) && ($row->Type != $col_type)) { 193 177 ++$diffs; … … 206 190 } 207 191 if ($diffs > 0) { 208 if ($debug) echo ("diffs = $diffs returning false\n");209 192 return false; 210 193 } -
trunk/wp-app.php
r19926 r19935 23 23 24 24 $_SERVER['PATH_INFO'] = preg_replace( '/.*\/wp-app\.php/', '', $_SERVER['REQUEST_URI'] ); 25 26 /**27 * Whether to enable Atom Publishing Protocol Logging.28 *29 * @name app_logging30 * @var int|bool31 */32 $app_logging = 0;33 25 34 26 /** … … 45 37 * 46 38 * @since 2.2.0 47 * @ uses $app_logging48 * @ package WordPress49 * @ subpackage Logging39 * @deprecated 3.4.0 40 * @deprecated Use error_log() 41 * @link http://www.php.net/manual/en/function.error-log.php 50 42 * 51 43 * @param string $label Type of logging 52 44 * @param string $msg Information describing logging reason. 53 45 */ 54 function log_app($label,$msg) { 55 global $app_logging; 56 if ($app_logging) { 57 $fp = fopen( 'wp-app.log', 'a+'); 58 $date = gmdate( 'Y-m-d H:i:s' ); 59 fwrite($fp, "\n\n$date - $label\n$msg\n"); 60 fclose($fp); 61 } 46 function log_app( $label, $msg ) { 47 _deprecated_function( __FUNCTION__, '3.4', 'error_log()' ); 48 if ( ! empty( $GLOBALS['app_logging'] ) ) 49 error_log( $label . ' - ' . $message ); 62 50 } 63 51 … … 269 257 $method = $_SERVER['REQUEST_METHOD']; 270 258 271 log_app('REQUEST',"$method $path\n================");272 273 259 $this->process_conditionals(); 274 260 //$this->process_conditionals(); … … 320 306 */ 321 307 function get_service() { 322 log_app('function','get_service()');323 324 308 if ( !current_user_can( 'edit_posts' ) ) 325 309 $this->auth_required( __( 'Sorry, you do not have the right to access this site.' ) ); … … 361 345 */ 362 346 function get_categories_xml() { 363 log_app('function','get_categories_xml()');364 365 347 if ( !current_user_can( 'edit_posts' ) ) 366 348 $this->auth_required( __( 'Sorry, you do not have the right to access this site.' ) ); … … 397 379 398 380 $entry = array_pop($parser->feed->entries); 399 400 log_app('Received entry:', print_r($entry,true));401 381 402 382 $catnames = array(); … … 452 432 453 433 $this->escape($post_data); 454 log_app('Inserting Post. Data:', print_r($post_data,true));455 434 456 435 $postID = wp_insert_post($post_data); … … 471 450 $output = $this->get_entry($postID); 472 451 473 log_app('function',"create_post($postID)");474 452 $this->created($postID, $output); 475 453 } … … 490 468 $this->set_current_entry($postID); 491 469 $output = $this->get_entry($postID); 492 log_app('function',"get_post($postID)");493 470 $this->output($output); 494 471 … … 512 489 513 490 $parsed = array_pop($parser->feed->entries); 514 515 log_app('Received UPDATED entry:', print_r($parsed,true));516 491 517 492 // check for not found … … 547 522 do_action( 'atompub_put_post', $ID, $parsed ); 548 523 549 log_app('function',"put_post($postID)");550 524 $this->ok(); 551 525 } … … 576 550 } 577 551 578 log_app('function',"delete_post($postID)");579 552 $this->ok(); 580 553 } … … 598 571 $this->set_current_entry($postID); 599 572 $output = $this->get_entry($postID, 'attachment'); 600 log_app('function',"get_attachment($postID)");601 573 $this->output($output); 602 574 } … … 633 605 $file = wp_upload_bits( $slug, null, $bits); 634 606 635 log_app('wp_upload_bits returns:',print_r($file,true));636 637 607 $url = $file['url']; 638 608 $file = $file['file']; … … 659 629 660 630 $this->created($postID, $output, 'attachment'); 661 log_app('function',"create_attachment($postID)");662 631 } 663 632 … … 704 673 $this->internal_error(__('For some strange yet very annoying reason, this post could not be edited.')); 705 674 706 log_app('function',"put_attachment($postID)");707 675 $this->ok(); 708 676 } … … 716 684 */ 717 685 function delete_attachment($postID) { 718 log_app('function',"delete_attachment($postID). File '$location' deleted.");719 720 686 // check for not found 721 687 global $entry; … … 740 706 $this->internal_error(__('For some strange yet very annoying reason, this post could not be deleted.')); 741 707 742 log_app('function',"delete_attachment($postID). File '$location' deleted.");743 708 $this->ok(); 744 709 } … … 786 751 } 787 752 788 log_app('function',"get_file($postID)");789 753 exit; 790 754 } … … 844 808 wp_update_attachment_metadata( $postID, wp_generate_attachment_metadata( $postID, $location ) ); 845 809 846 log_app('function',"put_file($postID)");847 810 $this->ok(); 848 811 } … … 955 918 $url = $this->app_base . $this->ENTRY_PATH . "/$postID"; 956 919 957 log_app('function',"get_entry_url() = $url");958 920 return $url; 959 921 } … … 986 948 $url = $this->app_base . $this->MEDIA_SINGLE_PATH ."/file/$postID"; 987 949 988 log_app('function',"get_media_url() = $url");989 950 return $url; 990 951 } … … 1010 971 function set_current_entry($postID) { 1011 972 global $entry; 1012 log_app('function',"set_current_entry($postID)");1013 973 1014 974 if (!isset($postID)) { … … 1034 994 */ 1035 995 function get_posts($page = 1, $post_type = 'post') { 1036 log_app('function',"get_posts($page, '$post_type')");1037 996 $feed = $this->get_feed($page, $post_type); 1038 997 $this->output($feed); … … 1048 1007 */ 1049 1008 function get_attachments($page = 1, $post_type = 'attachment') { 1050 log_app('function',"get_attachments($page, '$post_type')");1051 1009 $GLOBALS['post_type'] = $post_type; 1052 1010 $feed = $this->get_feed($page, $post_type); … … 1065 1023 function get_feed($page = 1, $post_type = 'post') { 1066 1024 global $post, $wp, $wp_query, $posts, $wpdb, $blog_id; 1067 log_app('function',"get_feed($page, '$post_type')");1068 1025 ob_start(); 1069 1026 … … 1085 1042 $wpdb = $GLOBALS['wpdb']; 1086 1043 $blog_id = (int) $GLOBALS['blog_id']; 1087 log_app('function',"query_posts(# " . print_r($wp_query, true) . "#)"); 1088 1089 log_app('function',"total_count(# $wp_query->max_num_pages #)"); 1044 1090 1045 $last_page = $wp_query->max_num_pages; 1091 1046 $next_page = (($page + 1) > $last_page) ? null : $page + 1; … … 1132 1087 */ 1133 1088 function get_entry($postID, $post_type = 'post') { 1134 log_app('function',"get_entry($postID, '$post_type')");1135 1089 ob_start(); 1136 1090 switch($post_type) { … … 1148 1102 the_post(); 1149 1103 $this->echo_entry(); 1150 log_app('$post',print_r($GLOBALS['post'],true));1151 1104 $entry = ob_get_contents(); 1152 1105 break; … … 1155 1108 ob_end_clean(); 1156 1109 1157 log_app('get_entry returning:',$entry);1158 1110 return $entry; 1159 1111 } … … 1206 1158 */ 1207 1159 function ok() { 1208 log_app('Status','200: OK');1209 1160 header('Content-Type: text/plain'); 1210 1161 status_header('200'); … … 1218 1169 */ 1219 1170 function no_content() { 1220 log_app('Status','204: No Content');1221 1171 header('Content-Type: text/plain'); 1222 1172 status_header('204'); … … 1233 1183 */ 1234 1184 function internal_error($msg = 'Internal Server Error') { 1235 log_app('Status','500: Server Error');1236 1185 header('Content-Type: text/plain'); 1237 1186 status_header('500'); … … 1246 1195 */ 1247 1196 function bad_request() { 1248 log_app('Status','400: Bad Request');1249 1197 header('Content-Type: text/plain'); 1250 1198 status_header('400'); … … 1258 1206 */ 1259 1207 function length_required() { 1260 log_app('Status','411: Length Required');1261 1208 header("HTTP/1.1 411 Length Required"); 1262 1209 header('Content-Type: text/plain'); … … 1271 1218 */ 1272 1219 function invalid_media() { 1273 log_app('Status','415: Unsupported Media Type');1274 1220 header("HTTP/1.1 415 Unsupported Media Type"); 1275 1221 header('Content-Type: text/plain'); … … 1283 1229 */ 1284 1230 function forbidden($reason='') { 1285 log_app('Status','403: Forbidden');1286 1231 header('Content-Type: text/plain'); 1287 1232 status_header('403'); … … 1296 1241 */ 1297 1242 function not_found() { 1298 log_app('Status','404: Not Found');1299 1243 header('Content-Type: text/plain'); 1300 1244 status_header('404'); … … 1308 1252 */ 1309 1253 function not_allowed($allow) { 1310 log_app('Status','405: Not Allowed');1311 1254 header('Allow: ' . join(',', $allow)); 1312 1255 status_header('405'); … … 1320 1263 */ 1321 1264 function redirect($url) { 1322 1323 log_app('Status','302: Redirect');1324 1265 $escaped_url = esc_attr($url); 1325 1266 $content = <<<EOD … … 1350 1291 */ 1351 1292 function client_error($msg = 'Client Error') { 1352 log_app('Status','400: Client Error');1353 1293 header('Content-Type: text/plain'); 1354 1294 status_header('400'); … … 1364 1304 */ 1365 1305 function created($post_ID, $content, $post_type = 'post') { 1366 log_app('created()::$post_ID',"$post_ID, $post_type");1367 1306 $edit = $this->get_entry_url($post_ID); 1368 1307 switch($post_type) { … … 1391 1330 */ 1392 1331 function auth_required($msg) { 1393 log_app('Status','401: Auth Required');1394 1332 nocache_headers(); 1395 1333 header('WWW-Authenticate: Basic realm="WordPress Atom Protocol"'); … … 1432 1370 if ($this->do_output) 1433 1371 echo $xml; 1434 log_app('function', "output:\n$xml");1435 1372 exit; 1436 1373 } … … 1465 1402 */ 1466 1403 function authenticate() { 1467 log_app("authenticate()",print_r($_ENV, true));1468 1469 1404 // if using mod_rewrite/ENV hack 1470 1405 // http://www.besthostratings.com/articles/http-auth-php-cgi.html … … 1481 1416 // If Basic Auth is working... 1482 1417 if (isset($_SERVER['PHP_AUTH_USER']) && isset($_SERVER['PHP_AUTH_PW'])) { 1483 log_app("Basic Auth",$_SERVER['PHP_AUTH_USER']);1484 1485 1418 $user = wp_authenticate($_SERVER['PHP_AUTH_USER'], $_SERVER['PHP_AUTH_PW']); 1486 1419 if ( $user && !is_wp_error($user) ) { 1487 1420 wp_set_current_user($user->ID); 1488 log_app("authenticate()", $user->user_login);1489 1421 return true; 1490 1422 } … … 1515 1447 list($type,$subtype) = explode('/',$type); 1516 1448 list($subtype) = explode(";",$subtype); // strip MIME parameters 1517 log_app("get_accepted_content_type", "type=$type, subtype=$subtype");1518 1449 1519 1450 foreach($types as $t) { -
trunk/wp-includes/class-wp-xmlrpc-server.php
r19914 r19935 2701 2701 $this->attach_uploads( $post_ID, $post_content ); 2702 2702 2703 logIO('O', "Posted ! ID: $post_ID");2704 2705 2703 return $post_ID; 2706 2704 } … … 3047 3045 if ( isset( $content_struct['categories'] ) ) { 3048 3046 $catnames = $content_struct['categories']; 3049 logIO('O', 'Post cats: ' . var_export($catnames,true));3050 3047 3051 3048 if ( is_array($catnames) ) { … … 3088 3085 if ( !$post_ID ) 3089 3086 return new IXR_Error(500, __('Sorry, your entry could not be posted. Something wrong happened.')); 3090 3091 logIO('O', "Posted ! ID: $post_ID");3092 3087 3093 3088 return strval($post_ID); … … 3381 3376 if ( isset( $content_struct['wp_post_format'] ) ) 3382 3377 wp_set_post_terms( $post_ID, array( 'post-format-' . $content_struct['wp_post_format'] ), 'post_format' ); 3383 3384 logIO('O',"(MW) Edited ! ID: $post_ID");3385 3378 3386 3379 return true; … … 3696 3689 $bits = $data['bits']; 3697 3690 3698 logIO('O', '(MW) Received '.strlen($bits).' bytes');3699 3700 3691 if ( !$user = $this->login($username, $password) ) 3701 3692 return $this->error; … … 3704 3695 3705 3696 if ( !current_user_can('upload_files') ) { 3706 logIO('O', '(MW) User does not have upload_files capability');3707 3697 $this->error = new IXR_Error(401, __('You are not allowed to upload files to this site.')); 3708 3698 return $this->error; … … 3733 3723 if ( ! empty($upload['error']) ) { 3734 3724 $errorString = sprintf(__('Could not write file %1$s (%2$s)'), $name, $upload['error']); 3735 logIO('O', '(MW) ' . $errorString);3736 3725 return new IXR_Error(500, $errorString); 3737 3726 } … … 4120 4109 $post_ID = (int) $post_ID; 4121 4110 4122 logIO("O","(PB) URL='$pagelinkedto' ID='$post_ID' Found='$way'");4123 4124 4111 $post = get_post($post_ID); 4125 4112 -
trunk/wp-includes/class-wp.php
r19892 r19935 16 16 * @var array 17 17 */ 18 var $public_query_vars = array('m', 'p', 'posts', 'w', 'cat', 'withcomments', 'withoutcomments', 's', 'search', 'exact', 'sentence', ' debug', 'calendar', 'page', 'paged', 'more', 'tb', 'pb', 'author', 'order', 'orderby', 'year', 'monthnum', 'day', 'hour', 'minute', 'second', 'name', 'category_name', 'tag', 'feed', 'author_name', 'static', 'pagename', 'page_id', 'error', 'comments_popup', 'attachment', 'attachment_id', 'subpost', 'subpost_id', 'preview', 'robots', 'taxonomy', 'term', 'cpage', 'post_type');18 var $public_query_vars = array('m', 'p', 'posts', 'w', 'cat', 'withcomments', 'withoutcomments', 's', 'search', 'exact', 'sentence', 'calendar', 'page', 'paged', 'more', 'tb', 'pb', 'author', 'order', 'orderby', 'year', 'monthnum', 'day', 'hour', 'minute', 'second', 'name', 'category_name', 'tag', 'feed', 'author_name', 'static', 'pagename', 'page_id', 'error', 'comments_popup', 'attachment', 'attachment_id', 'subpost', 'subpost_id', 'preview', 'robots', 'taxonomy', 'term', 'cpage', 'post_type'); 19 19 20 20 /** -
trunk/wp-includes/deprecated.php
r19684 r19935 2565 2565 * 2566 2566 * @since 1.5.0 2567 * @deprecated 3.1 2567 * @deprecated 3.1.0 2568 2568 * @deprecated Use global $plugin_page and/or get_plugin_page_hookname() hooks. 2569 2569 * … … 2591 2591 * 2592 2592 * @since 1.5.0 2593 * @deprecated 3.1 2593 * @deprecated 3.1.0 2594 2594 * 2595 2595 * @return bool Always return True … … 2605 2605 * 2606 2606 * @since 2.9.0 2607 * @deprecated 3.2 2607 * @deprecated 3.2.0 2608 2608 * 2609 2609 * @return bool … … 2619 2619 * 2620 2620 * @since 2.1.0 2621 * @deprecated 3.3 2621 * @deprecated 3.3.0 2622 * @deprecated Use wp_editor() 2623 * @see wp_editor() 2622 2624 * 2623 2625 * @param string $content Textarea content. … … 2628 2630 */ 2629 2631 function the_editor($content, $id = 'content', $prev_id = 'title', $media_buttons = true, $tab_index = 2, $extended = true) { 2632 _deprecated_function( __FUNCTION__, '3.3', 'wp_editor()' ); 2630 2633 2631 2634 wp_editor( $content, $id, array( 'media_buttons' => $media_buttons ) ); … … 2637 2640 * 2638 2641 * @since 3.0.0 2642 * @deprecated 3.3.0 2643 * 2639 2644 * @param array $ids User ID numbers list. 2640 2645 * @return array of arrays. The array is indexed by user_id, containing $metavalues object arrays. … … 2669 2674 * @since 2.3.0 2670 2675 * @deprecated 3.3.0 2671 * @uses sanitize_user_field() Used to sanitize the fields.2672 2676 * 2673 2677 * @param object|array $user The User Object or Array … … 2706 2710 * 2707 2711 * @since 2.8.0 2708 * @deprecated 3.3 2712 * @deprecated 3.3.0 2709 2713 * 2710 2714 * @param string $title Optional. Link title format. … … 2746 2750 * 2747 2751 * @since 2.8.0 2748 * @deprecated 3.3 2752 * @deprecated 3.3.0 2749 2753 * 2750 2754 * @param string $title Optional. Link title format. … … 2762 2766 * 2763 2767 * @since 2.8.0 2764 * @deprecated 3.3 2768 * @deprecated 3.3.0 2765 2769 * 2766 2770 * @return string … … 2777 2781 * 2778 2782 * @since 2.8.0 2779 * @deprecated 3.3 2783 * @deprecated 3.3.0 2780 2784 */ 2781 2785 function index_rel_link() { … … 2789 2793 * 2790 2794 * @since 2.8.0 2791 * @deprecated 3.3 2795 * @deprecated 3.3.0 2792 2796 * 2793 2797 * @param string $title Optional. Link title format. … … 2820 2824 * 2821 2825 * @since 2.8.0 2822 * @deprecated 3.3 2826 * @deprecated 3.3.0 2823 2827 */ 2824 2828 function parent_post_rel_link($title = '%title') { … … 2832 2836 * 2833 2837 * @since 3.2.0 2834 * @deprecated 3.3 2838 * @deprecated 3.3.0 2835 2839 */ 2836 2840 function wp_admin_bar_dashboard_view_site_menu( $wp_admin_bar ) { … … 2853 2857 * 2854 2858 * @since MU 2855 * @deprecated 3.3 2859 * @deprecated 3.3.0 2856 2860 * @deprecated Use is_user_member_of_blog() 2857 2861 * @see is_user_member_of_blog() … … 2865 2869 return is_user_member_of_blog( get_current_user_id(), $blog_id ); 2866 2870 } 2871 2872 /** 2873 * Open the file handle for debugging. 2874 * 2875 * @since 0.71 2876 * @deprecated Use error_log() 2877 * @link http://www.php.net/manual/en/function.error-log.php 2878 * @deprecated 3.4.0 2879 */ 2880 function debug_fopen( $filename, $mode ) { 2881 _deprecated_function( __FUNCTION__, 'error_log()' ); 2882 return false; 2883 } 2884 2885 /** 2886 * Write contents to the file used for debugging. 2887 * 2888 * @since 0.71 2889 * @deprecated Use error_log() instead. 2890 * @link http://www.php.net/manual/en/function.error-log.php 2891 * @deprecated 3.4.0 2892 */ 2893 function debug_fwrite( $fp, $string ) { 2894 _deprecated_function( __FUNCTION__, 'error_log()' ); 2895 if ( ! empty( $GLOBALS['debug'] ) ) 2896 error_log( $string ); 2897 } 2898 2899 /** 2900 * Close the debugging file handle. 2901 * 2902 * @since 0.71 2903 * @deprecated Use error_log() 2904 * @link http://www.php.net/manual/en/function.error-log.php 2905 * @deprecated 3.4.0 2906 */ 2907 function debug_fclose( $fp ) { 2908 _deprecated_function( __FUNCTION__, 'error_log()' ); 2909 } -
trunk/wp-includes/functions.php
r19923 r19935 396 396 397 397 /** 398 * Open the file handle for debugging.399 *400 * This function is used for XMLRPC feature, but it is general purpose enough401 * to be used in anywhere.402 *403 * @see fopen() for mode options.404 * @package WordPress405 * @subpackage Debug406 * @since 0.71407 * @uses $debug Used for whether debugging is enabled.408 *409 * @param string $filename File path to debug file.410 * @param string $mode Same as fopen() mode parameter.411 * @return bool|resource File handle. False on failure.412 */413 function debug_fopen( $filename, $mode ) {414 global $debug;415 if ( 1 == $debug ) {416 $fp = fopen( $filename, $mode );417 return $fp;418 } else {419 return false;420 }421 }422 423 /**424 * Write contents to the file used for debugging.425 *426 * Technically, this can be used to write to any file handle when the global427 * $debug is set to 1 or true.428 *429 * @package WordPress430 * @subpackage Debug431 * @since 0.71432 * @uses $debug Used for whether debugging is enabled.433 *434 * @param resource $fp File handle for debugging file.435 * @param string $string Content to write to debug file.436 */437 function debug_fwrite( $fp, $string ) {438 global $debug;439 if ( 1 == $debug )440 fwrite( $fp, $string );441 }442 443 /**444 * Close the debugging file handle.445 *446 * Technically, this can be used to close any file handle when the global $debug447 * is set to 1 or true.448 *449 * @package WordPress450 * @subpackage Debug451 * @since 0.71452 * @uses $debug Used for whether debugging is enabled.453 *454 * @param resource $fp Debug File handle.455 */456 function debug_fclose( $fp ) {457 global $debug;458 if ( 1 == $debug )459 fclose( $fp );460 }461 462 /**463 398 * Check content for video and audio links to add as enclosures. 464 399 * … … 481 416 include_once( ABSPATH . WPINC . '/class-IXR.php' ); 482 417 483 $log = debug_fopen( ABSPATH . 'enclosures.log', 'a' );484 418 $post_links = array(); 485 debug_fwrite( $log, 'BEGIN ' . date( 'YmdHis', time() ) . "\n" );486 419 487 420 $pung = get_enclosed( $post_ID ); … … 493 426 494 427 preg_match_all( "{\b http : [$any] +? (?= [$punc] * [^$any] | $)}x", $content, $post_links_temp ); 495 496 debug_fwrite( $log, 'Post contents:' );497 debug_fwrite( $log, $content . "\n" );498 428 499 429 foreach ( $pung as $link_test ) { -
trunk/xmlrpc.php
r19801 r19935 55 55 include_once(ABSPATH . WPINC . '/class-wp-xmlrpc-server.php'); 56 56 57 // Turn off all warnings and errors.58 // error_reporting(0);59 60 57 /** 61 58 * Posts submitted via the xmlrpc interface get that title … … 65 62 $post_default_title = ""; 66 63 67 /**68 * Whether to enable XMLRPC Logging.69 *70 * @name xmlrpc_logging71 * @var int|bool72 */73 $xmlrpc_logging = 0;74 75 /**76 * logIO() - Writes logging info to a file.77 *78 * @uses $xmlrpc_logging79 * @package WordPress80 * @subpackage Logging81 *82 * @param string $io Whether input or output83 * @param string $msg Information describing logging reason.84 * @return bool Always return true85 */86 function logIO($io,$msg) {87 global $xmlrpc_logging;88 if ($xmlrpc_logging) {89 $fp = fopen("../xmlrpc.log","a+");90 $date = gmdate("Y-m-d H:i:s ");91 $iot = ($io == "I") ? " Input: " : " Output: ";92 fwrite($fp, "\n\n".$date.$iot.$msg);93 fclose($fp);94 }95 return true;96 }97 98 if ( isset($HTTP_RAW_POST_DATA) )99 logIO("I", $HTTP_RAW_POST_DATA);100 101 64 // Allow for a plugin to insert a different class to handle requests. 102 65 $wp_xmlrpc_server_class = apply_filters('wp_xmlrpc_server_class', 'wp_xmlrpc_server'); … … 105 68 // Fire off the request 106 69 $wp_xmlrpc_server->serve_request(); 70 71 exit; 72 73 /** 74 * logIO() - Writes logging info to a file. 75 * 76 * @deprecated 3.4.0 77 * @deprecated Use error_log() 78 * 79 * @param string $io Whether input or output 80 * @param string $msg Information describing logging reason. 81 */ 82 function logIO( $io, $msg ) { 83 _deprecated_function( __FUNCTION__, '3.4', 'error_log()' ); 84 if ( ! empty( $GLOBALS['xmlrpc_logging'] ) ) 85 error_log( $io . ' - ' . $msg ); 86 }
Note: See TracChangeset
for help on using the changeset viewer.