Skip to content

Commit 7cb41f8

Browse files
authored
Merge pull request #124 from CGLOB/master
To identify coorect end of the regex
2 parents e72133d + 70b18f1 commit 7cb41f8

File tree

4 files changed

+6
-5
lines changed

4 files changed

+6
-5
lines changed

src/JShrink/Minifier.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -626,7 +626,7 @@ protected function saveRegex()
626626
$this->echo($this->b);
627627

628628
while (($this->a = $this->getChar()) !== false) {
629-
if ($this->a === '/') {
629+
if ($this->a === '/' && (preg_match('/g|\n|i|\)|\.|,|\s/', $this->peek()) === 1)) {
630630
break;
631631
}
632632

Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
escapeCssMeta: function( string ) {
2+
return (string || '').replace( /([\\!"#$%&'()*+,./:;<=>?@\[\]^`{|}~])/g, "\\$1" );
3+
},
Original file line numberDiff line numberDiff line change
@@ -1,4 +1 @@
1-
function test(string){return(string||'').replace(/([\\!"#$%&'()*+,./:;<=>?@\[\]^`{|}~])/g,
2-
'\\$1'
3-
)
4-
}
1+
function test(string){return(string||'').replace(/([\\!"#$%&'()*+,./:;<=>?@\[\]^`{|}~])/g,'\\$1')}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
escapeCssMeta:function(string){return(string||'').replace(/([\\!"#$%&'()*+,./:;<=>?@\[\]^`{|}~])/g,"\\$1");},

0 commit comments

Comments
 (0)