From d71c09490d0085cd9bebb0076ba053c98eb5e9a6 Mon Sep 17 00:00:00 2001 From: patrickebates Date: Tue, 22 Apr 2014 13:08:56 -0500 Subject: [PATCH] Replace LENGTH with proper LEN command --- wp-includes/ms-load.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/wp-includes/ms-load.php b/wp-includes/ms-load.php index 4055ec749..9116b137f 100644 --- a/wp-includes/ms-load.php +++ b/wp-includes/ms-load.php @@ -216,7 +216,7 @@ function get_network_by_path( $domain, $path, $segments = null ) { if ( ! $using_paths ) { $network = $wpdb->get_row( "SELECT TOP 1 id, domain, path FROM $wpdb->site - WHERE domain IN ($search_domains) ORDER BY LENGTH(domain) DESC" ); + WHERE domain IN ($search_domains) ORDER BY LEN(domain) DESC" ); if ( $network ) { return wp_get_network( $network ); } @@ -226,7 +226,7 @@ function get_network_by_path( $domain, $path, $segments = null ) { $search_paths = "'" . implode( "', '", $wpdb->_escape( $paths ) ) . "'"; $networks = $wpdb->get_results( "SELECT id, domain, path FROM $wpdb->site WHERE domain IN ($search_domains) AND path IN ($search_paths) - ORDER BY LENGTH(domain) DESC, LENGTH(path) DESC" ); + ORDER BY LEN(domain) DESC, LEN(path) DESC" ); } /* @@ -351,7 +351,7 @@ function get_site_by_path( $domain, $path, $segments = null ) { if ( count( $paths ) > 1 ) { $paths = "'" . implode( "', '", $wpdb->_escape( $paths ) ) . "'"; $sql = $wpdb->prepare( "SELECT TOP 1 * FROM $wpdb->blogs WHERE domain = %s", $domain ); - $sql .= " AND path IN ($paths) ORDER BY LENGTH(path) DESC"; + $sql .= " AND path IN ($paths) ORDER BY LEN(path) DESC"; $site = $wpdb->get_row( $sql ); } else { $site = $wpdb->get_row( $wpdb->prepare( "SELECT * FROM $wpdb->blogs WHERE domain = %s and path = %s", $domain, $paths[0] ) );