diff --git a/wp-includes/general-template.php b/wp-includes/general-template.php
index 33fcfbb..e7dedfa 100644
--- a/wp-includes/general-template.php
+++ b/wp-includes/general-template.php
@@ -1723,11 +1723,9 @@ function wp_get_archives( $args = '' ) {
 		$r['type'] = 'monthly';
 	}
 
-	if ( ! empty( $r['limit'] ) ) {
-		$r['limit'] = absint( $r['limit'] );
-		$r['limit'] = ' LIMIT ' . $r['limit'];
-	}
-
+	$r['limit'] = is_numeric( $r['limit'] ) ? absint( $r['limit'] ) : 0;
+	$r['limit'] = ' LIMIT ' . $r['limit'] : '';
+	
 	$order = strtoupper( $r['order'] );
 	if ( $order !== 'ASC' ) {
 		$order = 'DESC';
