Typofixes
This commit is contained in:
parent
b3119b3157
commit
1de2b6c53f
@ -227,7 +227,7 @@ if ( isset( $_GET['u'] ) or isset( $_GET['up'] ) ) {
|
|||||||
$display_on_page = ( $offset + 1 );
|
$display_on_page = ( $offset + 1 );
|
||||||
}
|
}
|
||||||
|
|
||||||
// Determing Total Amount Of Pages
|
// Determining Total Amount Of Pages
|
||||||
$total_pages = ceil( $total_items / $perpage );
|
$total_pages = ceil( $total_items / $perpage );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -47,7 +47,7 @@ if( isset( $_GET['action'] ) ) {
|
|||||||
yourls_add_notice( $result );
|
yourls_add_notice( $result );
|
||||||
}
|
}
|
||||||
|
|
||||||
// Handle message upon succesfull (de)activation
|
// Handle message upon successful (de)activation
|
||||||
if( isset( $_GET['success'] ) && ( ( $_GET['success'] == 'activated' ) OR ( $_GET['success'] == 'deactivated' ) ) ) {
|
if( isset( $_GET['success'] ) && ( ( $_GET['success'] == 'activated' ) OR ( $_GET['success'] == 'deactivated' ) ) ) {
|
||||||
if( $_GET['success'] == 'activated' ) {
|
if( $_GET['success'] == 'activated' ) {
|
||||||
$message = yourls__( 'Plugin has been activated' );
|
$message = yourls__( 'Plugin has been activated' );
|
||||||
|
@ -98,7 +98,7 @@ STANDARD_SIMPLE;
|
|||||||
if (r.short_url) {
|
if (r.short_url) {
|
||||||
prompt(r.message, r.short_url);
|
prompt(r.message, r.short_url);
|
||||||
} else {
|
} else {
|
||||||
alert('An error occured: ' + r.message);
|
alert('An error occurred: ' + r.message);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
sc.src = '$base_bookmarklet' + p + '&jsonp=yourls';
|
sc.src = '$base_bookmarklet' + p + '&jsonp=yourls';
|
||||||
@ -166,7 +166,7 @@ CUSTOM_STANDARD;
|
|||||||
if (r.short_url) {
|
if (r.short_url) {
|
||||||
prompt(r.message, r.short_url);
|
prompt(r.message, r.short_url);
|
||||||
} else {
|
} else {
|
||||||
alert('An error occured: ' + r.message);
|
alert('An error occurred: ' + r.message);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
sc.src = '$base_bookmarklet' + p + '&k=' + k + '&jsonp=yourls';
|
sc.src = '$base_bookmarklet' + p + '&k=' + k + '&jsonp=yourls';
|
||||||
@ -247,7 +247,7 @@ TWITTER;
|
|||||||
?>
|
?>
|
||||||
|
|
||||||
<?php $js_code = <<<TUMBLR
|
<?php $js_code = <<<TUMBLR
|
||||||
// Share on Tumlr
|
// Share on Tumblr
|
||||||
var d = document,
|
var d = document,
|
||||||
w = window,
|
w = window,
|
||||||
enc = encodeURIComponent,
|
enc = encodeURIComponent,
|
||||||
|
@ -44,7 +44,7 @@ if ( isset( $_GET['dismiss'] ) && $_GET['dismiss'] == 'hasherror' ) {
|
|||||||
if ( yourls_maybe_hash_passwords() ) {
|
if ( yourls_maybe_hash_passwords() ) {
|
||||||
$hash = yourls_hash_passwords_now( YOURLS_CONFIGFILE );
|
$hash = yourls_hash_passwords_now( YOURLS_CONFIGFILE );
|
||||||
if ( $hash === true ) {
|
if ( $hash === true ) {
|
||||||
// Hashing succesful. Remove flag from DB if any.
|
// Hashing successful. Remove flag from DB if any.
|
||||||
if( yourls_get_option( 'defer_hashing_error' ) )
|
if( yourls_get_option( 'defer_hashing_error' ) )
|
||||||
yourls_delete_option( 'defer_hashing_error' );
|
yourls_delete_option( 'defer_hashing_error' );
|
||||||
} else {
|
} else {
|
||||||
|
@ -639,7 +639,7 @@ function yourls_normalize_uri( $url ) {
|
|||||||
$lower['host'] = mb_strtolower($parts['host']);
|
$lower['host'] = mb_strtolower($parts['host']);
|
||||||
/**
|
/**
|
||||||
* Convert IDN domains to their UTF8 form so that طارق.net and xn--mgbuq0c.net
|
* Convert IDN domains to their UTF8 form so that طارق.net and xn--mgbuq0c.net
|
||||||
* are considered the same. Explicitely mention option and variant to avoid notice
|
* are considered the same. Explicitly mention option and variant to avoid notice
|
||||||
* on PHP 7.2 and 7.3
|
* on PHP 7.2 and 7.3
|
||||||
*/
|
*/
|
||||||
$lower['host'] = idn_to_utf8($lower['host'], IDNA_DEFAULT, INTL_IDNA_VARIANT_UTS46);
|
$lower['host'] = idn_to_utf8($lower['host'], IDNA_DEFAULT, INTL_IDNA_VARIANT_UTS46);
|
||||||
|
@ -406,7 +406,7 @@ function yourls_update_table_to_14() {
|
|||||||
if( $count != $queries ) {
|
if( $count != $queries ) {
|
||||||
$success = false;
|
$success = false;
|
||||||
$num = $count - $queries;
|
$num = $count - $queries;
|
||||||
echo "<p>$num error(s) occured while updating the URL table :(</p>";
|
echo "<p>$num error(s) occurred while updating the URL table :(</p>";
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( $count == $chunk ) {
|
if ( $count == $chunk ) {
|
||||||
|
@ -290,7 +290,7 @@ function yourls_redirect_shorturl($url, $keyword) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Send headers to explicitely tell browser not to cache content or redirection
|
* Send headers to explicitly tell browser not to cache content or redirection
|
||||||
*
|
*
|
||||||
* @since 1.7.10
|
* @since 1.7.10
|
||||||
* @return void
|
* @return void
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
/*
|
/*
|
||||||
* This is an example file for a public interface and a bookmarklet. It
|
* This is an example file for a public interface and a bookmarklet. It
|
||||||
* is provided so you can build from it and customize to suit your needs.
|
* is provided so you can build from it and customize to suit your needs.
|
||||||
* It's not really part of the project. Don't submit feature requests
|
* It's not really part of the project. Don't submit feature requests
|
||||||
* about this file. It's _your_ job to make it what you need it to be :)
|
* about this file. It's _your_ job to make it what you need it to be :)
|
||||||
*
|
*
|
||||||
* Rename to .php
|
* Rename to .php
|
||||||
@ -27,19 +27,19 @@ if ( isset( $_REQUEST['url'] ) && $_REQUEST['url'] != 'http://' ) {
|
|||||||
|
|
||||||
// Create short URL, receive array $return with various information
|
// Create short URL, receive array $return with various information
|
||||||
$return = yourls_add_new_link( $url, $keyword, $title );
|
$return = yourls_add_new_link( $url, $keyword, $title );
|
||||||
|
|
||||||
$shorturl = isset( $return['shorturl'] ) ? $return['shorturl'] : '';
|
$shorturl = isset( $return['shorturl'] ) ? $return['shorturl'] : '';
|
||||||
$message = isset( $return['message'] ) ? $return['message'] : '';
|
$message = isset( $return['message'] ) ? $return['message'] : '';
|
||||||
$title = isset( $return['title'] ) ? $return['title'] : '';
|
$title = isset( $return['title'] ) ? $return['title'] : '';
|
||||||
$status = isset( $return['status'] ) ? $return['status'] : '';
|
$status = isset( $return['status'] ) ? $return['status'] : '';
|
||||||
|
|
||||||
// Stop here if bookmarklet with a JSON callback function ("instant" bookmarklets)
|
// Stop here if bookmarklet with a JSON callback function ("instant" bookmarklets)
|
||||||
if( isset( $_GET['jsonp'] ) && $_GET['jsonp'] == 'yourls' ) {
|
if( isset( $_GET['jsonp'] ) && $_GET['jsonp'] == 'yourls' ) {
|
||||||
$short = $return['shorturl'] ? $return['shorturl'] : '';
|
$short = $return['shorturl'] ? $return['shorturl'] : '';
|
||||||
$message = "Short URL (Ctrl+C to copy)";
|
$message = "Short URL (Ctrl+C to copy)";
|
||||||
header('Content-type: application/json');
|
header('Content-type: application/json');
|
||||||
echo yourls_apply_filter( 'bookmarklet_jsonp', "yourls_callback({'short_url':'$short','message':'$message'});" );
|
echo yourls_apply_filter( 'bookmarklet_jsonp', "yourls_callback({'short_url':'$short','message':'$message'});" );
|
||||||
|
|
||||||
die();
|
die();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -60,11 +60,11 @@ if ( isset( $_REQUEST['url'] ) && $_REQUEST['url'] != 'http://' ) {
|
|||||||
if( isset( $message ) ) {
|
if( isset( $message ) ) {
|
||||||
echo "<h2>$message</h2>";
|
echo "<h2>$message</h2>";
|
||||||
}
|
}
|
||||||
|
|
||||||
if( $status == 'success' ) {
|
if( $status == 'success' ) {
|
||||||
// Include the Copy box and the Quick Share box
|
// Include the Copy box and the Quick Share box
|
||||||
yourls_share_box( $url, $shorturl, $title, $text );
|
yourls_share_box( $url, $shorturl, $title, $text );
|
||||||
|
|
||||||
// Initialize clipboard -- requires js/share.js and js/clipboard.min.js to be properly loaded in the <head>
|
// Initialize clipboard -- requires js/share.js and js/clipboard.min.js to be properly loaded in the <head>
|
||||||
echo "<script>init_clipboard();</script>\n";
|
echo "<script>init_clipboard();</script>\n";
|
||||||
}
|
}
|
||||||
@ -73,7 +73,7 @@ if ( isset( $_REQUEST['url'] ) && $_REQUEST['url'] != 'http://' ) {
|
|||||||
} else {
|
} else {
|
||||||
|
|
||||||
$site = YOURLS_SITE;
|
$site = YOURLS_SITE;
|
||||||
|
|
||||||
// Display the form
|
// Display the form
|
||||||
echo <<<HTML
|
echo <<<HTML
|
||||||
<h2>Enter a new URL to shorten</h2>
|
<h2>Enter a new URL to shorten</h2>
|
||||||
@ -82,7 +82,7 @@ if ( isset( $_REQUEST['url'] ) && $_REQUEST['url'] != 'http://' ) {
|
|||||||
<p><label>Optional custom short URL: $site/<input type="text" class="text" name="keyword" /></label></p>
|
<p><label>Optional custom short URL: $site/<input type="text" class="text" name="keyword" /></label></p>
|
||||||
<p><label>Optional title: <input type="text" class="text" name="title" /></label></p>
|
<p><label>Optional title: <input type="text" class="text" name="title" /></label></p>
|
||||||
<p><input type="submit" class="button primary" value="Shorten" /></p>
|
<p><input type="submit" class="button primary" value="Shorten" /></p>
|
||||||
</form>
|
</form>
|
||||||
HTML;
|
HTML;
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -99,9 +99,9 @@ HTML;
|
|||||||
|
|
||||||
<a href="javascript:(function()%7Bvar%20d=document,w=window,enc=encodeURIComponent,e=w.getSelection,k=d.getSelection,x=d.selection,s=(e?e():(k)?k():(x?x.createRange().text:0)),s2=((s.toString()=='')?s:enc(s)),f='<?php echo $page; ?>',l=d.location,k=prompt(%22Custom%20URL%22),k2=(k?'&keyword='+k:%22%22),p='?url='+enc(l.href)+'&title='+enc(d.title)+'&text='+s2+k2,u=f+p;if(k!=null)%7Btry%7Bthrow('ozhismygod');%7Dcatch(z)%7Ba=function()%7Bif(!w.open(u))l.href=u;%7D;if(/Firefox/.test(navigator.userAgent))setTimeout(a,0);else%20a();%7Dvoid(0)%7D%7D)()" class="bookmarklet">Custom</a>
|
<a href="javascript:(function()%7Bvar%20d=document,w=window,enc=encodeURIComponent,e=w.getSelection,k=d.getSelection,x=d.selection,s=(e?e():(k)?k():(x?x.createRange().text:0)),s2=((s.toString()=='')?s:enc(s)),f='<?php echo $page; ?>',l=d.location,k=prompt(%22Custom%20URL%22),k2=(k?'&keyword='+k:%22%22),p='?url='+enc(l.href)+'&title='+enc(d.title)+'&text='+s2+k2,u=f+p;if(k!=null)%7Btry%7Bthrow('ozhismygod');%7Dcatch(z)%7Ba=function()%7Bif(!w.open(u))l.href=u;%7D;if(/Firefox/.test(navigator.userAgent))setTimeout(a,0);else%20a();%7Dvoid(0)%7D%7D)()" class="bookmarklet">Custom</a>
|
||||||
|
|
||||||
<a href="javascript:(function()%7Bvar%20d=document,s=d.createElement('script');window.yourls_callback=function(r)%7Bif(r.short_url)%7Bprompt(r.message,r.short_url);%7Delse%7Balert('An%20error%20occured:%20'+r.message);%7D%7D;s.src='<?php echo $page; ?>?url='+encodeURIComponent(d.location.href)+'&jsonp=yourls';void(d.body.appendChild(s));%7D)();" class="bookmarklet">Popup</a>
|
<a href="javascript:(function()%7Bvar%20d=document,s=d.createElement('script');window.yourls_callback=function(r)%7Bif(r.short_url)%7Bprompt(r.message,r.short_url);%7Delse%7Balert('An%20error%20occurred:%20'+r.message);%7D%7D;s.src='<?php echo $page; ?>?url='+encodeURIComponent(d.location.href)+'&jsonp=yourls';void(d.body.appendChild(s));%7D)();" class="bookmarklet">Popup</a>
|
||||||
|
|
||||||
<a href="javascript:(function()%7Bvar%20d=document,k=prompt('Custom%20URL'),s=d.createElement('script');if(k!=null){window.yourls_callback=function(r)%7Bif(r.short_url)%7Bprompt(r.message,r.short_url);%7Delse%7Balert('An%20error%20occured:%20'+r.message);%7D%7D;s.src='<?php echo $page; ?>?url='+encodeURIComponent(d.location.href)+'&keyword='+k+'&jsonp=yourls';void(d.body.appendChild(s));%7D%7D)();" class="bookmarklet">Custom Popup</a>
|
<a href="javascript:(function()%7Bvar%20d=document,k=prompt('Custom%20URL'),s=d.createElement('script');if(k!=null){window.yourls_callback=function(r)%7Bif(r.short_url)%7Bprompt(r.message,r.short_url);%7Delse%7Balert('An%20error%20occurred:%20'+r.message);%7D%7D;s.src='<?php echo $page; ?>?url='+encodeURIComponent(d.location.href)+'&keyword='+k+'&jsonp=yourls';void(d.body.appendChild(s));%7D%7D)();" class="bookmarklet">Custom Popup</a>
|
||||||
|
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
@ -112,4 +112,4 @@ HTML;
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
// Display page footer
|
// Display page footer
|
||||||
yourls_html_footer();
|
yourls_html_footer();
|
||||||
|
@ -32,7 +32,7 @@ class Install_Tests extends PHPUnit\Framework\TestCase {
|
|||||||
* - success messages: the table are created with a "CREATE IF NOT EXISTS",
|
* - success messages: the table are created with a "CREATE IF NOT EXISTS",
|
||||||
* hence, will not be recreated once more, they're already created
|
* hence, will not be recreated once more, they're already created
|
||||||
* upon install procedure
|
* upon install procedure
|
||||||
* - error messages: the function cannot initalize options and links, since
|
* - error messages: the function cannot initialize options and links, since
|
||||||
* they have been populated during install procedure as well
|
* they have been populated during install procedure as well
|
||||||
*
|
*
|
||||||
* A more thorough test would be to mockup the DB connection and create another
|
* A more thorough test would be to mockup the DB connection and create another
|
||||||
|
@ -39,7 +39,7 @@ class Translation_Translation_Tests extends PHPUnit\Framework\TestCase {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Check an unstranslated string
|
* Check an untranslated string
|
||||||
*
|
*
|
||||||
* @since 0.1
|
* @since 0.1
|
||||||
*/
|
*/
|
||||||
|
@ -92,7 +92,7 @@ class GetRequest_Tests extends PHPUnit\Framework\TestCase {
|
|||||||
array('behemoth', 'http://sho.rt/behemoth', '/behemoth/behemoth?behemoth'),
|
array('behemoth', 'http://sho.rt/behemoth', '/behemoth/behemoth?behemoth'),
|
||||||
|
|
||||||
|
|
||||||
// "Prefix and shorten" scenariis (query strings which should be preserved)
|
// "Prefix and shorten" scenarios (query strings which should be preserved)
|
||||||
array('http://longurl', 'http://sho.rt', '/http://longurl'),
|
array('http://longurl', 'http://sho.rt', '/http://longurl'),
|
||||||
array('http://longurl', 'https://sho.rt/yourls', '/yourls/http://longurl'),
|
array('http://longurl', 'https://sho.rt/yourls', '/yourls/http://longurl'),
|
||||||
array('http://longurl?https://sho.rt/yourls', 'https://sho.rt/yourls', '/yourls/http://longurl?https://sho.rt/yourls'),
|
array('http://longurl?https://sho.rt/yourls', 'https://sho.rt/yourls', '/yourls/http://longurl?https://sho.rt/yourls'),
|
||||||
|
Loading…
x
Reference in New Issue
Block a user