Array number getting confused

Hi all,

In the previous release (1.7.8) I had an embedded script working fine, it did a countdown to a certain time.
After upgrading to 1.8.1, the script suddenly behaves weird. It goes as follows:

Date.prototype.yyyymmdd = function() {
	var yyyy = this.getFullYear().toString();
	var mm = (this.getMonth()+1).toString();
	var dd = this.getDate().toString();
	var hh = this.getHours().toString();
	var mn = this.getMinutes().toString();
	return yyyy + "-" + (mm[1]?mm:"0"+mm[0]) + "-" + (dd[1]?dd:"0"+dd[0]) + " " + (hh[1]?hh:"0"+hh[0]) + ":" + (mn[1]?mn:"0"+mn[0]);
	};

Debugging the code, I discovered that the last line is turned by Xibo into the following:
return yyyy + "-" + (mm/xibo/web/library/download/1?preview=1?mm:"0"+mm[0]) + "-" + (dd/xibo/web/library/download/1?preview=1?dd:"0"+dd[0]) + " " + (hh/xibo/web/library/download/1?preview=1?hh:"0"+hh[0]) + ":" + (mn/xibo/web/library/download/1?preview=1?mn:"0"+mn[0]);

So [1] is replaced by /xibo/web/library/download/1?preview=1.

Any suggestions?