PluginProbe
Responsive Menu – Mobile Menu & Hamburger Menu Builder / 4.7.4
Responsive Menu – Mobile Menu & Hamburger Menu Builder v4.7.4
4.7.4 4.7.3 3.1.5 3.1.6 3.1.7 3.1.8 3.1.9 4.0.0 4.0.1 4.0.2 4.0.3 4.0.4 4.1.0 4.1.1 4.1.10 4.1.11 4.1.12 4.1.2 4.1.3 4.1.4 4.1.5 4.1.6 4.1.7 4.1.8 4.1.9 All 91 releases
← All changes | v4.0.0/inc/classes/class-plugin.php +10 -2 4.1.9 → 4.7.4 View file →
@@ -77,9 +77,13 @@
77 77
78 78 // Check post type.
79 79 $post_type = get_post_type();
80 80 if ( empty( $post_type ) && ! empty( $_GET['post_type'] ) ) {
81 - $post_type = intval( $_GET['post_type'] );
81 + // A post type is a slug, not a number: intval() made this always 0.
82 + // is_scalar() because ?post_type[]=x would otherwise reach strtolower( array ).
83 + $post_type = is_scalar( $_GET['post_type'] ) // phpcs:ignore WordPress.Security.NonceVerification.Recommended
84 + ? sanitize_key( wp_unslash( $_GET['post_type'] ) ) // phpcs:ignore WordPress.Security.NonceVerification.Recommended
85 + : '';
82 86 }
83 87
84 88 if ( 'rmp_menu' !== $post_type || ! empty( $_GET['page'] ) ) {
85 89 return;
@@ -134,9 +138,13 @@
134 138 */
135 139 public function rmp_upgrade_pro_admin_notice() {
136 140 $post_type = get_post_type();
137 141 if ( empty( $post_type ) && ! empty( $_GET['post_type'] ) ) {
138 - $post_type = intval( $_GET['post_type'] );
142 + // A post type is a slug, not a number: intval() made this always 0.
143 + // is_scalar() because ?post_type[]=x would otherwise reach strtolower( array ).
144 + $post_type = is_scalar( $_GET['post_type'] ) // phpcs:ignore WordPress.Security.NonceVerification.Recommended
145 + ? sanitize_key( wp_unslash( $_GET['post_type'] ) ) // phpcs:ignore WordPress.Security.NonceVerification.Recommended
146 + : '';
139 147 }
140 148
141 149 if ( 'rmp_menu' !== $post_type ) {
142 150 return;