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

URI prefix 'android-app://' breaks UriFactory #4

Closed
weierophinney opened this issue Dec 31, 2019 · 5 comments
Closed

URI prefix 'android-app://' breaks UriFactory #4

weierophinney opened this issue Dec 31, 2019 · 5 comments

Comments

@weierophinney
Copy link
Member

Hi,

I'm seeing people accessing my site e.g. over the LinkedIn android app. The original referer is "android-app://com.linkedin.android"

This breaks zend-http which uses zend-uri:

PHP Fatal error: Uncaught Zend\Uri\Exception\InvalidArgumentException: no class registered for scheme "android-app" in .../zendframework/zend-uri/src/UriFactory.php:104

Is it possible to add a scheme?

Regards
fr00x


Originally posted by @fr00x at zendframework/zend-uri#9

@weierophinney
Copy link
Member Author

I properly wrapped my code in a try catch block for now.


Originally posted by @fr00x at zendframework/zend-uri#9 (comment)

@weierophinney
Copy link
Member Author

You have to register a custom scheme yourself, via UriFactory::registerScheme()


Originally posted by @Ocramius at zendframework/zend-uri#9 (comment)

@weierophinney
Copy link
Member Author

Thank you. That makes sense - but since the referrer is user controlled, I have no idea what to register in order to prevent the exception so I needed to catch it in any case.


Originally posted by @fr00x at zendframework/zend-uri#9 (comment)

@weierophinney
Copy link
Member Author

Or just use the getFieldValue method to get the referer value.


Originally posted by @vincentvandijk at zendframework/zend-uri#9 (comment)

@weierophinney
Copy link
Member Author

This package is considered feature-complete, and is now in security-only maintenance mode, following a decision by the Technical Steering Committee.
If you have a security issue, please follow our security reporting guidelines.
If you wish to take on the role of maintainer, please nominate yourself

If you are looking for an actively maintained package alternative, we recommend:

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

1 participant