mirror of
https://gitee.com/zyjblog/oatpp.git
synced 2024-12-22 22:16:37 +08:00
Filter file extensions without including the path prefix
Since the file lists contain only valid paths, it is sufficient to anchor the regular expression at the end only instead of matching the full path. This prevents regular expression injections.
This commit is contained in:
parent
7467f14193
commit
8cd6dd7c37
@ -75,28 +75,28 @@ function(set_target_source_groups arg_TARGET)
|
||||
endforeach()
|
||||
|
||||
set(filterSources ${sourceFiles})
|
||||
list(FILTER filterSources INCLUDE REGEX "^${sourceDir}/.+\\.h(h|pp)?$")
|
||||
list(FILTER filterSources INCLUDE REGEX "/.+\\.h(h|pp)?$")
|
||||
source_group(
|
||||
TREE "${sourceTreeDir}"
|
||||
PREFIX "Header Files"
|
||||
FILES ${filterSources}
|
||||
)
|
||||
set(filterSources ${sourceFiles})
|
||||
list(FILTER filterSources INCLUDE REGEX "^${sourceDir}/.+\\.h(h|pp)?\\.in$")
|
||||
list(FILTER filterSources INCLUDE REGEX "/.+\\.h(h|pp)?\\.in$")
|
||||
source_group(
|
||||
TREE "${sourceTreeDir}"
|
||||
PREFIX "Header Templates"
|
||||
FILES ${filterSources}
|
||||
)
|
||||
set(filterSources ${sourceFiles})
|
||||
list(FILTER filterSources INCLUDE REGEX "^${sourceDir}/.+\\.c(c|xx|pp)?$")
|
||||
list(FILTER filterSources INCLUDE REGEX "/.+\\.c(c|xx|pp)?$")
|
||||
source_group(
|
||||
TREE "${sourceTreeDir}"
|
||||
PREFIX "Source Files"
|
||||
FILES ${filterSources}
|
||||
)
|
||||
set(filterSources ${sourceFiles})
|
||||
list(FILTER filterSources INCLUDE REGEX "^${sourceDir}/.+\\.c(c|xx|pp)?\\.in$")
|
||||
list(FILTER filterSources INCLUDE REGEX "/.+\\.c(c|xx|pp)?\\.in$")
|
||||
source_group(
|
||||
TREE "${sourceTreeDir}"
|
||||
PREFIX "Source Templates"
|
||||
@ -104,7 +104,6 @@ function(set_target_source_groups arg_TARGET)
|
||||
)
|
||||
|
||||
set(filterSources ${binaryFiles})
|
||||
list(FILTER filterSources INCLUDE REGEX "^${binaryDir}/")
|
||||
source_group(
|
||||
TREE "${binaryTreeDir}"
|
||||
PREFIX "Generated Files"
|
||||
|
Loading…
Reference in New Issue
Block a user