Assume that url_shorten() receives unslashed data, as it does in core usage. see #21767.
git-svn-id: http://core.svn.wordpress.org/trunk@23575 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
6c82b54070
commit
4e06d41b9f
|
@ -220,8 +220,7 @@ add_action( 'update_option_page_on_front', 'update_home_siteurl', 10, 2 );
|
||||||
* @return string
|
* @return string
|
||||||
*/
|
*/
|
||||||
function url_shorten( $url ) {
|
function url_shorten( $url ) {
|
||||||
$short_url = str_replace( 'http://', '', wp_unslash( $url ));
|
$short_url = str_replace( array( 'http://', 'www.' ), '', $short_url );
|
||||||
$short_url = str_replace( 'www.', '', $short_url );
|
|
||||||
$short_url = untrailingslashit( $short_url );
|
$short_url = untrailingslashit( $short_url );
|
||||||
if ( strlen( $short_url ) > 35 )
|
if ( strlen( $short_url ) > 35 )
|
||||||
$short_url = substr( $short_url, 0, 32 ) . '...';
|
$short_url = substr( $short_url, 0, 32 ) . '...';
|
||||||
|
|
Loading…
Reference in New Issue