Plugin Directory

Changeset 1605116


Ignore:
Timestamp:
02/28/2017 10:06:36 AM (9 years ago)
Author:
Cohhe
Message:

Fixed bug which in some cases might cause an error when updating plugin

Location:
directory-builder
Files:
2 edited
28 copied

Legend:

Unmodified
Added
Removed
  • directory-builder/tags/1.4/README.txt

    r1604602 r1605116  
    44Requires at least: 4.5.3
    55Tested up to: 4.7.2
    6 Stable tag: 1.3.9
     6Stable tag: 1.4
    77License: GPLv2 or later
    88License URI: http://www.gnu.org/licenses/gpl-2.0.html
     
    2525
    2626== Changelog ==
     27
     28= 1.4 =
     29* Fixed an issue while updating plugin to the newest version
    2730
    2831= 1.3.9 =
  • directory-builder/tags/1.4/directory-builder.php

    r1604602 r1605116  
    1717 * Plugin URI:        https://cohhe.com/
    1818 * Description:       Directory builder provides listing functionality for your theme.
    19  * Version:           1.3.9
     19 * Version:           1.4
    2020 * Author:            Cohhe
    2121 * Author URI:        https://cohhe.com/
     
    61606160add_action( 'wp_ajax_nopriv_db_get_current_package', 'db_get_current_package_func' );
    61616161
    6162 function db_save_billing_func() {
    6163     $field_data = ( isset($_POST['field_data']) ? json_decode(htmlspecialchars_decode(stripslashes($_POST['field_data'])), true) : '' );
    6164     $listing_id = ( isset($_POST['listing_id']) ? intval($_POST['listing_id']) : '' );
    6165     $card_data = ( isset($_POST['card_data']) ? json_decode(htmlspecialchars_decode(stripslashes($_POST['card_data'])), true) : '' );
    6166     $gateway = ( isset($_POST['gateway']) ? $_POST['gateway'] : '' );
    6167     $billing_info = get_post_meta( $listing_id, 'db_billing_info', true );
    6168 
    6169     if ( $billing_info == '' ) {
    6170         update_post_meta( $listing_id, 'db_billing_info', $field_data );
    6171     }
    6172 
    6173     if ( $listing_id ) {
    6174         if ( $gateway == 'authorizenet' ) {
    6175             if ( function_exists('db_check_authorize_card') ) {
    6176                 db_check_authorize_card( $card_data );
     6162if ( !function_exists('db_save_billing_func') ) {
     6163    function db_save_billing_func() {
     6164        $field_data = ( isset($_POST['field_data']) ? json_decode(htmlspecialchars_decode(stripslashes($_POST['field_data'])), true) : '' );
     6165        $listing_id = ( isset($_POST['listing_id']) ? intval($_POST['listing_id']) : '' );
     6166        $card_data = ( isset($_POST['card_data']) ? json_decode(htmlspecialchars_decode(stripslashes($_POST['card_data'])), true) : '' );
     6167        $gateway = ( isset($_POST['gateway']) ? $_POST['gateway'] : '' );
     6168        $billing_info = get_post_meta( $listing_id, 'db_billing_info', true );
     6169
     6170        if ( $billing_info == '' ) {
     6171            update_post_meta( $listing_id, 'db_billing_info', $field_data );
     6172        }
     6173
     6174        if ( $listing_id ) {
     6175            if ( $gateway == 'authorizenet' ) {
     6176                if ( function_exists('db_check_authorize_card') ) {
     6177                    db_check_authorize_card( $card_data );
     6178                } else {
     6179                    echo '{"save_response": "failed", "message": "'.__('Couldn\'t find Authorize.Net', 'functionality-for-directory-theme').'"}';
     6180                }
    61776181            } else {
    6178                 echo '{"save_response": "failed", "message": "'.__('Couldn\'t find Authorize.Net', 'functionality-for-directory-theme').'"}';
     6182                echo '{"save_response": "'.$listing_id.'"}';
    61796183            }
    61806184        } else {
    6181             echo '{"save_response": "'.$listing_id.'"}';
    6182         }
    6183     } else {
    6184         echo '{"save_response": "failed", "message": "'.__('There was an issue while saving your billing information!', 'functionality-for-directory-theme').'"}';
    6185     }
    6186 
    6187     die(0);
     6185            echo '{"save_response": "failed", "message": "'.__('There was an issue while saving your billing information!', 'functionality-for-directory-theme').'"}';
     6186        }
     6187
     6188        die(0);
     6189    }
    61886190}
    61896191add_action( 'wp_ajax_db_save_billing', 'db_save_billing_func' );
  • directory-builder/trunk/README.txt

    r1604602 r1605116  
    44Requires at least: 4.5.3
    55Tested up to: 4.7.2
    6 Stable tag: 1.3.9
     6Stable tag: 1.4
    77License: GPLv2 or later
    88License URI: http://www.gnu.org/licenses/gpl-2.0.html
     
    2525
    2626== Changelog ==
     27
     28= 1.4 =
     29* Fixed an issue while updating plugin to the newest version
    2730
    2831= 1.3.9 =
  • directory-builder/trunk/directory-builder.php

    r1604602 r1605116  
    1717 * Plugin URI:        https://cohhe.com/
    1818 * Description:       Directory builder provides listing functionality for your theme.
    19  * Version:           1.3.9
     19 * Version:           1.4
    2020 * Author:            Cohhe
    2121 * Author URI:        https://cohhe.com/
     
    61606160add_action( 'wp_ajax_nopriv_db_get_current_package', 'db_get_current_package_func' );
    61616161
    6162 function db_save_billing_func() {
    6163     $field_data = ( isset($_POST['field_data']) ? json_decode(htmlspecialchars_decode(stripslashes($_POST['field_data'])), true) : '' );
    6164     $listing_id = ( isset($_POST['listing_id']) ? intval($_POST['listing_id']) : '' );
    6165     $card_data = ( isset($_POST['card_data']) ? json_decode(htmlspecialchars_decode(stripslashes($_POST['card_data'])), true) : '' );
    6166     $gateway = ( isset($_POST['gateway']) ? $_POST['gateway'] : '' );
    6167     $billing_info = get_post_meta( $listing_id, 'db_billing_info', true );
    6168 
    6169     if ( $billing_info == '' ) {
    6170         update_post_meta( $listing_id, 'db_billing_info', $field_data );
    6171     }
    6172 
    6173     if ( $listing_id ) {
    6174         if ( $gateway == 'authorizenet' ) {
    6175             if ( function_exists('db_check_authorize_card') ) {
    6176                 db_check_authorize_card( $card_data );
     6162if ( !function_exists('db_save_billing_func') ) {
     6163    function db_save_billing_func() {
     6164        $field_data = ( isset($_POST['field_data']) ? json_decode(htmlspecialchars_decode(stripslashes($_POST['field_data'])), true) : '' );
     6165        $listing_id = ( isset($_POST['listing_id']) ? intval($_POST['listing_id']) : '' );
     6166        $card_data = ( isset($_POST['card_data']) ? json_decode(htmlspecialchars_decode(stripslashes($_POST['card_data'])), true) : '' );
     6167        $gateway = ( isset($_POST['gateway']) ? $_POST['gateway'] : '' );
     6168        $billing_info = get_post_meta( $listing_id, 'db_billing_info', true );
     6169
     6170        if ( $billing_info == '' ) {
     6171            update_post_meta( $listing_id, 'db_billing_info', $field_data );
     6172        }
     6173
     6174        if ( $listing_id ) {
     6175            if ( $gateway == 'authorizenet' ) {
     6176                if ( function_exists('db_check_authorize_card') ) {
     6177                    db_check_authorize_card( $card_data );
     6178                } else {
     6179                    echo '{"save_response": "failed", "message": "'.__('Couldn\'t find Authorize.Net', 'functionality-for-directory-theme').'"}';
     6180                }
    61776181            } else {
    6178                 echo '{"save_response": "failed", "message": "'.__('Couldn\'t find Authorize.Net', 'functionality-for-directory-theme').'"}';
     6182                echo '{"save_response": "'.$listing_id.'"}';
    61796183            }
    61806184        } else {
    6181             echo '{"save_response": "'.$listing_id.'"}';
    6182         }
    6183     } else {
    6184         echo '{"save_response": "failed", "message": "'.__('There was an issue while saving your billing information!', 'functionality-for-directory-theme').'"}';
    6185     }
    6186 
    6187     die(0);
     6185            echo '{"save_response": "failed", "message": "'.__('There was an issue while saving your billing information!', 'functionality-for-directory-theme').'"}';
     6186        }
     6187
     6188        die(0);
     6189    }
    61886190}
    61896191add_action( 'wp_ajax_db_save_billing', 'db_save_billing_func' );
Note: See TracChangeset for help on using the changeset viewer.