Skip to content

Commit 3a9d1d6

Browse files
AC-99: Update Third Party library: jquery.tabs
1 parent c066a0d commit 3a9d1d6

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

Magento2/Sniffs/Html/HtmlCollapsibleAttributeSniff.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ public function register()
2424

2525
/**
2626
* Detect use of data attributes used by older version of bootstrap collapse
27+
*
2728
* Use new attributes in https://getbootstrap.com/docs/5.0/components/collapse/
2829
*
2930
* @param File $phpcsFile
@@ -41,7 +42,8 @@ public function process(File $phpcsFile, $stackPtr)
4142
return;
4243
}
4344

44-
if (preg_match_all('$<\w+.*?\s*(?=.*?\s*data-toggle="collapse")[^>]*?>.*?$', $html, $matches, PREG_SET_ORDER)) {
45+
$pattern = '$<\w+.*?\s*(?=.*?\s*data-toggle="collapse")[^>]*?>.*?$';
46+
if (preg_match_all($pattern , $html, $matches, PREG_SET_ORDER)) {
4547
foreach ($matches as $match) {
4648
$phpcsFile->addError(
4749
'Collapsible attributes data-toggle and data-target need to be updated to ' .

0 commit comments

Comments
 (0)