Re: [PHP-DEV] [RFC] [Discussion] Add WHATWG compliant URL parsing API

2025-03-29 Thread Dennis Snell
> On Mar 25, 2025, at 3:23 PM, Máté Kocsis wrote: > > > Hi Dennis, > > >> I am myself also a bit lost on the countless names that I tried out in the >> implementation, but I think I had toHumanFriendlyString() and >> toDisplayFriendlyString() methods at some point. These then ended up being

Re: [PHP-DEV] [RFC] [Discussion] Add WHATWG compliant URL parsing API

2025-03-25 Thread Dennis Snell
> On Mar 25, 2025, at 4:06 PM, Dennis Snell wrote: > > >> On Mar 25, 2025, at 3:23 PM, Máté Kocsis wrote: >> >> >> Hi Dennis, >> >> >>> I am myself also a bit lost on the countless names that I tried out in the >>>

Re: [PHP-DEV] [RFC] [Discussion] Add WHATWG compliant URL parsing API

2025-03-05 Thread Dennis Snell
fox, and Safari exhibit the same behavior.     u = new URL(window.location)     u.hash = ‘one and two’;     u.hash === ‘#one%20and%20two’;     u.toString() === ‘….#one%20and%20two’; So I think it may be more accurate and consistent to handle `Whatwg\Url::getFragment` in the same way as `getScheme()`. When setting a fragment we should percent-encode the appropriate characters, but when reading it, we should never interpret those characters — it should always return the “raw” value of the fragment. [no-percent-escaping]: https://github.com/whatwg/url/issues/344 Once again, thank you for the great work you’ve put into this. I’m so excited to have it. All my comments should be understood exclusively within the WHATWG domain as I don’t have the same experience with the RFC3986 side. Dennis Snell > > > Regards, > Máté > > >

Re: [PHP-DEV] [RFC] [Discussion] Add WHATWG compliant URL parsing API

2025-01-02 Thread Dennis Snell
happy to see how the RFC continues to develop, and I’m eagerly looking forward to being able to finally rely on PHP’s handling of URLs. Happy new year, Dennis Snell

Re: [PHP-DEV] Zephir, and other tangents

2024-09-23 Thread Dennis Snell
e disagreement. > Or the ones who want to target the users of the CMS or Framework that > recommend or require the extension. > > > If the extension were bundled then I expect it could become a recommended > extension for hosts to enable and WordPress could start shipping WAS

Re: [PHP-DEV] Zephir, and other tangents

2024-09-20 Thread Dennis Snell
> On Sep 20, 2024, at 1:21 PM, Jakub Zelenka wrote: > > > Hi, > > On Fri, Sep 20, 2024 at 6:32 PM Dennis Snell > wrote: > >> >> >> >> My goal in sharing here is to help better represent my own perspective of >> WordPress’ needs

Re: [PHP-DEV] Zephir, and other tangents

2024-09-20 Thread Dennis Snell
> On Sep 20, 2024, at 12:56 AM, Arvids Godjuks wrote: > > > On Fri, 20 Sept 2024 at 09:17, Dennis Snell > wrote: > >> >> Hi Hammed, thank you for taking the time to read through this and share your >> thoughts. >> >>

Re: [PHP-DEV] Zephir, and other tangents

2024-09-19 Thread Dennis Snell
Hi Hammed, thank you for taking the time to read through this and share your thoughts. > On Sep 19, 2024, at 1:41 PM, Hammed Ajao wrote: > > > > > On Tue, Sep 17, 2024 at 8:30 PM Dennis Snell > wrote: > >> >> >> >>&

Re: [PHP-DEV] Zephir, and other tangents

2024-09-17 Thread Dennis Snell
e in a number of other separate tasks. Converting images or generating thumbnails is a good example where raw performance is less of a concern than being able to ensure that the image library is available and not exposing the host system to risk. I imagine plenty of “PHP lite-extensions” appearing in this space because it would give people the opportunity to experiment with features that are impractical in user-space PHP before fully committing the language itself to that interface or library. It would extend the reach of PHP’s usability because it would make possible for folks, who happen to be running on cheap shared hosts, to run more complicated processing tasks than are practical today. While big software shops and SaaS vendors do and can run their own custom PHP extensions, there’s not great way to share those generally to people without the same full control over their stack. > > > > However, plugins basically work via hooks/filters. So as long as you register > the right listeners and handle serialization properly, you can simply run a > separate process for the plugin, or call a socket for “remote” plugins. > > > > I don’t see anything stopping anyone from implementing that today. > > > — Rob > I’m excited to see this conversation. I’ve wanted to propose it a number of times myself. Warmly, Dennis Snell

[PHP-DEV] Re: [RFC] Decoding HTML and the Ambiguous Ampersand

2024-09-06 Thread Dennis Snell
it moving forward. https://wiki.php.net/rfc/decode_html Warmly, Dennis Snell > On Jul 9, 2024, at 4:55 PM, Dennis Snell wrote: > > Greetings all, > > The `html_entity_decode( … ENT_HTML5 … )` function has a number of issues > that I’d like to correct. > > - It’

Re: [PHP-DEV] [RFC] [Discussion] Add WHATWG compliant URL parsing API

2024-08-26 Thread Dennis Snell
ding rules. - Original [ https://xn--google.com/secret/../search?q=🍔 ] - `$url->normalize()` [ https://xn--google.com/search?q=%F0%9F%8D%94 ] - `$url->for_display()` Displayed [ https://䕮䕵䕶䕱.com/search?q=🍔 ] Having this in the RFC would give everyone the tools they need to effectively and safely set links within an HTML document. All the best, Dennis Snell

Re: [PHP-DEV] [RFC] Decoding HTML and the Ambiguous Ampersand

2024-08-25 Thread Dennis Snell
> On Aug 25, 2024, at 4:17 PM, Máté Kocsis wrote: > > Hi Christoph, Dennis, > >> Well, I don't think it would be a big deal to move the bundled lexbor to >> somewhere where it is always available. I mean, so far it's only used >> by ext/dom so it's bundled there, but if other parts of the php-

Re: [PHP-DEV] [RFC] Decoding HTML and the Ambiguous Ampersand

2024-08-25 Thread Dennis Snell
> On Aug 25, 2024, at 3:15 AM, Jakob Givoni wrote: > > > On Sat, Aug 24, 2024 at 10:31 PM Dennis Snell <mailto:dennis.sn...@automattic.com>> wrote: >> On Aug 24, 2024, at 2:56 PM, Jakob Givoni > <mailto:ja...@givoni.dk>> wrote: >>> >>>

Re: [PHP-DEV] [RFC] Decoding HTML and the Ambiguous Ampersand

2024-08-24 Thread Dennis Snell
> On Aug 24, 2024, at 7:47 AM, Christoph M. Becker wrote: > > On 23.08.2024 at 01:02, Dennis Snell wrote: > >>> If we could have a single implementation, that would be great. I do >>> understand of course your concern that DOM is not a required extension,

Re: [PHP-DEV] [RFC] Decoding HTML and the Ambiguous Ampersand

2024-08-24 Thread Dennis Snell
he point where it risks people not adopting them purely because they don’t want to type that long of a name every time they use it. Perhaps some of these 🙃 str_from_html( HtmlContext $context, string $html ): string {} utf8_from_html( HtmlContext $context, string $html ): string {} html_to_utf8( HtmlContext $context, string $html ): string {} > > Best, > Jakob > Thanks for your input. I’m grateful for the discussions and that people are sharing. Dennis Snell

Re: [PHP-DEV] [RFC] Decoding HTML and the Ambiguous Ampersand

2024-08-22 Thread Dennis Snell
> On Aug 22, 2024, at 5:01 PM, Niels Dossche wrote: > > On 20/08/2024 00:45, Dennis Snell wrote: >> >>> On Jul 9, 2024, at 4:55 PM, Dennis Snell wrote: >>> >>> Greetings all, >>> >>> The `html_entity_decode( … ENT_HTML5 … )` f

[PHP-DEV] Re: [RFC] Decoding HTML and the Ambiguous Ampersand

2024-08-19 Thread Dennis Snell
> On Jul 9, 2024, at 4:55 PM, Dennis Snell wrote: > > Greetings all, > > The `html_entity_decode( … ENT_HTML5 … )` function has a number of issues > that I’d like to correct. > > - It’s missing 720 of HTML5’s specified named character references. > - 106 o

Re: [PHP-DEV] Decoding HTML and the Ambiguous Ampersand

2024-08-17 Thread Dennis Snell
On Aug 17, 2024, at 11:20 AM, Mel Dafert wrote: > > On August 16, 2024 2:59:11 AM GMT+02:00, Dennis Snell > mailto:dennis.sn...@automattic.com>> wrote: >> >> All, >> >> >> I have submitted an RFC draft for including the proposed feature from thi

Re: [PHP-DEV] [RFC] Re: Decoding HTML and the Ambiguous Ampersand

2024-08-16 Thread Dennis Snell
feel like I learn something new every day that I didn’t know before. > > On Fri, Aug 16, 2024, at 20:43, Dennis Snell wrote: >> >On Fri, Aug 16, 2024, at 02:59, Dennis Snell wrote >> >> Thanks for the question, Rob, I hope this finds you well! >> >> >The R

[PHP-DEV] [RFC] Re: Decoding HTML and the Ambiguous Ampersand

2024-08-16 Thread Dennis Snell
>On Fri, Aug 16, 2024, at 02:59, Dennis Snell wrote: >> >>> On Jul 9, 2024, at 4:55 PM, Dennis Snell wrote: >>> >>> Greetings all, >>> >>> The `html_entity_decode( … ENT_HTML5 … )` function has a number of issues >>> that I’d li

[PHP-DEV] Re: Decoding HTML and the Ambiguous Ampersand

2024-08-15 Thread Dennis Snell
> On Jul 9, 2024, at 4:55 PM, Dennis Snell wrote: > > > Greetings all, > > > The `html_entity_decode( … ENT_HTML5 … )` function has a number of issues > that I’d like to correct. > > >  - It’s missing 720 of HTML5’s specified named character refere

[PHP-DEV] Request for RFC karma

2024-08-15 Thread Dennis Snell
Greetings all, I would like to request RFC karma to propose a new mechanism for decoding HTML text, following the brief discussion earlier in  https://news-web.php.net/php.internals/124326. My wiki username is dmsnell Thank you! Dennis Snell P.S. After my subscription got messed up

[PHP-DEV] Decoding HTML and the Ambiguous Ampersand

2024-07-09 Thread Dennis Snell
text. Should I propose an RFC for this? Warmly, Dennis Snell Automattic Inc.

Re: [PHP-DEV] [RFC][Discussion] NotSerializable attribute

2023-12-09 Thread Dennis Snell via internals
> On Dec 9, 2023, at 4:55 PM, Robert Landers wrote: > > On Sat, Dec 9, 2023 at 4:32 PM Dennis Snell via internals > wrote: >> >> Max, I love this idea. >> >> Would it make sense to flip the design though and add `#[Serializable]` with >> a new `

[PHP-DEV] Re: [RFC][Discussion] NotSerializable attribute

2023-12-09 Thread Dennis Snell via internals
where _no_ class serializes _unless_ it implements `__sleep()` and `__wakeup()` or `Serializable`, which seems quite reasonable in my mind as a tradeoff between explicitness and surprise. Warmly, Dennis Snell > On Dec 9, 2023, at 1:30 PM, Max Semenik wrote: > > Hi, I'd like to

Re: [PHP-DEV] Re: [RFC] [Discussion] DOM HTML5 parsing and serialization support

2023-09-29 Thread Dennis Snell via internals
de out there using the fragment parser, but I can’t help but think that part of the reason is because it’s not exposed where it ought to be. Have a great weekend! Dennis Snell >

Re: [PHP-DEV] Re: [RFC] [Discussion] DOM HTML5 parsing and serialization support

2023-09-29 Thread Dennis Snell via internals
` is more appropriate, that they aren’t supplying HTML documents with in-band text encoding information, and so there’s a chance that de-emphasizing the parameter may be technically more accurate and practically less helpful. Love seeing all the continued work on this! Thank you so much for yo

Re: [PHP-DEV] [RFC] [Discussion] DOM HTML5 parsing and serialization support

2023-09-21 Thread Dennis Snell via internals
only guide people to use these classes safely, but also to teach some of the nuances that have historically been overlooked in PHP’s HTML handling, e.g. `html_entity_decode()` is unaware of of the ambiguous ampersand and offers no way to correctly parse certain kinds of invalid named character r

[PHP-DEV] Re: [RFC] [Discussion] DOM HTML5 parsing and serialization support

2023-09-06 Thread Dennis Snell via internals
> On Sep 4, 2023, at 1:15 PM, Niels Dossche wrote: > > On 04/09/2023 21:54, Dennis Snell wrote: >> Thanks for the proposal Niels, >> >> I’ve dealt with my own grief working through issues in DOMDocument and >> wanting it to work but finding it inadequate. &

[PHP-DEV] Re: [RFC] [Discussion] DOM HTML5 parsing and serialization support

2023-09-04 Thread Dennis Snell via internals
hin WordPress so we can clean up decades’ old problems with encoding, decoding, security, and sanitization. Warmly, Dennis Snell > On Sep 2, 2023, at 12:41 PM, Niels Dossche <mailto:dossche.ni...@gmail.com>> wrote: > > I'm opening the discussion for my RFC "DOM HTML5 parsi