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

Warning: preg_match(): Unknown modifier '/' in Cookie.php on line 440 #526

Closed
Thinkscape opened this issue Jan 10, 2014 · 4 comments
Closed

Comments

@Thinkscape
Copy link
Contributor

Getting those recently:

Warning: preg_match(): Unknown modifier '/' in /app/guzzle/src/Guzzle/Plugin/Cookie/Cookie.php on line 440

Probably because the remote server is sending something stupid as the cookie domain. There is some normalization going on in the plugin, though the error means that something is getting through regardless. We might filter_var() the $cookieDomain against domain name, or something like that...

@mtdowling
Copy link
Member

Interesting. Filtering the domain could work. Do you know exactly what domain was provided when the error occurred, or can you think of a test case for this?

@Thinkscape
Copy link
Contributor Author

I didn't look deeper into it. I'd generally say it's risky to throw
concatenated strings as patterns for preg_match. Maybe it was some ipv6
address? or some international domain? or numeric domain? or something else
weird ... or just garbage in the cookie....

@mtdowling
Copy link
Member

Yeah, that would be a good improvement.

@curtisdf
Copy link

I know it's been 4+ years, but this bug has reappeared. I just submitted a pull request which reapplies the same fix as referenced above. See #1999.

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

3 participants