Skip to content

Commit

Permalink
Fixed Regex
Browse files Browse the repository at this point in the history
Fixes wrong match of regex in prepend and append.
'append' => '<button class="fa fa-share">share</button>' would cause a
wrapping <i> breaking code.
  • Loading branch information
Walter committed Dec 18, 2015
1 parent f796008 commit 156c5a4
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion View/Helper/Bs3HtmlHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ public function icon($class, $options = array()) {
*/
public function getIconVendor($class) {
foreach ($this->_config['iconVendorPrefixes'] as $iconVendorPrefix) {
$regex = sprintf('/^%s-|\s%s-/', $iconVendorPrefix, $iconVendorPrefix);
$regex = sprintf('/^(?<!<"\')(%s[\s-]){1,}/', $iconVendorPrefix, $iconVendorPrefix);
if (preg_match($regex, $class)) {
return $iconVendorPrefix;
}
Expand Down

0 comments on commit 156c5a4

Please sign in to comment.