Skip to content

Constrain classes further in MailPreview controller#1078

Open
markstory wants to merge 1 commit into
5.xfrom
fix-preview-class
Open

Constrain classes further in MailPreview controller#1078
markstory wants to merge 1 commit into
5.xfrom
fix-preview-class

Conversation

@markstory
Copy link
Copy Markdown
Member

This controller should not attempt to load classes with \ in the name, nor should it attempt to load classes that do not extedn MailPreview.

Thanks to Volker Dusch and the PHP Ecosystem security team for reporting this.

This controller should not attempt to load classes with `\` in the name,
nor should it attempt to load classes that do not extedn
`MailPreview`.

Thanks to Volker Dusch and the PHP Ecosystem security team for reporting this.
@markstory markstory added this to the 5.x milestone Jun 4, 2026
* @throws \Cake\Http\Exception\NotFoundException
*/
protected function findPreview(string $previewName, string $emailName, string $plugin = ''): PreviewResult
protected function findPreview(string $previewName, string $emailName, ?string $plugin = ''): PreviewResult
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why does this need to be nullable?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Using null when the mailer is not from a plugin makes sense, but then the default value of the argument should be null, not empty string.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants