Plugin Directory

Changeset 3010331


Ignore:
Timestamp:
12/15/2023 03:14:45 AM (2 years ago)
Author:
skagaya
Message:

Fix validations for width,height,mobile_height.

Location:
formzu-wp
Files:
6 edited
1 copied

Legend:

Unmodified
Added
Removed
  • formzu-wp/tags/1.6.9/add_formzu_shortcode.php

    r3008516 r3010331  
    4343     * - ショートコードの設定におけるXSS脆弱性に対する修正
    4444     * - コードの整理
     45     * Fixed on 2023.12.15 by skagaya
     46     * - height,widthのパーセント値,autoへの対応が抜けていたのを修正
    4547     */
    4648    if ( ! preg_match('/^(S[0-9]{5,9})$/', $atts['form_id']) ) {
     
    4850    }
    4951
     52    /*
    5053    if ( ! ctype_digit($atts['width']) ) {
    5154        if ( ! $atts['width'] == '' ) {
     
    6366        if ( ! $atts['mobile_height'] == '' ) {
    6467            return '<p>' . __('mobile_heightは半角数字のみ指定可能です。') . '</p>';
     68        }
     69    }
     70    */
     71
     72    if ( isset($atts['width']) && $atts['width'] ) {
     73        if ( preg_match('/^([0-9]+([a-zA-Z]{1,5}|%)?|auto)$/', $atts['width']) !== 1 ) { 
     74            return '<p>' . __('widthは長さ、パーセント値、autoのみ指定可能です。') . '</p>';
     75        }
     76    }
     77
     78    if ( isset($atts['height']) && $atts['height'] ) {
     79        if ( preg_match('/^([0-9]+([a-zA-Z]{1,5}|%)?|auto)$/', $atts['height']) !== 1 ) { 
     80            return '<p>' . __('heightは長さ、パーセント値、autoのみ指定可能です。') . '</p>';
     81        }
     82    }
     83
     84    if ( isset($atts['mobile_height']) && $atts['mobile_height'] ) {
     85        if ( preg_match('/^([0-9]+([a-zA-Z]{1,5}|%)?|auto)$/', $atts['mobile_height']) !== 1 ) { 
     86            return '<p>' . __('mobile_heightは長さ、パーセント値、autoのみ指定可能です。') . '</p>';
    6587        }
    6688    }
  • formzu-wp/tags/1.6.9/formzu-wp.php

    r3008516 r3010331  
    44 * Plugin URI:        https://wordpress.org/plugins/formzu-wp/
    55 * Description:       Formzu WP
    6  * Version:           1.6.8
     6 * Version:           1.6.9
    77 * Requires at least: 3.7
    88 * Requires PHP:      5.2
  • formzu-wp/tags/1.6.9/readme.txt

    r3008516 r3010331  
    66Tested up to: 6.4.1
    77Requires PHP: 5.2
    8 Stable tag: 1.6.8
     8Stable tag: 1.6.9
    99License: GPLv2 or later
    1010License URI: https://www.gnu.org/licenses/gpl-2.0.html
     
    5959
    6060== Changelog ==
     61
     62= v1.6.9 =
     63* ショートコードのwidth,height,mobile_height各設定に対する修正
    6164
    6265= v1.6.8 =
  • formzu-wp/trunk/add_formzu_shortcode.php

    r3008516 r3010331  
    4343     * - ショートコードの設定におけるXSS脆弱性に対する修正
    4444     * - コードの整理
     45     * Fixed on 2023.12.15 by skagaya
     46     * - height,widthのパーセント値,autoへの対応が抜けていたのを修正
    4547     */
    4648    if ( ! preg_match('/^(S[0-9]{5,9})$/', $atts['form_id']) ) {
     
    4850    }
    4951
     52    /*
    5053    if ( ! ctype_digit($atts['width']) ) {
    5154        if ( ! $atts['width'] == '' ) {
     
    6366        if ( ! $atts['mobile_height'] == '' ) {
    6467            return '<p>' . __('mobile_heightは半角数字のみ指定可能です。') . '</p>';
     68        }
     69    }
     70    */
     71
     72    if ( isset($atts['width']) && $atts['width'] ) {
     73        if ( preg_match('/^([0-9]+([a-zA-Z]{1,5}|%)?|auto)$/', $atts['width']) !== 1 ) { 
     74            return '<p>' . __('widthは長さ、パーセント値、autoのみ指定可能です。') . '</p>';
     75        }
     76    }
     77
     78    if ( isset($atts['height']) && $atts['height'] ) {
     79        if ( preg_match('/^([0-9]+([a-zA-Z]{1,5}|%)?|auto)$/', $atts['height']) !== 1 ) { 
     80            return '<p>' . __('heightは長さ、パーセント値、autoのみ指定可能です。') . '</p>';
     81        }
     82    }
     83
     84    if ( isset($atts['mobile_height']) && $atts['mobile_height'] ) {
     85        if ( preg_match('/^([0-9]+([a-zA-Z]{1,5}|%)?|auto)$/', $atts['mobile_height']) !== 1 ) { 
     86            return '<p>' . __('mobile_heightは長さ、パーセント値、autoのみ指定可能です。') . '</p>';
    6587        }
    6688    }
  • formzu-wp/trunk/formzu-wp.php

    r3008516 r3010331  
    44 * Plugin URI:        https://wordpress.org/plugins/formzu-wp/
    55 * Description:       Formzu WP
    6  * Version:           1.6.8
     6 * Version:           1.6.9
    77 * Requires at least: 3.7
    88 * Requires PHP:      5.2
  • formzu-wp/trunk/readme.txt

    r3008516 r3010331  
    66Tested up to: 6.4.1
    77Requires PHP: 5.2
    8 Stable tag: 1.6.8
     8Stable tag: 1.6.9
    99License: GPLv2 or later
    1010License URI: https://www.gnu.org/licenses/gpl-2.0.html
     
    5959
    6060== Changelog ==
     61
     62= v1.6.9 =
     63* ショートコードのwidth,height,mobile_height各設定に対する修正
    6164
    6265= v1.6.8 =
Note: See TracChangeset for help on using the changeset viewer.