@@ -116,17 +116,25 @@ private function delete_extraneous_blogs() {
116116 * @return string
117117 */
118118 protected function get_type_attribute () {
119- $ type = '' ;
120119 if (
121120 function_exists ( 'wp_get_inline_script_tag ' )
122121 && ! is_admin ()
123122 && ! current_theme_supports ( 'html5 ' , 'script ' )
124123 && getenv ( 'WORDPRESS_VERSION ' ) !== 'trunk '
125124 && version_compare ( getenv ( 'WORDPRESS_VERSION ' ), '6.4 ' , '< ' )
126125 ) {
127- $ type = ' type="text/javascript" ' ;
126+ return ' type="text/javascript" ' ;
128127 }
129- return $ type ;
128+
129+ if (
130+ getenv ( 'WORDPRESS_VERSION ' ) !== 'trunk '
131+ && getenv ( 'WORDPRESS_VERSION ' ) !== 'latest '
132+ && version_compare ( getenv ( 'WORDPRESS_VERSION ' ), '5.2 ' , '<= ' )
133+ ) {
134+ return ' ' ; // in these versions, there is a space before the end of the tag, ie, '<script >'
135+ }
136+
137+ return '' ;
130138 }
131139
132140 private function snapshot_db_data () {
@@ -306,9 +314,6 @@ public function execute_scheduled_event( $event_name, $execute_all = false ) {
306314
307315 protected function is_wordpress_not_using_cdata_tags () {
308316 return getenv ( 'WORDPRESS_VERSION ' )
309- && (
310- getenv ( 'WORDPRESS_VERSION ' ) !== 'latest '
311- && version_compare ( getenv ( 'WORDPRESS_VERSION ' ), '6.4 ' , '< ' )
312- );
317+ && version_compare ( getenv ( 'WORDPRESS_VERSION ' ), '6.4 ' , '< ' );
313318 }
314319}
0 commit comments