Skip to content

Commit

Permalink
Fixes #5970: Delay js new jquery regex not working (#6031)
Browse files Browse the repository at this point in the history
  • Loading branch information
jeawhanlee authored Jul 10, 2023
1 parent b11a9ef commit d6b4666
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion inc/Engine/Optimization/DelayJS/Admin/Settings.php
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ public function maybe_disable_combine_js( $value, $old_value ): array {
public static function get_delay_js_default_exclusions(): array {

$exclusions = [
'\/jquery(-migrate)?-?([0-9.]+)?(.min|.slim|.slim.min)?.js(\?(.*))?$',
'\/jquery(-migrate)?-?([0-9.]+)?(.min|.slim|.slim.min)?.js(\?(.*))?( |\'|"|>)',
'js-(before|after)',
];

Expand Down
2 changes: 1 addition & 1 deletion inc/ThirdParty/Themes/MinimalistBlogger.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ public static function get_subscribed_events() {
* @return array
*/
public function exclude_jquery_from_delay_js( array $exclusions = [] ) {
$exclusions[] = '\/jquery(-migrate)?-?([0-9.]+)?(.min|.slim|.slim.min)?.js(\?(.*))?$';
$exclusions[] = '\/jquery(-migrate)?-?([0-9.]+)?(.min|.slim|.slim.min)?.js(\?(.*))?( |\'|"|>)';
return $exclusions;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
'excluded' => []
],
'expected' => [
'\/jquery(-migrate)?-?([0-9.]+)?(.min|.slim|.slim.min)?.js(\?(.*))?$'
]
'\/jquery(-migrate)?-?([0-9.]+)?(.min|.slim|.slim.min)?.js(\?(.*))?( |\'|"|>)',
],
],
'testThemeShouldReturnExpected' => [
'config' => [
Expand All @@ -17,7 +17,7 @@
'excluded' => []
],
'expected' => [
'\/jquery(-migrate)?-?([0-9.]+)?(.min|.slim|.slim.min)?.js(\?(.*))?$'
]
]
'\/jquery(-migrate)?-?([0-9.]+)?(.min|.slim|.slim.min)?.js(\?(.*))?( |\'|"|>)',
],
],
];

0 comments on commit d6b4666

Please sign in to comment.