Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

bug fix

  • Loading branch information...
commit 8b599c912864b9b9ad14ac3c626e65dad5dffdd5 1 parent 287e9a0
longbill.cn@gmail.com authored

Showing 2 changed files with 4 additions and 4 deletions. Show diff stats Hide diff stats

  1. +3 3 browser/endskin.js
  2. +1 1  endskin.js
6 browser/endskin.js
@@ -55,7 +55,7 @@ EndSkin.prototype.show_val = function(s)
55 55 for(var i=0;i<arr.length;i++)
56 56 {
57 57 var key = arr[i];
58   - if (!val[key]) return '';
  58 + if (val[key] === undefined) return '';
59 59 val = val[key];
60 60 }
61 61 if (typeof val == 'function') val = val();
@@ -93,11 +93,11 @@ EndSkin.prototype.compile = function(page)
93 93 {
94 94 var codeBlocks = [];
95 95 var ms = null,i=0,m;
96   - if (ms = page.match(/\{(\$[a-zA-Z\_][a-zA-Z0-9\_\.\[\]\'\"]*)\}/ig))
  96 + if (ms = page.match(/\{(\$[a-z\_][a-z0-9\_\.\[\]\'\"\|\?\:]*)\}/ig))
97 97 {
98 98 for(i=0; m=ms[i]; i++)
99 99 {
100   - var _ms = m.match(/\{(\$[a-zA-Z\_][a-zA-Z0-9\_\.\[\]\'\"]*)\}/i);
  100 + var _ms = m.match(/\{(\$[a-zA-Z\_][a-z0-9\_\.\[\]\'\"\|\?\:]*)\}/i);
101 101 var code = 'output.push('+this._replace_var_name(_ms[1])+');';
102 102 codeBlocks.push(code);
103 103 page = page.replace(m,'{{{{EndSkin.codeblock['+(codeBlocks.length-1)+']}}}}');
2  endskin.js
@@ -260,7 +260,7 @@ function EndSkin(tmpId)
260 260 for(var i=0;i<arr.length;i++)
261 261 {
262 262 var key = arr[i];
263   - if (!val[key]) return '';
  263 + if (val[key] == undefined) return '';
264 264 val = val[key];
265 265 }
266 266 if (typeof val == 'function') val = val();

0 comments on commit 8b599c9

Please sign in to comment.
Something went wrong with that request. Please try again.