Skip to content
This repository has been archived by the owner on Jan 31, 2020. It is now read-only.

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

Open
FabianRahm opened this issue Sep 1, 2016 · 5 comments
Open

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

FabianRahm opened this issue Sep 1, 2016 · 5 comments

Comments

@FabianRahm
Copy link

FabianRahm commented Sep 1, 2016

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

@FabianRahm
Copy link
Author

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

@Ocramius
Copy link
Member

Ocramius commented Sep 1, 2016

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

@FabianRahm
Copy link
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.

@vincentvandijk
Copy link

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

@weierophinney
Copy link
Member

This repository has been closed and moved to laminas/laminas-uri; a new issue has been opened at laminas/laminas-uri#4.

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

No branches or pull requests

4 participants