- Timestamp:
- 02/15/2018 03:52:40 PM (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/bp-templates/bp-legacy/buddypress-functions.php
r11821 r11858 780 780 */ 781 781 function bp_legacy_theme_object_template_loader() { 782 // Bail if not a POST action.783 if ( 'POST' !== strtoupper( $_SERVER['REQUEST_METHOD'] ) )784 return;782 if ( ! bp_is_post_request() ) { 783 return; 784 } 785 785 786 786 // Bail if no object passed. 787 if ( empty( $_POST['object'] ) ) 788 return; 787 if ( empty( $_POST['object'] ) ) { 788 return; 789 } 789 790 790 791 // Sanitize the object. … … 792 793 793 794 // Bail if object is not an active component to prevent arbitrary file inclusion. 794 if ( ! bp_is_active( $object ) ) 795 return; 795 if ( ! bp_is_active( $object ) ) { 796 return; 797 } 796 798 797 799 /** … … 860 862 */ 861 863 function bp_legacy_theme_activity_template_loader() { 862 // Bail if not a POST action.863 if ( 'POST' !== strtoupper( $_SERVER['REQUEST_METHOD'] ) )864 return;864 if ( ! bp_is_post_request() ) { 865 return; 866 } 865 867 866 868 $scope = ''; … … 921 923 $bp = buddypress(); 922 924 923 // Bail if not a POST action.924 if ( 'POST' !== strtoupper( $_SERVER['REQUEST_METHOD'] ) )925 return;925 if ( ! bp_is_post_request() ) { 926 return; 927 } 926 928 927 929 // Check the nonce. … … 1010 1012 $bp = buddypress(); 1011 1013 1012 // Bail if not a POST action. 1013 if ( 'POST' !== strtoupper( $_SERVER['REQUEST_METHOD'] ) ) { 1014 if ( ! bp_is_post_request() ) { 1014 1015 return; 1015 1016 } … … 1079 1080 */ 1080 1081 function bp_legacy_theme_delete_activity() { 1081 // Bail if not a POST action.1082 if ( 'POST' !== strtoupper( $_SERVER['REQUEST_METHOD'] ) )1083 return;1082 if ( ! bp_is_post_request() ) { 1083 return; 1084 } 1084 1085 1085 1086 // Check the nonce. … … 1117 1118 */ 1118 1119 function bp_legacy_theme_delete_activity_comment() { 1119 // Bail if not a POST action.1120 if ( 'POST' !== strtoupper( $_SERVER['REQUEST_METHOD'] ) )1121 return;1120 if ( ! bp_is_post_request() ) { 1121 return; 1122 } 1122 1123 1123 1124 // Check the nonce. … … 1159 1160 $bp = buddypress(); 1160 1161 1161 // Bail if not a POST action.1162 if ( 'POST' !== strtoupper( $_SERVER['REQUEST_METHOD'] ) )1163 return;1162 if ( ! bp_is_post_request() ) { 1163 return; 1164 } 1164 1165 1165 1166 // Check that user is logged in, Activity Streams are enabled, and Akismet is present. … … 1204 1205 function bp_legacy_theme_mark_activity_favorite() { 1205 1206 // Bail if not a POST action. 1206 if ( 'POST' !== strtoupper( $_SERVER['REQUEST_METHOD'] ) ) 1207 return; 1207 if ( ! bp_is_post_request() ) { 1208 return; 1209 } 1208 1210 1209 1211 if ( ! isset( $_POST['nonce'] ) ) { … … 1233 1235 */ 1234 1236 function bp_legacy_theme_unmark_activity_favorite() { 1235 // Bail if not a POST action.1236 if ( 'POST' !== strtoupper( $_SERVER['REQUEST_METHOD'] ) )1237 return;1237 if ( ! bp_is_post_request() ) { 1238 return; 1239 } 1238 1240 1239 1241 if ( ! isset( $_POST['nonce'] ) ) { … … 1264 1266 */ 1265 1267 function bp_legacy_theme_get_single_activity_content() { 1266 // Bail if not a POST action.1267 if ( 'POST' !== strtoupper( $_SERVER['REQUEST_METHOD'] ) )1268 return;1268 if ( ! bp_is_post_request() ) { 1269 return; 1270 } 1269 1271 1270 1272 $activity_array = bp_activity_get_specific( array( … … 1304 1306 */ 1305 1307 function bp_legacy_theme_ajax_invite_user() { 1306 // Bail if not a POST action.1307 if ( 'POST' !== strtoupper( $_SERVER['REQUEST_METHOD'] ) )1308 return;1308 if ( ! bp_is_post_request() ) { 1309 return; 1310 } 1309 1311 1310 1312 check_ajax_referer( 'groups_invite_uninvite_user' ); … … 1387 1389 */ 1388 1390 function bp_legacy_theme_ajax_addremove_friend() { 1389 1390 // Bail if not a POST action. 1391 if ( 'POST' !== strtoupper( $_SERVER['REQUEST_METHOD'] ) ) 1392 return; 1391 if ( ! bp_is_post_request() ) { 1392 return; 1393 } 1393 1394 1394 1395 // Cast fid as an integer. … … 1441 1442 */ 1442 1443 function bp_legacy_theme_ajax_accept_friendship() { 1443 // Bail if not a POST action.1444 if ( 'POST' !== strtoupper( $_SERVER['REQUEST_METHOD'] ) )1445 return;1444 if ( ! bp_is_post_request() ) { 1445 return; 1446 } 1446 1447 1447 1448 check_admin_referer( 'friends_accept_friendship' ); … … 1461 1462 */ 1462 1463 function bp_legacy_theme_ajax_reject_friendship() { 1463 // Bail if not a POST action.1464 if ( 'POST' !== strtoupper( $_SERVER['REQUEST_METHOD'] ) )1465 return;1464 if ( ! bp_is_post_request() ) { 1465 return; 1466 } 1466 1467 1467 1468 check_admin_referer( 'friends_reject_friendship' ); … … 1481 1482 */ 1482 1483 function bp_legacy_theme_ajax_joinleave_group() { 1483 // Bail if not a POST action.1484 if ( 'POST' !== strtoupper( $_SERVER['REQUEST_METHOD'] ) )1485 return;1484 if ( ! bp_is_post_request() ) { 1485 return; 1486 } 1486 1487 1487 1488 // Cast gid as integer. … … 1552 1553 */ 1553 1554 function bp_legacy_theme_ajax_close_notice() { 1554 // Bail if not a POST action.1555 if ( 'POST' !== strtoupper( $_SERVER['REQUEST_METHOD'] ) )1556 return;1555 if ( ! bp_is_post_request() ) { 1556 return; 1557 } 1557 1558 1558 1559 $nonce_check = isset( $_POST['nonce'] ) && wp_verify_nonce( wp_unslash( $_POST['nonce'] ), 'bp_messages_close_notice' ); … … 1584 1585 */ 1585 1586 function bp_legacy_theme_ajax_messages_send_reply() { 1586 // Bail if not a POST action.1587 if ( 'POST' !== strtoupper( $_SERVER['REQUEST_METHOD'] ) )1588 return;1587 if ( ! bp_is_post_request() ) { 1588 return; 1589 } 1589 1590 1590 1591 check_ajax_referer( 'messages_send_message' );
Note: See TracChangeset
for help on using the changeset viewer.