Upload files to 'includes'

This commit is contained in:
2022-10-30 14:11:56 -07:00
parent 5e82f002b9
commit bd403ce047
19 changed files with 532 additions and 245 deletions

View File

@ -5,10 +5,61 @@
*
* Note to devs: when deprecating a function, move it here. Then check all the places
* in core that might be using it, including core plugins.
*
* Usage : yourls_deprecated_function( 'function_name', 'version', 'replacement' );
* Output: "{function_name} is deprecated since version {version}! Use {replacement} instead."
*
* Usage : yourls_deprecated_function( 'function_name', 'version' );
* Output: "{function_name} is deprecated since version {version} with no alternative available."
*
* @see yourls_deprecated_function()
*/
// @codeCoverageIgnoreStart
/**
* Return current admin page, or null if not an admin page. Was not used anywhere.
*
* @return mixed string if admin page, null if not an admin page
* @since 1.6
* @deprecated 1.9.1
*/
function yourls_current_admin_page() {
yourls_deprecated_function( __FUNCTION__, '1.9.1' );
if( yourls_is_admin() ) {
$current = substr( yourls_get_request(), 6 );
if( $current === false )
$current = 'index.php'; // if current page is http://sho.rt/admin/ instead of http://sho.rt/admin/index.php
return $current;
}
return null;
}
/**
* PHP emulation of JS's encodeURI
*
* @link https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/encodeURI
* @deprecated 1.9.1
* @param string $url
* @return string
*/
function yourls_encodeURI($url) {
yourls_deprecated_function( __FUNCTION__, '1.9.1', '' );
// Decode URL all the way
$result = yourls_rawurldecode_while_encoded( $url );
// Encode once
$result = strtr( rawurlencode( $result ), array (
'%3B' => ';', '%2C' => ',', '%2F' => '/', '%3F' => '?', '%3A' => ':', '%40' => '@',
'%26' => '&', '%3D' => '=', '%2B' => '+', '%24' => '$', '%21' => '!', '%2A' => '*',
'%27' => '\'', '%28' => '(', '%29' => ')', '%23' => '#',
) );
// @TODO:
// Known limit: this will most likely break IDN URLs such as http://www.académie-française.fr/
// To fully support IDN URLs, advocate use of a plugin.
return yourls_apply_filter( 'encodeURI', $result, $url );
}
/**
* Check if a file is a plugin file
*