Changeset 5764
- Timestamp:
- 08/07/2017 07:45:31 PM (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sites/trunk/wordpress.org/public_html/wp-content/plugins/support-forums/inc/class-hooks.php
r5757 r5764 377 377 */ 378 378 public function display_extra_topic_fields() { 379 $site_url = get_post_meta( bbp_get_topic_id(), self::SITE_URL_META, true ); 380 379 381 // Display site URL for logged-in users. 380 if ( is_user_logged_in() ) { 381 $site_url = get_post_meta( bbp_get_topic_id(), self::SITE_URL_META, true ); 382 382 if ( is_user_logged_in() && $site_url ) { 383 383 printf( '<p>%1$s <a href="%2$s" rel="nofollow">%2$s</a></p>', 384 384 __( 'Site URL:', 'wporg-forums' ), … … 411 411 $site_url = esc_url_raw( apply_filters( 'pre_user_url', $_POST['site_url'] ) ); 412 412 413 $protocols = implode( '|', array( 'http', 'https' ) ); 414 if ( ! preg_match( '/^(' . $protocols . '):/is', $site_url ) ) { 415 $site_url = 'http://' . $site_url; 413 if ( $site_url ) { 414 $protocols = implode( '|', array( 'http', 'https' ) ); 415 if ( ! preg_match( '/^(' . $protocols . '):/is', $site_url ) ) { 416 $site_url = 'http://' . $site_url; 417 } 418 419 update_post_meta( $topic_id, self::SITE_URL_META, $site_url ); 420 } elseif ( 'bbp_edit_topic' === current_action() ) { 421 delete_post_meta( $topic_id, self::SITE_URL_META ); 416 422 } 417 418 update_post_meta( $topic_id, self::SITE_URL_META, $site_url );419 423 } 420 424 }
Note: See TracChangeset
for help on using the changeset viewer.