]> CyberLeo.Net >> Repos - Github/YOURLS.git/blob - includes/functions-deprecated.php
Allow editing of URLs containing %
[Github/YOURLS.git] / includes / functions-deprecated.php
1 <?php
2 /**
3  * Deprecated functions from past YOURLS versions. Don't use them, as they may be
4  * removed in a later version. Use the newer alternatives instead.
5  *
6  * Note to devs: when deprecating a function, move it here. Then check all the places
7  * in core that might be using it, including core plugins.
8  */
9
10 /**
11  * Return word or words if more than one
12  *
13  */
14 function yourls_plural( $word, $count=1 ) {
15         yourls_deprecated_function( __FUNCTION__, '1.6', 'yourls_n' );
16         return $word . ($count > 1 ? 's' : '');
17 }
18
19 /**
20  * Return list of all shorturls associated to the same long URL. Returns NULL or array of keywords.
21  *
22  */
23 function yourls_get_duplicate_keywords( $longurl ) {
24         yourls_deprecated_function( __FUNCTION__, '1.7', 'yourls_get_longurl_keywords' );
25         if( !yourls_allow_duplicate_longurls() )
26                 return NULL;
27         return yourls_apply_filter( 'get_duplicate_keywords', yourls_get_longurl_keywords ( $longurl ), $longurl );
28 }
29
30 /**
31  * Make sure a integer is safe
32  * 
33  * Note: this function is dumb and dumbly named since it does not intval(). DO NOT USE.
34  *
35  */
36 function yourls_intval( $in ) {
37         yourls_deprecated_function( __FUNCTION__, '1.7', 'yourls_sanitize_int' );
38         return yourls_escape( $in );
39 }
40
41 /**
42  * Get remote content via a GET request using best transport available
43  *
44  */
45 function yourls_get_remote_content( $url,  $maxlen = 4096, $timeout = 5 ) {
46         yourls_deprecated_function( __FUNCTION__, '1.7', 'yourls_http_get_body' );
47         return yourls_http_get_body( $url );
48 }
49
50 /**
51  * Alias for yourls_apply_filter because I never remember if it's _filter or _filters
52  *
53  * At first I thought it made semantically more sense but thinking about it, I was wrong. It's one filter.
54  * There may be several function hooked into it, but it still the same one filter.
55  *
56  * @since 1.6
57  * @deprecated 1.7.1
58  *
59  * @param string $hook the name of the YOURLS element or action
60  * @param mixed $value the value of the element before filtering
61  * @return mixed
62  */
63 function yourls_apply_filters( $hook, $value = '' ) {
64         yourls_deprecated_function( __FUNCTION__, '1.7.1', 'yourls_apply_filter' );
65         return yourls_apply_filter( $hook, $value );
66 }
67
68