Skip to content

[7.x] Escape attributes automatically in some situations#31945

Merged
taylorotwell merged 7 commits into7.xfrom
escape-attributes
Mar 13, 2020
Merged

[7.x] Escape attributes automatically in some situations#31945
taylorotwell merged 7 commits into7.xfrom
escape-attributes

Conversation

@taylorotwell
Copy link
Copy Markdown
Member

No description provided.

@GrahamCampbell GrahamCampbell changed the title Escape attributes automatically in some situations [7.x] Escape attributes automatically in some situations Mar 12, 2020
$parameters = [
'view' => "'$class'",
'data' => '['.$this->attributesToString($data->all()).']',
'data' => '['.$this->attributesToString($data->all(), $escapeBound = false).']',
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.

This is currently not covered by any test (Changing to $escapeBound = true doesn't cause any tests to fail).

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.

Here is an attempt to cover this in testClasslessComponents(): perifer@46176c6

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Thanks

@taylorotwell taylorotwell merged commit ae4d790 into 7.x Mar 13, 2020
@GrahamCampbell GrahamCampbell deleted the escape-attributes branch March 15, 2020 10:08
@GrahamCampbell
Copy link
Copy Markdown
Collaborator

@bakerkretzmar
Copy link
Copy Markdown
Contributor

@perifer @taylorotwell @GrahamCampbell is there any way to disable this sanitizing if I do want to pass in a class with a __toString() method, and have it available as a PHP object (not a string) inside my component?

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.

4 participants