File tree Expand file tree Collapse file tree 1 file changed +3
-6
lines changed
ruby/ql/lib/codeql/ruby/frameworks Expand file tree Collapse file tree 1 file changed +3
-6
lines changed Original file line number Diff line number Diff line change @@ -29,16 +29,13 @@ private module RenderCallUtils {
2929 result = getTemplatePathValue ( renderCall ) .regexpCapture ( "^/?(.*/)?(?:[^/]*?)$" , 1 )
3030 }
3131
32- // everything after the final slash, or the whole string if there is no slash
33- private string getBaseName ( MethodCall renderCall ) {
34- result = getTemplatePathValue ( renderCall ) .regexpCapture ( "^/?(?:.*/)?([^/]*?)$" , 1 )
35- }
36-
3732 /**
3833 * Gets the template file to be rendered by this render call, if any.
3934 */
4035 ErbFile getTemplateFile ( MethodCall renderCall ) {
41- result .getTemplateName ( ) = getBaseName ( renderCall ) and
36+ // everything after the final slash, or the whole string if there is no slash
37+ result .getTemplateName ( ) =
38+ getTemplatePathValue ( renderCall ) .regexpCapture ( "^/?(?:.*/)?([^/]*?)$" , 1 ) and
4239 result .getRelativePath ( ) .matches ( "%app/views/" + getSubPath ( renderCall ) + "%" )
4340 }
4441
You can’t perform that action at this time.
0 commit comments