I've merged some code from YOURLS, but the SATANIC bookmarklets still do not work. Ugh.
This commit is contained in:
10
result.php
10
result.php
@@ -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 -->
|
||||
|
||||
Reference in New Issue
Block a user