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

shortening tries to access the long URL #1966

Closed
tessus opened this issue Oct 17, 2015 · 5 comments
Closed

shortening tries to access the long URL #1966

tessus opened this issue Oct 17, 2015 · 5 comments

Comments

@tessus
Copy link

tessus commented Oct 17, 2015

Apache 2.2.29, PHP 5.6.10
Apache 2.4.16, PHP 5.6.14
Yourls 1.7.1 (git 858576b)

When I shorten a link via the admin interface or the firefox plugin, the httpd process tries to connect to the URL, which is to be shortened.

Why would the PHP code try to connect to the long URL during the shortening process?
This is definitely not necessary (because the shortening even works, when blocking the outgoing connection) and a privacy issue.

Can you please comment on this strange behavior?

@dgw
Copy link
Member

dgw commented Oct 17, 2015

YOURLS fetches the page title of any URL shortened through it. The Static Titles plugin might be able to disable this, but it was last updated almost two years ago: https://github.com/softius/yourls-static-titles

@tessus
Copy link
Author

tessus commented Oct 17, 2015

@dgw thanks for the info.

But I really think that this is a serious privacy issue and there should be a config option to disable this.

@ozh
Copy link
Member

ozh commented Oct 17, 2015

Indeed, it's not necessary regarding the shortening process itself. It's necessary to get a title for each shortened link.

If you feel this is an unacceptable tradeoff (privacy vs having a title) then a simple plugin will do. Either YOURLS Static Titles as mentionned, or more blunt approach:

<?php
/*
Plugin Name: No URL Title
Description: Don't fetch long URL titles
Version: 1.0
Author: Ozh
Author URI: http://ozh.org/
*/

yourls_add_filter( 'shunt_get_remote_title', 'ozh_nourltitle');

function ozh_nourltitle( $false, $url ) {
    return $url;
}

By the way this is typically the kind of situation where there won't be a config option. 99% of people don't need that, that's what the plugin API is for.

@ozh ozh closed this as completed Oct 17, 2015
@tessus
Copy link
Author

tessus commented Oct 18, 2015

@ozh thank you. this works great.

@McFcologne

This comment was marked as off-topic.

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

4 participants