-
Notifications
You must be signed in to change notification settings - Fork 7.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Declare ext/tidy properties #8515
Conversation
ae37101
to
3d94aa1
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, but where the properties always readonly?
No, they weren't before.. So this is up for debate whether we want/can make them readonly. I think it would make sense to add the readonly modifier for them. |
It seems that the properties were writable before, but changing them would not have the desired effect, e.g. <?php
$html = <<<HTML
<body onload="foo">asd</body>
HTML;
$tidy = new tidy();
$tidy->parseString($html);
$body = $tidy->body();
var_dump($body->attribute);
$body->attribute = [];
var_dump($body->attribute);
echo $body;
As such, making the properties read-only is a step in the right direction, but still would constitute some kind of BC break. A cleaner solution would be to deprecate writing to the properties first (and to later make them read-only), but that looks like overkill. Maybe write to internals about your proposal. |
I'm going to merge this PR at the end of the next week, unless any resistance or issue emerges |
3d94aa1
to
aa3ea7b
Compare
@ramsey How much do you think we should wait with the merge? |
IMO, go ahead and merge. :) |
Agreed! All I've heard are crickets. 😄 |
I think this warrants a note in the NEWS file and perhaps UPGRADING. |
Yes, I added an upgrading entry in df77fee, but AFAIK we don't add NEWS entries for such technical changes. |
Sounds good to me. I missed seeing that commit. Thanks! |
No description provided.