I've merged some code from YOURLS, but the SATANIC bookmarklets still do not work. Ugh.

This commit is contained in:
Tom Slominski
2013-11-02 00:44:41 +00:00
parent 2f98a2707c
commit cf605a9ec5
2 changed files with 14 additions and 4 deletions

View File

@@ -15,6 +15,16 @@ $shorturl = isset( $return['shorturl'] ) ? $return['shorturl'] : '';
$message = isset( $return['message'] ) ? $return['message'] : '';
$title = isset( $return['title'] ) ? $return['title'] : '';
// Stop here if bookmarklet with a JSON callback function ("instant" bookmarklets)
if( isset( $_GET['jsonp'] ) && $_GET['jsonp'] == 'yourls' ) {
$short = $return['shorturl'] ? $return['shorturl'] : '';
$message = "Short URL (Ctrl+C to copy)";
header('Content-type: application/json');
echo yourls_apply_filter( 'bookmarklet_jsonp', "yourls_callback({'short_url':'$short','message':'$message'});" );
die();
}
?>
<!-- Error reporting -->