[Pkg-javascript-commits] [dojo] 06/16: Remove unicode bidi control chars, 1.5 branch. Fixes #10847 \!strict

David Prévot taffit at moszumanska.debian.org
Thu Aug 21 17:39:03 UTC 2014


This is an automated email from the git hooks/post-receive script.

taffit pushed a commit to annotated tag 1.5.3
in repository dojo.

commit 8df0724a7c9d4207ad7a553128b757079db455dc
Author: Adam Peller <github at peller.org>
Date:   Tue Sep 7 17:03:58 2010 +0000

    Remove unicode bidi control chars, 1.5 branch.  Fixes #10847 \!strict
    
    git-svn-id: http://svn.dojotoolkit.org/src/branches/1.5/dojo@22841 560b804f-0ae3-0310-86f3-f6aa0a117693
---
 date/locale.js | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/date/locale.js b/date/locale.js
index 8b296fc..222c1c4 100644
--- a/date/locale.js
+++ b/date/locale.js
@@ -293,10 +293,13 @@ dojo.date.locale.parse = function(/*String*/value, /*dojo.date.locale.__FormatOp
 	// value:
 	//		A string representation of a date
 
-	var info = dojo.date.locale._parseInfo(options),
+	// remove non-printing bidi control chars from input and pattern
+	var controlChars = /[\u200E\u200F\u202A\u202E]/g,
+		info = dojo.date.locale._parseInfo(options),
 		tokens = info.tokens, bundle = info.bundle,
-		re = new RegExp("^" + info.regexp + "$", info.strict ? "" : "i"),
-		match = re.exec(value);
+		re = new RegExp("^" + info.regexp.replace(controlChars, "") + "$",
+			info.strict ? "" : "i"),
+		match = re.exec(value && value.replace(controlChars, ""));
 
 	if(!match){ return null; } // null
 

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-javascript/dojo.git



More information about the Pkg-javascript-commits mailing list