Skip to content

Commit

Permalink
Add back support for older iOS versions
Browse files Browse the repository at this point in the history
Add new molang validation for ")("
  • Loading branch information
JannisX11 committed Dec 21, 2023
1 parent c891ca0 commit e2fa882
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion js/animations/molang.js
Original file line number Diff line number Diff line change
Expand Up @@ -587,6 +587,7 @@ new ValidatorCheck('molang_syntax', {
run() {
let check = this;
let keywords = ['return', 'continue', 'break'];
let two_expression_regex = (isApp || window.chrome) ? new RegExp('(?<!\\w)[0-9._]+\\(|\\)[a-z0-9._]+') : null;
function validateMolang(string, message, instance) {
if (!string || typeof string !== 'string') return;
let clear_string = string.replace(/'.*'/g, '0');
Expand All @@ -598,7 +599,7 @@ new ValidatorCheck('molang_syntax', {
if (clear_string.match(/^[+*/.,?=&<>|]/)) {
issues.push('Expression starts with an invalid character');
}
if ((clear_string.match(/[\w.]\s+[\w.]/) && !keywords.find(k => clear_string.includes(k))) || clear_string.match(/(?<!\w)[0-9._]+\(|\)[a-z0-9._]+/)) {
if ((clear_string.match(/[\w.]\s+[\w.]/) && !keywords.find(k => clear_string.includes(k))) || clear_string.match(/\)\(/) || (two_expression_regex && clear_string.match(two_expression_regex))) {
issues.push('Two expressions with no operator in between');
}
if (clear_string.match(/(^|[^a-z0-9_])[\d.]+[a-z_]+/i)) {
Expand Down

0 comments on commit e2fa882

Please sign in to comment.