- Timestamp:
- 03/15/2023 08:16:46 AM (23 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/bp-activity/classes/class-bp-activity-oembed-extension.php
r13433 r13436 86 86 protected function validate_url_to_item_id( $url ) { 87 87 if ( bp_core_enable_root_profiles() ) { 88 $domain = bp_get_root_ domain();88 $domain = bp_get_root_url(); 89 89 } else { 90 90 $domain = bp_get_members_directory_permalink(); … … 96 96 } 97 97 98 // Check for activity slug. 99 if ( false === strpos( $url, '/' . bp_get_activity_slug() . '/' ) ) { 100 return false; 101 } 102 103 // Do more checks. 104 $url = trim( untrailingslashit( $url ) ); 105 106 // Grab the activity ID. 107 $activity_id = (int) substr( 108 $url, 109 strrpos( $url, '/' ) + 1 110 ); 98 if ( ! bp_has_pretty_urls() ) { 99 $url_query = wp_parse_url( $url, PHP_URL_QUERY ); 100 101 if ( $url_query ) { 102 $query_vars = bp_parse_args( $url_query, array() ); 103 104 if ( isset( $query_vars['bp_member_action'] ) ) { 105 $activity_id = (int) $query_vars['bp_member_action']; 106 } 107 } 108 109 } elseif ( false !== strpos( $url, '/' . bp_get_activity_slug() . '/' ) ) { 110 // Do more checks. 111 $url = trim( untrailingslashit( $url ) ); 112 113 // Grab the activity ID. 114 $activity_id = (int) substr( 115 $url, 116 strrpos( $url, '/' ) + 1 117 ); 118 } 111 119 112 120 if ( ! empty( $activity_id ) ) {
Note: See TracChangeset
for help on using the changeset viewer.