Changeset 5559
- Timestamp:
- 11/10/2014 06:09:14 PM (10 years ago)
- Location:
- trunk/src/includes
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/includes/common/formatting.php
r5553 r5559 83 83 */ 84 84 function bbp_filter_kses( $data = '' ) { 85 return addslashes( wp_kses( stripslashes( $data ), bbp_kses_allowed_tags() ) );85 return wp_slash( wp_kses( wp_unslash( $data ), bbp_kses_allowed_tags() ) ); 86 86 } 87 87 -
trunk/src/includes/common/functions.php
r5488 r5559 702 702 // @see: http://bbpress.trac.wordpress.org/ticket/2185/ 703 703 // @see: http://core.trac.wordpress.org/changeset/23973/ 704 $r = function_exists( 'wp_unslash' ) ? wp_unslash( $r ) : stripslashes_deep( $r );704 $r = wp_unslash( $r ); 705 705 706 706 // Prepare duplicate check query -
trunk/src/includes/common/template.php
r5485 r5559 1298 1298 case 'text' : 1299 1299 case 'textarea' : 1300 $retval = esc_attr( stripslashes( $pre_ret_val ) );1300 $retval = esc_attr( wp_unslash( $pre_ret_val ) ); 1301 1301 break; 1302 1302 -
trunk/src/includes/core/filters.php
r5558 r5559 124 124 add_filter( 'bbp_edit_forum_pre_content', 'balanceTags', 40 ); 125 125 126 // No follow and stripslasheson user profile links126 // No follow and wp_unslash on user profile links 127 127 add_filter( 'bbp_get_reply_author_link', 'bbp_rel_nofollow' ); 128 add_filter( 'bbp_get_reply_author_link', ' stripslashes');128 add_filter( 'bbp_get_reply_author_link', 'wp_unslash' ); 129 129 add_filter( 'bbp_get_topic_author_link', 'bbp_rel_nofollow' ); 130 add_filter( 'bbp_get_topic_author_link', ' stripslashes');130 add_filter( 'bbp_get_topic_author_link', 'wp_unslash' ); 131 131 add_filter( 'bbp_get_user_favorites_link', 'bbp_rel_nofollow' ); 132 add_filter( 'bbp_get_user_favorites_link', ' stripslashes');132 add_filter( 'bbp_get_user_favorites_link', 'wp_unslash' ); 133 133 add_filter( 'bbp_get_user_subscribe_link', 'bbp_rel_nofollow' ); 134 add_filter( 'bbp_get_user_subscribe_link', ' stripslashes');134 add_filter( 'bbp_get_user_subscribe_link', 'wp_unslash' ); 135 135 add_filter( 'bbp_get_user_profile_link', 'bbp_rel_nofollow' ); 136 add_filter( 'bbp_get_user_profile_link', ' stripslashes');136 add_filter( 'bbp_get_user_profile_link', 'wp_unslash' ); 137 137 add_filter( 'bbp_get_user_profile_edit_link', 'bbp_rel_nofollow' ); 138 add_filter( 'bbp_get_user_profile_edit_link', ' stripslashes');138 add_filter( 'bbp_get_user_profile_edit_link', 'wp_unslash' ); 139 139 140 140 // Run filters on reply content … … 176 176 add_filter( 'bbp_get_form_topic_edit_reason', 'esc_attr' ); 177 177 add_filter( 'bbp_get_form_topic_edit_reason', 'trim' ); 178 add_filter( 'bbp_get_form_topic_title', 'esc_attr' ); 179 add_filter( 'bbp_get_form_topic_title', 'trim' ); 180 add_filter( 'bbp_get_form_topic_tags', 'esc_attr' ); 181 add_filter( 'bbp_get_form_topic_tags', 'trim' ); 178 182 179 183 // Add number format filter to functions requiring numeric output -
trunk/src/includes/extend/akismet.php
r5466 r5559 395 395 // Ready... 396 396 foreach ( $post_data as $key => $data ) { 397 $query_string .= $key . '=' . urlencode( stripslashes( $data ) ) . '&';397 $query_string .= $key . '=' . urlencode( wp_unslash( $data ) ) . '&'; 398 398 } 399 399 … … 626 626 627 627 // Preload required variables 628 $bbp_version = bbp_get_version(); 629 $content_length = strlen( $request ); 630 $http_host = $host; 631 $blog_charset = get_option( 'blog_charset' ); 632 $response = ''; 633 $errno = null; 634 $errstr = null; 628 $bbp_version = bbp_get_version(); 629 $http_host = $host; 630 $blog_charset = get_option( 'blog_charset' ); 631 $response = ''; 635 632 636 633 // Untque User Agent … … 643 640 } 644 641 645 // WP HTTP class is available 646 if ( function_exists( 'wp_remote_post' ) ) { 647 648 // Setup the arguments 649 $http_args = array( 650 'body' => $request, 651 'headers' => array( 652 'Content-Type' => 'application/x-www-form-urlencoded; charset=' . $blog_charset, 653 'Host' => $host, 654 'User-Agent' => $akismet_ua 655 ), 656 'httpversion' => '1.0', 657 'timeout' => 15 658 ); 659 660 // Where we are sending our request 661 $akismet_url = 'http://' . $http_host . $path; 662 663 // Send the request 664 $response = wp_remote_post( $akismet_url, $http_args ); 665 666 // Bail if the response is an error 667 if ( is_wp_error( $response ) ) { 668 return ''; 669 } 670 671 // No errors so return response 672 return array( $response['headers'], $response['body'] ); 673 674 // WP HTTP class is not available (Why not?) 675 } else { 676 677 // Header info to use with our socket 678 $http_request = "POST {$path} HTTP/1.0\r\n"; 679 $http_request .= "Host: {$host}\r\n"; 680 $http_request .= "Content-Type: application/x-www-form-urlencoded; charset={$blog_charset}\r\n"; 681 $http_request .= "Content-Length: {$content_length}\r\n"; 682 $http_request .= "User-Agent: {$akismet_ua}\r\n"; 683 $http_request .= "\r\n"; 684 $http_request .= $request; 685 686 // Open a socket connection 687 if ( false !== ( $fs = @fsockopen( $http_host, $port, $errno, $errstr, 10 ) ) ) { 688 689 // Write our request to the pointer 690 fwrite( $fs, $http_request ); 691 692 // Loop through pointer and compile a response 693 while ( !feof( $fs ) ) { 694 // One TCP-IP packet at a time 695 $response .= fgets( $fs, 1160 ); 696 } 697 698 // Close our socket 699 fclose( $fs ); 700 701 // Explode the response into usable data 702 $response = explode( "\r\n\r\n", $response, 2 ); 703 } 704 705 // Return the response ('' if error/empty) 706 return $response; 707 } 642 // Setup the arguments 643 $http_args = array( 644 'body' => $request, 645 'headers' => array( 646 'Content-Type' => 'application/x-www-form-urlencoded; charset=' . $blog_charset, 647 'Host' => $host, 648 'User-Agent' => $akismet_ua 649 ), 650 'httpversion' => '1.0', 651 'timeout' => 15 652 ); 653 654 // Where we are sending our request 655 $akismet_url = 'http://' . $http_host . $path; 656 657 // Send the request 658 $response = wp_remote_post( $akismet_url, $http_args ); 659 660 // Bail if the response is an error 661 if ( is_wp_error( $response ) ) { 662 return ''; 663 } 664 665 // No errors so return response 666 return array( $response['headers'], $response['body'] ); 708 667 } 709 668 -
trunk/src/includes/forums/template.php
r5558 r5559 2223 2223 // Get _POST data 2224 2224 if ( bbp_is_forum_form_post_request() && isset( $_POST['bbp_forum_content'] ) ) { 2225 $forum_content = stripslashes( $_POST['bbp_forum_content'] );2225 $forum_content = wp_unslash( $_POST['bbp_forum_content'] ); 2226 2226 2227 2227 // Get edit data -
trunk/src/includes/replies/template.php
r5558 r5559 2553 2553 // Get _POST data 2554 2554 if ( bbp_is_reply_form_post_request() && isset( $_POST['bbp_reply_content'] ) ) { 2555 $reply_content = stripslashes( $_POST['bbp_reply_content'] );2555 $reply_content = wp_unslash( $_POST['bbp_reply_content'] ); 2556 2556 2557 2557 // Get edit data … … 2748 2748 // Get _POST data 2749 2749 if ( bbp_is_reply_form_post_request() && isset( $_POST['bbp_reply_edit_reason'] ) ) { 2750 $reply_edit_reason = stripslashes( $_POST['bbp_reply_edit_reason'] );2750 $reply_edit_reason = wp_unslash( $_POST['bbp_reply_edit_reason'] ); 2751 2751 2752 2752 // No data -
trunk/src/includes/topics/template.php
r5558 r5559 3850 3850 // Get _POST data 3851 3851 if ( bbp_is_topic_form_post_request() && isset( $_POST['bbp_topic_title'] ) ) { 3852 $topic_title = stripslashes( $_POST['bbp_topic_title'] );3852 $topic_title = wp_unslash( $_POST['bbp_topic_title'] ); 3853 3853 3854 3854 // Get edit data … … 3861 3861 } 3862 3862 3863 return apply_filters( 'bbp_get_form_topic_title', esc_attr( $topic_title ));3863 return apply_filters( 'bbp_get_form_topic_title', $topic_title ); 3864 3864 } 3865 3865 … … 3887 3887 // Get _POST data 3888 3888 if ( bbp_is_topic_form_post_request() && isset( $_POST['bbp_topic_content'] ) ) { 3889 $topic_content = stripslashes( $_POST['bbp_topic_content'] );3889 $topic_content = wp_unslash( $_POST['bbp_topic_content'] ); 3890 3890 3891 3891 // Get edit data … … 3934 3934 // Get _POST data 3935 3935 if ( ( bbp_is_topic_form_post_request() || bbp_is_reply_form_post_request() ) && isset( $_POST['bbp_topic_tags'] ) ) { 3936 $topic_tags = stripslashes( $_POST['bbp_topic_tags'] );3936 $topic_tags = wp_unslash( $_POST['bbp_topic_tags'] ); 3937 3937 3938 3938 // Get edit data … … 3990 3990 } 3991 3991 3992 return apply_filters( 'bbp_get_form_topic_tags', esc_attr( $topic_tags ));3992 return apply_filters( 'bbp_get_form_topic_tags', $topic_tags ); 3993 3993 } 3994 3994 … … 4148 4148 // Get _POST data 4149 4149 if ( bbp_is_topic_form_post_request() && isset( $_POST['bbp_topic_edit_reason'] ) ) { 4150 $topic_edit_reason = stripslashes( $_POST['bbp_topic_edit_reason'] );4150 $topic_edit_reason = wp_unslash( $_POST['bbp_topic_edit_reason'] ); 4151 4151 4152 4152 // No data
Note: See TracChangeset
for help on using the changeset viewer.