diff --git a/wp-includes/class.wp-scripts.php b/wp-includes/class.wp-scripts.php
index 1ceb51d..2076be8 100644
--- a/wp-includes/class.wp-scripts.php
+++ b/wp-includes/class.wp-scripts.php
@@ -160,11 +160,15 @@ class WP_Scripts extends WP_Dependencies {
 			unset($l10n['l10n_print_after']);
 		}
 
-		foreach ( (array) $l10n as $key => $value ) {
-			if ( !is_scalar($value) )
-				continue;
+		if( is_array($l10n) ) {
+			foreach ( $l10n as $key => $value ) {
+				if ( !is_string($value) )
+					continue;
 
-			$l10n[$key] = html_entity_decode( (string) $value, ENT_QUOTES, 'UTF-8');
+				$l10n[$key] = html_entity_decode( $value, ENT_QUOTES, 'UTF-8');
+			}
+		} else if( is_string($l10n) ) {
+			$l10n = html_entity_decode( $l10n, ENT_QUOTES, 'UTF-8');
 		}
 
 		$script = "var $object_name = " . json_encode($l10n) . ';';
