Changeset 3816011
- Timestamp:
- 11/22/2026 01:38:04 AM (2 hours ago)
- Location:
- mw-wp-form
- Files:
-
- 8 edited
- 1 copied
-
tags/5.1.9 (copied) (copied from mw-wp-form/trunk )
-
tags/5.1.9/classes/models/class.csv.php (modified) (2 diffs)
-
tags/5.1.9/classes/models/class.session.php (modified) (3 diffs)
-
tags/5.1.9/mw-wp-form.php (modified) (1 diff)
-
tags/5.1.9/readme.txt (modified) (2 diffs)
-
trunk/classes/models/class.csv.php (modified) (2 diffs)
-
trunk/classes/models/class.session.php (modified) (3 diffs)
-
trunk/mw-wp-form.php (modified) (1 diff)
-
trunk/readme.txt (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
mw-wp-form/tags/5.1.9/classes/models/class.csv.php
r2968966 r3816011 82 82 foreach ( $rows as $row ) { 83 83 foreach ( $row as $column_name => $column ) { 84 $row[ $column_name ] = $this->_escape_double_quote( $ column);84 $row[ $column_name ] = $this->_escape_double_quote( $this->_escape_leading_character( $column ) ); 85 85 } 86 86 $csv .= implode( ',', $row ) . "\r\n"; … … 219 219 220 220 /** 221 * Prefix a single quote to values starting with a special character. 222 * 223 * @param mixed $value Value. 224 * @return string 225 */ 226 protected function _escape_leading_character( $value ) { 227 $value = (string) $value; 228 if ( '' !== $value && false !== strpos( "=+-@\t\r\n", $value[0] ) ) { 229 $value = "'" . $value; 230 } 231 return $value; 232 } 233 234 /** 221 235 * Escape double quotes. 222 236 * -
mw-wp-form/tags/5.1.9/classes/models/class.session.php
r3516013 r3816011 19 19 20 20 /** 21 * Transient name. 22 * 21 23 * @var string 22 24 */ … … 38 40 $this->name = MWF_Config::NAME . '_session_' . $name; 39 41 40 if ( isset( $_COOKIE[ $this->name ] ) ) { 42 $session_id = false; 43 if ( isset( $_COOKIE[ $this->name ] ) && preg_match( '/\A[0-9a-f]{40}\z/', $_COOKIE[ $this->name ] ) ) { 41 44 $session_id = $_COOKIE[ $this->name ]; 42 } else { 45 } 46 47 if ( ! $session_id ) { 43 48 $session_id = sha1( wp_create_nonce( $this->name ) . ip2long( $this->get_remote_addr() ) . uniqid() ); 44 49 $secure = apply_filters( 'mwform_secure_cookie', is_ssl() ); … … 62 67 } 63 68 64 $this->session_id = $session_id;69 $this->session_id = MWF_Config::NAME . '_session_' . $session_id; 65 70 } 66 71 -
mw-wp-form/tags/5.1.9/mw-wp-form.php
r3715473 r3816011 4 4 * Plugin URI: https://mw-wp-form.web-soudan.co.jp 5 5 * Description: MW WP Form is shortcode base contact form plugin. This plugin have many features. For example you can use many validation rules, inquiry data saving, and chart aggregation using saved inquiry data. 6 * Version: 5.1. 86 * Version: 5.1.9 7 7 * Requires at least: 6.0 8 8 * Requires PHP: 8.0 -
mw-wp-form/tags/5.1.9/readme.txt
r3715473 r3816011 6 6 Requires PHP: 8.0 7 7 Tested up to: 6.4 8 Stable tag: 5.1. 88 Stable tag: 5.1.9 9 9 License: GPLv2 or later 10 10 License URI: http://www.gnu.org/licenses/gpl-2.0.html … … 82 82 == Changelog == 83 83 84 = 5.1.9 = 85 * Security Hardened session handling 86 * Security Hardened CSV export 87 84 88 = 5.1.8 = 85 89 * Security Tighten access control on post reference handling via query string (re-release of 5.1.7, which was not delivered due to a missing Stable tag update) -
mw-wp-form/trunk/classes/models/class.csv.php
r2968966 r3816011 82 82 foreach ( $rows as $row ) { 83 83 foreach ( $row as $column_name => $column ) { 84 $row[ $column_name ] = $this->_escape_double_quote( $ column);84 $row[ $column_name ] = $this->_escape_double_quote( $this->_escape_leading_character( $column ) ); 85 85 } 86 86 $csv .= implode( ',', $row ) . "\r\n"; … … 219 219 220 220 /** 221 * Prefix a single quote to values starting with a special character. 222 * 223 * @param mixed $value Value. 224 * @return string 225 */ 226 protected function _escape_leading_character( $value ) { 227 $value = (string) $value; 228 if ( '' !== $value && false !== strpos( "=+-@\t\r\n", $value[0] ) ) { 229 $value = "'" . $value; 230 } 231 return $value; 232 } 233 234 /** 221 235 * Escape double quotes. 222 236 * -
mw-wp-form/trunk/classes/models/class.session.php
r3516013 r3816011 19 19 20 20 /** 21 * Transient name. 22 * 21 23 * @var string 22 24 */ … … 38 40 $this->name = MWF_Config::NAME . '_session_' . $name; 39 41 40 if ( isset( $_COOKIE[ $this->name ] ) ) { 42 $session_id = false; 43 if ( isset( $_COOKIE[ $this->name ] ) && preg_match( '/\A[0-9a-f]{40}\z/', $_COOKIE[ $this->name ] ) ) { 41 44 $session_id = $_COOKIE[ $this->name ]; 42 } else { 45 } 46 47 if ( ! $session_id ) { 43 48 $session_id = sha1( wp_create_nonce( $this->name ) . ip2long( $this->get_remote_addr() ) . uniqid() ); 44 49 $secure = apply_filters( 'mwform_secure_cookie', is_ssl() ); … … 62 67 } 63 68 64 $this->session_id = $session_id;69 $this->session_id = MWF_Config::NAME . '_session_' . $session_id; 65 70 } 66 71 -
mw-wp-form/trunk/mw-wp-form.php
r3715473 r3816011 4 4 * Plugin URI: https://mw-wp-form.web-soudan.co.jp 5 5 * Description: MW WP Form is shortcode base contact form plugin. This plugin have many features. For example you can use many validation rules, inquiry data saving, and chart aggregation using saved inquiry data. 6 * Version: 5.1. 86 * Version: 5.1.9 7 7 * Requires at least: 6.0 8 8 * Requires PHP: 8.0 -
mw-wp-form/trunk/readme.txt
r3715473 r3816011 6 6 Requires PHP: 8.0 7 7 Tested up to: 6.4 8 Stable tag: 5.1. 88 Stable tag: 5.1.9 9 9 License: GPLv2 or later 10 10 License URI: http://www.gnu.org/licenses/gpl-2.0.html … … 82 82 == Changelog == 83 83 84 = 5.1.9 = 85 * Security Hardened session handling 86 * Security Hardened CSV export 87 84 88 = 5.1.8 = 85 89 * Security Tighten access control on post reference handling via query string (re-release of 5.1.7, which was not delivered due to a missing Stable tag update)
Note:
See TracChangeset
for help on using the changeset viewer.