Due to custom storage needs (the "why" is not important here, thanks!) I have to save html <a>
links in a specific format such as this:
myDOMNode->setAttribute("href", "{{{123456}}}");
Everything works fine until i call saveHTML()
on the containing DOMDocument. This kills it, since it encodes {
in %7B
.
This is a legacy application where href="{{{123456}}}" works as a placeholder. The command-line parser look for this pattern exactly (unencoded) and cannot be changed.
I've no choice but to do it this way.
I cannot htmldecode() the result.
This HTML will never be displayed as this, it is just a storage need.
Thanks for your help!
Note: I've looked around for 2 hours but none of the proposed solution worked for me. For those who will blindly mark the question as duplicate: please comment and let me know.
html_entity_decode()
after thesaveHTML()
and before you send it to the command line parser? – Gardia