PluginProbe
aBlocks – Gutenberg Blocks, User Dashboard Builder, Popup Builder, Form Builder & Animation Builder / 2.13.1
aBlocks – Gutenberg Blocks, User Dashboard Builder, Popup Builder, Form Builder & Animation Builder v2.13.1
2.13.0 2.13.1 2.12.0 2.11.1 2.11.0 2.10.0 2.9.0 2.7.4 2.7.5 2.7.6 2.7.7 2.8.0 2.8.1 2.9.1 trunk 1.0 1.0-beta1 1.0-beta2 1.0-beta3 1.0.1 1.0.2 1.0.3 1.1.0 1.1.1 1.1.2 All 80 releases
← All changes | includes/performance/script-gate.php +9 -1 2.12.02.13.1 View file →
@@ -111,10 +111,18 @@
111 111 $extra .= sprintf( 'data-ablocks-type="%s" ', esc_attr( $found[1] ) );
112 112 $tag = preg_replace( '/\stype=["\'][^"\']*["\']/i', '', $tag, 1 );
113 113 }
114 114
115 + // `\b` rather than `\s`. Stripping the type above can leave the tag as
116 + // a bare `<script>` — that is the whole of a Meta Pixel snippet's
117 + // opening tag once `type='text/javascript'` is taken out — and a
118 + // pattern demanding whitespace after the name silently matches
119 + // nothing, returning the tag ungated with no error anywhere. A tag
120 + // that merely also carried an `id` was rewritten fine, which is why
121 + // this survived: it only ever missed the scripts whose sole attribute
122 + // was the type.
115 123 return preg_replace(
116 - '/^<script\s/',
124 + '/^<script\b/i',
117 125 sprintf( '<script type="%s" %s', esc_attr( $type ), $extra ),
118 126 $tag,
119 127 1
120 128 );