Skip to content

Commit 266c104

Browse files
committed
JS: More aggressive TemplateFileReference.getValue
1 parent bc73d9f commit 266c104

1 file changed

Lines changed: 9 additions & 2 deletions

File tree

javascript/ql/src/semmle/javascript/frameworks/Templating.qll

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -281,8 +281,15 @@ module Templating {
281281
* likely template file being referenced.
282282
*/
283283
abstract class TemplateFileReference extends DataFlow::Node {
284-
/** Gets the value that identifies the template. Defaults to `getStringValue()`. */
285-
string getValue() { result = getStringValue() }
284+
/** Gets the value that identifies the template. */
285+
string getValue() {
286+
result = getStringValue()
287+
or
288+
exists(API::Node node |
289+
this = node.getARhs() and
290+
result = node.getAValueReachingRhs().getStringValue()
291+
)
292+
}
286293

287294
/** Gets the template file referenced by this node. */
288295
final TemplateFile getTemplateFile() {

0 commit comments

Comments
 (0)