PluginProbe
Woody Code Snippets – Insert PHP, CSS, JS, and Header/Footer Scripts / trunk
Woody Code Snippets – Insert PHP, CSS, JS, and Header/Footer Scripts vtrunk
2.7.7 2.7.6 2.7.5 2.7.4 trunk 1.3 2.0.4 2.0.6 2.1.91 2.2.4 2.2.7 2.2.9 2.3.1 2.3.10 2.4.10 2.4.2 2.4.4 2.4.5 2.4.6 2.4.7 2.4.8 2.4.9 2.6.0 2.6.1 2.7.0 All 28 releases
← All changes | includes/class.helpers.php +5 -1 2.7.4trunk View file →
@@ -131,9 +131,9 @@
131 131 $tag_names = [ 'id' ];
132 132 $snippet_type = self::get_snippet_type( $snippet->ID );
133 133
134 134 $available_tags = self::getMetaOption( $snippet->ID, 'snippet_tags' );
135 - $available_tags = trim( rtrim( $available_tags ) );
135 + $available_tags = ! empty( $available_tags ) ? trim( rtrim( $available_tags ) ) : '';
136 136
137 137 if ( ! empty( $available_tags ) ) {
138 138 $available_tags = array_map( 'trim', explode( ',', $available_tags ) );
139 139 $available_tags = array_unique( $available_tags );
@@ -234,8 +234,12 @@
234 234
235 235 // (#3)
236 236 $rest_url = wp_parse_url( site_url( $prefix ) );
237 237 $current_url = wp_parse_url( esc_url( add_query_arg( [] ) ) );
238 +
239 + if ( empty( $rest_url['path'] ) || empty( $current_url['path'] ) ) {
240 + return false;
241 + }
238 242
239 243 return strpos( $current_url['path'], $rest_url['path'], 0 ) === 0;
240 244 }
241 245