Fixed bug in regular expression and restored debugged code

This commit is contained in:
Tobi Schäfer 2008-12-11 17:41:25 +00:00
parent 6750cb8984
commit 36c600e2f9

View file

@ -26,7 +26,7 @@
global["patch-20081211"] = function() { global["patch-20081211"] = function() {
root.forEach(function() { root.forEach(function() {
var site = root; var site = this;
if (site.layout) { if (site.layout) {
res.handlers.layout = site.layout; res.handlers.layout = site.layout;
res.skinpath = site.layout.getSkinPath(); res.skinpath = site.layout.getSkinPath();
@ -34,9 +34,7 @@ global["patch-20081211"] = function() {
// Fixing the <% if <% comment.created %> %> macro // Fixing the <% if <% comment.created %> %> macro
var skin = site.layout.skins.getSkin("Comment", "edit"); var skin = site.layout.skins.getSkin("Comment", "edit");
var source = skin.getSource(); var source = skin.getSource();
res.debug(123) var re = /(<%\s+if\s+<%\s+comment\.creat)ed/g;
res.debug(source.contains("<% if <% comment.created %>"))
var re = /<%(\s+if\s+<%\s+comment\.creat)ed/g;
var newSource = source.replace(re, function() { var newSource = source.replace(re, function() {
var replacement = arguments[1] + "or"; var replacement = arguments[1] + "or";
app.log(arguments[0] + " ==> " + replacement); app.log(arguments[0] + " ==> " + replacement);