Plugin Directory

Changeset 3306945


Ignore:
Timestamp:
06/05/2025 09:38:44 AM (9 months ago)
Author:
codemenschen
Message:

Update version 4.5.5

Location:
gift-voucher
Files:
977 added
4 edited

Legend:

Unmodified
Added
Removed
  • gift-voucher/trunk/classes/class-nag.php

    r3299113 r3306945  
    101101        $query_string = isset($_SERVER['QUERY_STRING']) ? sanitize_text_field(wp_unslash($_SERVER['QUERY_STRING'])) : '';
    102102
     103        $params = array();
     104
    103105        if (!empty($query_string)) {
    104106            wp_parse_str($query_string, $params);
    105107        }
    106108
    107         $array_params =  array();
     109        $array_params = array();
    108110        foreach ($params as $key => $value) {
    109             $sanitize_value =  esc_html($value);
     111            $sanitize_value = esc_html($value);
    110112            $array_params[esc_html($key)] = $sanitize_value;
    111113        }
  • gift-voucher/trunk/gift-voucher.php

    r3299113 r3306945  
    77 * Author: Codemenschen GmbH
    88 * Author URI: https://www.codemenschen.at/
    9  * Version: 4.5.4
     9 * Version: 4.5.5
    1010 * Text Domain: gift-voucher
    1111 * Domain Path: /languages
     
    2323if (!defined('ABSPATH')) exit;  // Exit if accessed directly
    2424
    25 define('WPGIFT_VERSION', '4.5.4');
     25define('WPGIFT_VERSION', '4.5.5');
    2626define('WPGIFT__MINIMUM_WP_VERSION', '4.0');
    2727define('WPGIFT__PLUGIN_DIR', untrailingslashit(plugin_dir_path(__FILE__)));
     
    464464      $giftvouchers_setting,
    465465      array(
    466         'landscape_mode_templates' => $template_landscape,
     466        'landscape_mode_templates' => $template_lanscape,
    467467        'portrait_mode_templates' => $template_portail,
    468468      ),
     
    807807function wpgv_price_format($price)
    808808{
    809   global $wpdb;
    810   $setting_table_name = $wpdb->prefix . 'giftvouchers_setting';
    811   $setting_options = $wpdb->get_row("SELECT * FROM $setting_table_name WHERE id = 1");
    812   $price = html_entity_decode(wp_strip_all_tags(stripslashes($price)), ENT_NOQUOTES, 'UTF-8');
    813   $price = iconv('UTF-8', 'windows-1252', $price);
    814   $price = number_format((float)$price, 2, ',', '.');
    815   $currency = ($setting_options->currency_position == 'Left') ? $setting_options->currency . ' ' . $price : $price . ' ' . $setting_options->currency;
    816   return $currency;
     809    global $wpdb;
     810    $setting_options = $wpdb->get_row( $wpdb->prepare( "SELECT * FROM {$wpdb->prefix}giftvouchers_setting WHERE id = %d", 1 ) );
     811
     812    $price = html_entity_decode(strip_tags(stripslashes($price)), ENT_NOQUOTES, 'UTF-8');
     813    $price = iconv('UTF-8', 'windows-1252', $price);
     814    // number format new
     815    $wpgv_select_number_format = get_option('wpgv_select_number_format') ? get_option('wpgv_select_number_format') : '';
     816    if ($wpgv_select_number_format == "comma") {
     817        $price = number_format((float)$price, 2, '.', ',');
     818    } elseif ($wpgv_select_number_format == "dot") {
     819        $price = number_format((float)$price, 2, ',', '.');
     820    }
     821    $currency = ($setting_options->currency_position == 'Left') ? $setting_options->currency . ' ' . $price : $price . ' ' . $setting_options->currency;
     822    return $currency;
    817823}
    818824
  • gift-voucher/trunk/include/voucher_settings.php

    r3262503 r3306945  
    5656    $hide_expiry = isset($_POST['hide_expiry']) ? sanitize_text_field(wp_unslash($_POST['hide_expiry'])) : '';
    5757    $expiry_date_format = isset($_POST['expiry_date_format']) ? sanitize_text_field(wp_unslash($_POST['expiry_date_format'])) : '';
     58    $select_number_format        = sanitize_text_field($_POST['select_number_format']);
    5859    $post_shipping = isset($_POST['post_shipping']) ? sanitize_text_field(wp_unslash($_POST['post_shipping'])) : '';
    5960    $preview_button = isset($_POST['preview_button']) ? sanitize_text_field(wp_unslash($_POST['preview_button'])) : '';
     
    142143    update_option('wpgv_hide_expiry', $hide_expiry);
    143144    update_option('wpgv_expiry_date_format', $expiry_date_format);
     145    update_option('wpgv_select_number_format', $select_number_format);
    144146    update_option('wpgv_emailsubject', $email_subject);
    145147    update_option('wpgv_emailbody', stripslashes(wp_filter_post_kses(addslashes($email_body))));
     
    195197$wpgv_hide_expiry = get_option('wpgv_hide_expiry') ? get_option('wpgv_hide_expiry') : 'yes';
    196198$wpgv_expiry_date_format = get_option('wpgv_expiry_date_format') ? get_option('wpgv_expiry_date_format') : 'd.m.Y';
     199$wpgv_select_number_format = get_option('wpgv_select_number_format') ? get_option('wpgv_select_number_format') : 'dot';
    197200$wpgv_termstext = get_option('wpgv_termstext') ? get_option('wpgv_termstext') : 'I hereby accept the terms and conditions, the revocation of the privacy policy and confirm that all information is correct.';
    198201$wpgv_custom_css = get_option('wpgv_custom_css') ? get_option('wpgv_custom_css') : '';
     
    503506                                </tr>
    504507
     508                                <!-- Select number format -->
     509                                <tr>
     510                                    <th scope="row">
     511                                        <label for="select_number_format"><?php echo __('Select number format', 'gift-voucher'); ?></label>
     512                                    </th>
     513                                    <td>
     514                                        <select name="select_number_format" id="template_col" class="regular-text">
     515                                            <option value="comma" <?php echo ($wpgv_select_number_format == 'comma') ? 'selected' : ''; ?>>1,000.00 (<?php echo __('comma-separated', 'gift-voucher'); ?>)</option>
     516                                            <option value="dot" <?php echo ($wpgv_select_number_format == 'dot') ? 'selected' : ''; ?>>1.000,00 (<?php echo __('dot-separated', 'gift-voucher'); ?>)</option>
     517                                        </select>
     518                                    </td>
     519                                </tr>
     520                                <!-- Select number format -->
     521
    505522                                <tr>
    506523                                    <th colspan="2">
  • gift-voucher/trunk/readme.txt

    r3299113 r3306945  
    44Requires at least: 4.0
    55Tested up to: 6.8.1
    6 Stable tag: 4.5.4
     6Stable tag: 4.5.5
    77Requires PHP: 5.6
    88License: GPLv2 or later
     
    219219== Changelog ==
    220220
     221= Version 4.5.5 - Released: June 05 2025
     222* Feature: Added number format selection option (comma or dot separated).
     223* Fix unexpected output during plugin activation warning. 
     224* Fix invalid argument supplied for foreach() warning in class-nag.php on line 108. 
     225* Change "personalize" to "personalise" for English (UK) localization. 
     226
    221227= Version 4.5.4 - Released: May 23 2025
    222228* Add nonce verification to form processing for security.
Note: See TracChangeset for help on using the changeset viewer.