Explorar o código

AltoFocus: Adds a check to make sure $featured_ids variable is an array, Fixes an php 7.2 issue that I got pinged about from systems

Allan Cole %!s(int64=7) %!d(string=hai) anos
pai
achega
454321e221
Modificáronse 1 ficheiros con 6 adicións e 1 borrados
  1. 6 1
      altofocus/inc/jetpack.php

+ 6 - 1
altofocus/inc/jetpack.php

@@ -142,7 +142,12 @@ function altofocus_get_featured_post_ids() {
 	}
 
 	// Ensure correct format before return.
-	return array_map( 'absint', $featured_ids );
+	if ( ! is_array( $featured_ids ) ) {
+		return;
+	} else {
+		return array_map( 'absint', $featured_ids );
+	}
+
 }
 
 /**