#460 Invalid projedc names

This commit is contained in:
karel.picman@lbcfree.net 2020-09-01 09:14:55 +02:00
parent 571187aae4
commit 514775c42b
2 changed files with 3 additions and 3 deletions

View File

@ -128,7 +128,7 @@ module RedmineDmsf
prj = Project.visible.find_by(id: $1)
if prj
# Check again whether it's really the project and not a folder with a number as a suffix
prj = nil unless pinfo.first =~ /^#{prj.name}/
prj = nil unless pinfo.first =~ /^#{DmsfFolder::get_valid_title(prj.name)}/
end
end
else
@ -156,7 +156,7 @@ module RedmineDmsf
prj = Project.visible.find_by(id: $1)
if prj
# Check again whether it's really the project and not a folder with a number as a suffix
prj = nil unless pinfo.first =~ /^#{prj.name}/
prj = nil unless pinfo.first =~ /^#{DmsfFolder::get_valid_title(prj.name)}/
end
end
else

View File

@ -114,7 +114,7 @@ module RedmineDmsf
@subproject = Project.visible.find_by(id: $1, parent_id: parent_project&.id)
if @subproject
# Check again whether it's really the project and not a folder with a number as a suffix
@subproject = nil unless basename =~ /^#{@subproject.name}/
@subproject = nil unless basename =~ /^#{DmsfFolder::get_valid_title(@subproject.name)}/
end
end
else