Plugin Directory

Changeset 863331


Ignore:
Timestamp:
02/23/2014 12:05:51 AM (12 years ago)
Author:
properwp
Message:

0.9.8 - fixing html entity issues, fixing 3.8 wp-admin icon, and adding a redirect after form submit

Location:
proper-contact-form/trunk
Files:
1 added
1 deleted
2 edited

Legend:

Unmodified
Added
Removed
  • proper-contact-form/trunk/proper-contact-form.php

    r838169 r863331  
    44Plugin URI: http://theproperweb.com/shipped/wp/proper-contact-form
    55Description: A better contact form processor
    6 Version: 0.9.7
     6Version: 0.9.8
    77Author: PROPER Development
    88Author URI: http://theproperweb.com
    99License: GPL2
    1010*/
    11 
    1211
    1312// Make sure we don't expose any info if called directly
     
    3938
    4039    // Looking for a submitted form if not redirect
    41     if ( isset( $_SESSION['propercfp_sent'] ) && $_SESSION['propercfp_sent'] === 'yes' ) {
    42         unset( $_SESSION['propercfp_sent'] );
     40    if ( isset( $_GET['pcf'] ) && $_GET['pcf'] == 1 ) {
    4341        return '
    44         <div class="proper_contact_form_wrap">
     42        <div class="proper_contact_thankyou_wrap">
    4543            <h2>' . sanitize_text_field( proper_contact_get_key( 'propercfp_label_submit' ) ) . '</h2>
    4644        </div>';
     
    403401
    404402        $site_email = proper_contact_get_key( 'propercfp_email' );
    405         $site_name  = get_bloginfo( 'name' );
     403        $site_name  = htmlspecialchars_decode( get_bloginfo( 'name' ) );
    406404
    407405        // No name? Use the email address, if one is present
     
    429427        $confirm_body = stripslashes( trim( proper_contact_get_key( 'propercfp_confirm_email' ) ) );
    430428        if ( ! empty( $confirm_body ) && ! empty( $contact_email ) ) {
     429
     430            // Removing entities
     431            $confirm_body = htmlspecialchars_decode( $confirm_body );
     432            $confirm_body = html_entity_decode( $confirm_body );
     433            $confirm_body = str_replace( '&#39;', "'", $confirm_body );
     434
     435            // Send the email
    431436            $headers   = array();
    432437            $headers[] = "From: $site_name <$site_email>";
     
    434439            wp_mail(
    435440                $contact_email,
    436                     proper_contact_get_key( 'propercfp_label_submit' ) . ' - ' . get_bloginfo( 'name' ),
     441                    proper_contact_get_key( 'propercfp_label_submit' ) . ' - ' . $site_name,
    437442                $confirm_body,
    438443                $headers
     
    461466            $redirect_id = proper_contact_get_key( 'propercfp_result_url' );
    462467            $redirect    = get_permalink( $redirect_id );
    463             wp_redirect( $redirect );
    464468        }
    465469        else {
    466             $_SESSION['propercfp_sent'] = 'yes';
    467         }
     470            $redirect = home_url( $_SERVER['REQUEST_URI'] ) . ( strpos( $_SERVER['REQUEST_URI'], '?' ) === FALSE ? '?' : '&' )
     471                . 'pcf=' . 1;
     472        }
     473
     474        wp_safe_redirect( $redirect );
    468475
    469476    }
     
    493500    add_action( 'init', 'proper_contact_content_type' );
    494501    function proper_contact_content_type() {
     502
     503        // Adding a lighter icon for 3.8 and higher
     504        if ( version_compare( $GLOBALS['wp_version'], '3.8', '>=' ) )
     505            $icon_file = 'person-3point8.png';
     506        else
     507            $icon_file = 'person.png';
     508
    495509        $labels = array(
    496510            'name'               => __( 'Contacts', 'proper-contact' ), 'post type general name',
     
    513527            'hierarchical'       => FALSE,
    514528            'menu_position'      => 27,
    515             'menu_icon'          => PROPER_CONTACT_URL . '/images/person.png',
     529            'menu_icon'          => PROPER_CONTACT_URL . '/images/' . $icon_file,
    516530            'supports'           => array( 'title', 'editor', 'custom-fields' )
    517531        );
  • proper-contact-form/trunk/readme.txt

    r838169 r863331  
    44Tags: contact, contact form, contact form widget
    55Requires at least: 3.0
    6 Tested up to: 3.6
    7 Stable tag: 0.9.7
     6Tested up to: 3.8.1
     7Stable tag: 0.9.8
    88
    99Creates a flexible, secure contact form on your WP site
     
    4949== Changelog ==
    5050
     51= 0.9.8 =
     52* Added a redirect back to the same page to avoid duplicate form submissions
     53* Fixed issue with HTML special characters in email subject line
     54* Fixed the wp-admin icon for new 3.8 dashboard
     55
    5156= 0.9.7 =
    5257* Fixed issue with widget not displaying text above the form
Note: See TracChangeset for help on using the changeset viewer.