This commit is contained in:
BoHung Chiu 2023-07-27 17:04:08 +08:00
parent 6eee8738cc
commit e16fc6a9b7
3 changed files with 5 additions and 5 deletions

View File

@ -798,7 +798,7 @@ class Admin::PersonalPluginFieldsController < OrbitMemberController
match_count = parse_content.match(/^ *\* *\d+/m)
match_count = match_count ? match_count[0] : nil
has_exist_condition = parse_content.split("\n")[0].match(/if[ ]+\w+/).present?
exist_condition = parse_content.split("\n")[0].match(/if[ ]+#{::Regexp.escape(k)}(?=\.| |$)/)
exist_condition = parse_content.split("\n")[0].match(/if[ ]+#{::Regexp.escape(k)}(?=\.| |$|\r)/)
if has_exist_condition && exist_condition.nil? #if this block is for other variables, then not proccessing
@parse_again_mode = false
result

View File

@ -62,9 +62,9 @@
handle: ".brand",
update: function(event, ui) {
var item = ui.item;
var new_index = item.index();
var old_index = item.attr("index");
var indices = [new_index,old_index].sort();
var n_index = item.index();
var o_index = item.attr("index");
var indices = [n_index,o_index].sort();
for(var new_i=indices[0];new_i<=indices[1];new_i++){
var td = item.parent().find(">").eq(new_i);
td.attr("index",new_i);

View File

@ -167,6 +167,6 @@ class PersonalPluginTemplatesController < ApplicationController
return plugin_templates
end
def gsub_invalid_character(text)
text.to_s.gsub(/(\/|\*|\\|\]|\[|\(|\)|\.|\+|\?|\!)/){|ff| "\\"+ff}
::Regexp.escape(text.to_s)
end
end