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->new() shouldn't create an URI::tel object #50

Open
nfg opened this issue Mar 7, 2018 · 2 comments
Open

URI->new() shouldn't create an URI::tel object #50

nfg opened this issue Mar 7, 2018 · 2 comments

Comments

@nfg
Copy link

nfg commented Mar 7, 2018

Hello!

I ran into a case where URI->new() behaves weirdly. If URI::tel (which doesn't inherit from URI) is installed, then it will build the wrong object:

my $uri = URI->new('tel:+16045551234');
print Dumper($uri);
print $uri->scheme();

__END__
OUTPUT:
$VAR1 = bless( {
                 'telephone_uri' => 'tel:tel:+16045551234'
               }, 'URI::tel' );
Can't locate object method "scheme" via package "URI::tel" at test.pl line 11.

The bug is really that URI::tel should be in a different namespace. But short of that, URI could probably check that any scheme-specific classes are subclasses before using them.

Cheers!

@nfg
Copy link
Author

nfg commented Apr 2, 2018

As per my comment in #51 , I've reported the bug to the URI::tel distro: https://rt.cpan.org/Public/Bug/Display.html?id=124996

I'm not entirely sure if I should close this, so I'll leave it up to you. Cheers, eh!

@oalders
Copy link
Member

oalders commented Apr 2, 2018

I suppose one option would be to bring that module into the URI distribution directly. Let's leave this open for the time being.

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