Permalink
Browse files

Merged

  • Loading branch information...
2 parents 0a168c0 + 69c7008 commit b18762c6d223df3811f24b5e704586be6e3d6905 cmoyer committed Aug 2, 2011
Showing with 5 additions and 2 deletions.
  1. +1 −1 src/botoweb/property.js
  2. +4 −1 src/botoweb/util.js
View
2 src/botoweb/property.js 100644 → 100755
@@ -109,7 +109,7 @@ botoweb.Property = function(name, type, perm, model, opt) {
} catch(e){}
// Handle Email Addresses
- if(/^[a-zA-Z\.0-9_\+\-]+@[a-zA-Z\.0-9\-]*$/.test(retval)){
+ if(/^[a-z\.0-9_\+\-]+@[a-z\.0-9-]+\.[a-z]+$/i.test(retval)){
var href = botoweb.env.cfg.format.email_href(retval, this, this.obj);
retval = "<a href='"+href+"' target='_blank'>"+retval+"</a>";
} else if (/^(feed|ftps|sftp|ftp|http|https):\/\/(\w+:{0,1}\w*@)?(\S+)(:[0-9]+)?(\/|\/([\w#!:.?+=&%@!\-\/]))?$/.test(retval)){
View
5 src/botoweb/util.js 100644 → 100755
@@ -133,7 +133,7 @@ $util.interpolate = function (str, data) {
if (!str) return str;
if (!data) data = {};
- var replacement;
+ var replacement = '';
data.__user__ = botoweb.env.user;
data.__obj__ = botoweb.ui.page.obj || {};
@@ -161,6 +161,9 @@ $util.interpolate = function (str, data) {
return ret || '';
};
}
+
+ if (replacement && typeof replacement == 'string')
+ replacement = replacement.replace(/\\/g, "\\").replace(/(['"])/g, "\\$1");
return str.replace(/\{\{\s*(.*?)\s*\}\}/g, replacement);
};

0 comments on commit b18762c

Please sign in to comment.