Skip to content

Commit d4337e0

Browse files
committed
Fix: sanitize_array getting null arg instead of array
1 parent 7afc6f1 commit d4337e0

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

classes/Course.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -535,8 +535,8 @@ public function save_course_meta( $post_ID, $post ) {
535535
// Additional data like course intro video.
536536
if ( $additional_data_edit ) {
537537
// Sanitize data through helper method.
538-
$video = Input::sanitize_array(
539-
$_POST['video'], //phpcs:ignore
538+
$video = Input::sanitize_array(
539+
$_POST['video'] ?? array(), //phpcs:ignore
540540
array(
541541
'source_external_url' => 'esc_url',
542542
'source_embedded' => 'wp_kses_post',

classes/Lesson.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,7 @@ public function save_lesson_meta( $post_ID ) {
173173

174174
// Sanitize data through helper method.
175175
$video = Input::sanitize_array(
176-
$_POST['video'], //phpcs:ignore
176+
$_POST['video'] ?? array(), //phpcs:ignore
177177
array(
178178
'source_external_url' => 'esc_url',
179179
'source_embedded' => 'wp_kses_post',

0 commit comments

Comments
 (0)