Plugin Directory

Changeset 1665260


Ignore:
Timestamp:
05/26/2017 07:41:33 AM (9 years ago)
Author:
mideal
Message:

added checking email input

Location:
question-answer-faq
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • question-answer-faq/tags/1.1.1/mideal-faq.php

    r1665258 r1665260  
    292292    if ( ! isset( $_POST['mideal_faq_answer'] ) ) return $post_id;
    293293   
    294     $my_data = sanitize_text_field( nl2br($_POST['mideal_faq_answer']) );
     294    $my_data = sanitize_text_field( $_POST['mideal_faq_answer'] );
    295295    $my_data2 = sanitize_email( $_POST['mideal_faq_email'] );
    296296
     
    498498    $post_id = wp_insert_post( $post_data );
    499499    if( $post_id ){
    500         $user_email = sanitize_email( $_POST['mideal_faq_email']);
    501         update_post_meta( $post_id, 'mideal_faq_email', $user_email );
     500        if( is_email( $_POST['mideal_faq_email'] ) ){
     501            $user_email = sanitize_email( $_POST['mideal_faq_email']);
     502            update_post_meta( $post_id, 'mideal_faq_email', $user_email );
     503        }
    502504
    503505
  • question-answer-faq/trunk/mideal-faq.php

    r1665258 r1665260  
    292292    if ( ! isset( $_POST['mideal_faq_answer'] ) ) return $post_id;
    293293   
    294     $my_data = sanitize_text_field( nl2br($_POST['mideal_faq_answer']) );
     294    $my_data = sanitize_text_field( $_POST['mideal_faq_answer'] );
    295295    $my_data2 = sanitize_email( $_POST['mideal_faq_email'] );
    296296
     
    498498    $post_id = wp_insert_post( $post_data );
    499499    if( $post_id ){
    500         $user_email = sanitize_email( $_POST['mideal_faq_email']);
    501         update_post_meta( $post_id, 'mideal_faq_email', $user_email );
     500        if( is_email( $_POST['mideal_faq_email'] ) ){
     501            $user_email = sanitize_email( $_POST['mideal_faq_email']);
     502            update_post_meta( $post_id, 'mideal_faq_email', $user_email );
     503        }
    502504
    503505
Note: See TracChangeset for help on using the changeset viewer.