- Timestamp:
- 10/03/2017 03:43:01 AM (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/customize/class-wp-customize-nav-menu-item-setting.php
r41162 r41697 642 642 * 643 643 * @param array $menu_item_value The value to sanitize. 644 * @return array|false|null Nullif an input isn't valid. False if it is marked for deletion.645 * Otherwise the sanitized value.644 * @return array|false|null|WP_Error Null or WP_Error if an input isn't valid. False if it is marked for deletion. 645 * Otherwise the sanitized value. 646 646 */ 647 647 public function sanitize( $menu_item_value ) { … … 702 702 $menu_item_value['description'] = wp_unslash( apply_filters( 'content_save_pre', wp_slash( $menu_item_value['description'] ) ) ); 703 703 704 $menu_item_value['url'] = esc_url_raw( $menu_item_value['url'] ); 704 if ( '' !== $menu_item_value['url'] ) { 705 $menu_item_value['url'] = esc_url_raw( $menu_item_value['url'] ); 706 if ( '' === $menu_item_value['url'] ) { 707 return new WP_Error( 'invalid_url', __( 'Invalid URL.' ) ); // Fail sanitization if URL is invalid. 708 } 709 } 705 710 if ( 'publish' !== $menu_item_value['status'] ) { 706 711 $menu_item_value['status'] = 'draft';
Note: See TracChangeset
for help on using the changeset viewer.