Commit 74b6b66b authored by Alexander.Trofimov's avatar Alexander.Trofimov Committed by Alexander.Trofimov

Правка бага http://bugzserver/show_bug.cgi?id=22468

При формировании RegExp для замены неправильно заменялась '\' в тексте

git-svn-id: svn://192.168.3.15/activex/AVS/Sources/TeamlabOffice/trunk/OfficeWeb@54469 954022d7-b5bf-4e40-9824-e11837661b57
parent a7dbd4bd
...@@ -9495,17 +9495,13 @@ ...@@ -9495,17 +9495,13 @@
findFlags += "i"; // Не чувствителен к регистру findFlags += "i"; // Не чувствителен к регистру
var valueForSearching = options.findWhat var valueForSearching = options.findWhat
.replace( /(\\)/g, "\\" ).replace( /(\^)/g, "\\^" ) .replace( /(\\)/g, "\\\\" ).replace( /(\^)/g, "\\^" )
.replace( /(\()/g, "\\(" ).replace( /(\))/g, "\\)" ) .replace( /(\()/g, "\\(" ).replace( /(\))/g, "\\)" )
.replace( /(\+)/g, "\\+" ).replace( /(\[)/g, "\\[" ) .replace( /(\+)/g, "\\+" ).replace( /(\[)/g, "\\[" )
.replace( /(\])/g, "\\]" ).replace( /(\{)/g, "\\{" ) .replace( /(\])/g, "\\]" ).replace( /(\{)/g, "\\{" )
.replace( /(\})/g, "\\}" ).replace( /(\$)/g, "\\$" ) .replace( /(\})/g, "\\}" ).replace( /(\$)/g, "\\$" )
.replace( /(~)?\*/g, function ( $0, $1 ) { .replace( /(~)?\*/g, function ( $0, $1 ) { return $1 ? $0 : '(.*)'; } )
return $1 ? $0 : '(.*)'; .replace( /(~)?\?/g, function ( $0, $1 ) { return $1 ? $0 : '.'; } )
} )
.replace( /(~)?\?/g, function ( $0, $1 ) {
return $1 ? $0 : '.';
} )
.replace( /(~\*)/g, "\\*" ).replace( /(~\?)/g, "\\?" ); .replace( /(~\*)/g, "\\*" ).replace( /(~\?)/g, "\\?" );
valueForSearching = new RegExp(valueForSearching, findFlags); valueForSearching = new RegExp(valueForSearching, findFlags);
var t = this; var t = this;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment