[ PATCH ] – Undefined index post_type in wiki/wiki.php L1816
-
Using this plugin on a task, came across this little gem:
function name_save($post_name) { if ($_POST['post_type'] == 'incsub_wiki' && empty($post_name)) { $post_name = $_POST['post_title']; } return $post_name; }
Needs to check if both array keys are set first, before assuming they are, like so:
function name_save($post_name) { if ( isset( $_POST['post_type'] ) && $_POST['post_type'] == 'incsub_wiki' && empty($post_name)) { if ( ! isset( $_POST['post_title'] ) ) { return $post_name; } $post_name = $_POST['post_title']; } return $post_name; }
Please fix this, my debug.log is getting flooded during a WP-CLI import…
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘[ PATCH ] – Undefined index post_type in wiki/wiki.php L1816’ is closed to new replies.