Skip to content
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

Problems with ampersands in posted links and/or posted text #2

Open
wcz-txp opened this issue Feb 21, 2018 · 3 comments
Open

Problems with ampersands in posted links and/or posted text #2

wcz-txp opened this issue Feb 21, 2018 · 3 comments
Labels

Comments

@wcz-txp
Copy link

wcz-txp commented Feb 21, 2018

phpbb-seo/meta in phpbb 3.2.2 with php 7.0.27

If a posted text contains ampersands somewhere in the text or in a posted link, than meta is causing this error for simple ampersands inside the posted text:

[phpBB Debug] PHP Warning: in file [ROOT]/vendor/s9e/text-formatter/src/Utils.php on line 76: DOMDocument::loadXML(): xmlParseEntityRef: no name in Entity, line: 1

and an error like this for ampersands inside posted links:

[phpBB Debug] PHP Warning: in file [ROOT]/vendor/s9e/text-formatter/src/Utils.php on line 76: DOMDocument::loadXML(): EntityRef: expecting ';' in Entity, line: 10

@meis2m meis2m added the bug label Mar 7, 2018
@meis2m
Copy link
Member

meis2m commented Mar 7, 2018

check it again with this fix?
d64d141

@wcz-txp
Copy link
Author

wcz-txp commented Mar 7, 2018

You meant replacing this:
static $find = array('<', '>', '"'), $replace = array('&lt;', '&gt;', '&quot;'); return str_replace($find, $replace, preg_replace('&(?!([a-z0-9]+;))', '&amp;', $string));

Yeah, it works, but there is still this problem with censoring text.

@meis2m
Copy link
Member

meis2m commented Mar 7, 2018

i am working on it, if you find a solution tell me... :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants