fixes #1996
This commit is contained in:
@@ -34,7 +34,7 @@
|
|||||||
}
|
}
|
||||||
} else if (command === "[reset]") {
|
} else if (command === "[reset]") {
|
||||||
return [];
|
return [];
|
||||||
} else if (command[0] === "-" && !command.match(/^-pool:/i)) {
|
} else if (command[0] === "-" && !command.match(/^(?:-pool|-parent):/i)) {
|
||||||
return Danbooru.reject(tags, function(x) {return x === command.substr(1, 100)});
|
return Danbooru.reject(tags, function(x) {return x === command.substr(1, 100)});
|
||||||
} else {
|
} else {
|
||||||
tags.push(command);
|
tags.push(command);
|
||||||
|
|||||||
@@ -432,7 +432,7 @@ class Post < ActiveRecord::Base
|
|||||||
end
|
end
|
||||||
|
|
||||||
def filter_metatags(tags)
|
def filter_metatags(tags)
|
||||||
@pre_metatags, tags = tags.partition {|x| x =~ /\A(?:rating|parent):/i}
|
@pre_metatags, tags = tags.partition {|x| x =~ /\A(?:rating|parent|-parent):/i}
|
||||||
@post_metatags, tags = tags.partition {|x| x =~ /\A(?:-pool|pool|newpool|fav|child):/i}
|
@post_metatags, tags = tags.partition {|x| x =~ /\A(?:-pool|pool|newpool|fav|child):/i}
|
||||||
apply_pre_metatags
|
apply_pre_metatags
|
||||||
return tags
|
return tags
|
||||||
@@ -485,6 +485,11 @@ class Post < ActiveRecord::Base
|
|||||||
when /^parent:none$/i, /^parent:0$/i
|
when /^parent:none$/i, /^parent:0$/i
|
||||||
self.parent_id = nil
|
self.parent_id = nil
|
||||||
|
|
||||||
|
when /^-parent:(\d+)$/i
|
||||||
|
if parent_id == $1.to_i
|
||||||
|
self.parent_id = nil
|
||||||
|
end
|
||||||
|
|
||||||
when /^parent:(\d+)$/i
|
when /^parent:(\d+)$/i
|
||||||
if $1.to_i != id && Post.exists?(["id = ?", $1.to_i])
|
if $1.to_i != id && Post.exists?(["id = ?", $1.to_i])
|
||||||
self.parent_id = $1.to_i
|
self.parent_id = $1.to_i
|
||||||
|
|||||||
Reference in New Issue
Block a user