Skip to content

Commit 018aa11

Browse files
committed
Make EmailSender an instance of EmailSender::Range
1 parent f350253 commit 018aa11

1 file changed

Lines changed: 7 additions & 11 deletions

File tree

python/ql/src/experimental/semmle/python/Concepts.qll

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -339,38 +339,34 @@ module EmailSender {
339339
* Extend this class to refine existing API models. If you want to model new APIs,
340340
* extend `EmailSender::Range` instead.
341341
*/
342-
class EmailSender extends DataFlow::Node {
343-
EmailSender::Range range;
344-
345-
EmailSender() { this = range }
346-
342+
class EmailSender extends DataFlow::Node instanceof EmailSender::Range {
347343
/**
348344
* Gets a data flow node holding the plaintext version of the email body.
349345
*/
350-
DataFlow::Node getPlainTextBody() { result = range.getPlainTextBody() }
346+
DataFlow::Node getPlainTextBody() { result = super.getPlainTextBody() }
351347

352348
/**
353349
* Gets a data flow node holding the html version of the email body.
354350
*/
355-
DataFlow::Node getHtmlBody() { result = range.getHtmlBody() }
351+
DataFlow::Node getHtmlBody() { result = super.getHtmlBody() }
356352

357353
/**
358354
* Gets a data flow node holding the recipients of the email.
359355
*/
360-
DataFlow::Node getTo() { result = range.getTo() }
356+
DataFlow::Node getTo() { result = super.getTo() }
361357

362358
/**
363359
* Gets a data flow node holding the senders of the email.
364360
*/
365-
DataFlow::Node getFrom() { result = range.getFrom() }
361+
DataFlow::Node getFrom() { result = super.getFrom() }
366362

367363
/**
368364
* Gets a data flow node holding the subject of the email.
369365
*/
370-
DataFlow::Node getSubject() { result = range.getSubject() }
366+
DataFlow::Node getSubject() { result = super.getSubject() }
371367

372368
/**
373369
* Gets a data flow node that refers to the HTML body or plaintext body of the email.
374370
*/
375-
DataFlow::Node getABody() { result in [range.getPlainTextBody(), range.getHtmlBody()] }
371+
DataFlow::Node getABody() { result in [super.getPlainTextBody(), super.getHtmlBody()] }
376372
}

0 commit comments

Comments
 (0)