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

XML handle attribute outputs percent symbol after saving entry in Sym 2.7 #2907

Open
cylkee opened this issue Dec 11, 2019 · 2 comments
Open

Comments

@cylkee
Copy link
Contributor

cylkee commented Dec 11, 2019

Affected Symphony version(s) : 2.7.10
PHP version(s) : 7.3.12
OS(es) : Linux

To reproduce, use a core Text Field and input Hello % World. Result in XML is handle="hello-%-world".

This does not appear to affect Sym 2.6.x, A similar test in Sym 2.6.11 saves as handle="hello-world".

@wdebusschere
Copy link

I also have this.

The problem must be in this code:
https://github.com/symphonycms/symphonycms/blob/master/symphony/lib/toolkit/class.general.php#L350

preg_match_all('/[^<>?@:!\-\/\[-`;‘’…]+/u', $string, $matches);

changing it to the previous version fixes this:

preg_match_all('/[^<>?@:!-\/\[-`;‘’…]+/u', $string, $matches);

@cylkee
Copy link
Contributor Author

cylkee commented Jul 1, 2020

@wdebusschere Good spot, thanks.

I think the original version matches ! to /, which includes "#$%&'()*+,-., but escaping the hypen stops matching those additional characters.

8d7df42#diff-7df0f022f38a40206c11fae6e6c5f0b9

FYI, @nitriques @michael-e

Looks like this matching was reversed for 3.0.0 9c43772, although I have not installed 3.0.0 yet.

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

No branches or pull requests

2 participants