Changeset 3042177
- Timestamp:
- 02/27/2024 07:11:53 PM (2 years ago)
- Location:
- custom-field-suite/trunk
- Files:
-
- 10 edited
-
cfs.php (modified) (2 diffs)
-
includes/field.php (modified) (8 diffs)
-
includes/fields/file.php (modified) (2 diffs)
-
includes/fields/loop.php (modified) (3 diffs)
-
includes/fields/relationship.php (modified) (2 diffs)
-
includes/fields/select.php (modified) (1 diff)
-
includes/fields/textarea.php (modified) (1 diff)
-
includes/fields/true_false.php (modified) (1 diff)
-
includes/fields/wysiwyg.php (modified) (4 diffs)
-
readme.txt (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
custom-field-suite/trunk/cfs.php
r2931047 r3042177 3 3 Plugin Name: Custom Field Suite 4 4 Description: Visually add custom fields to your WordPress edit pages. 5 Version: 2.6. 45 Version: 2.6.5 6 6 Author: Matt Gibbs 7 7 Text Domain: cfs … … 22 22 23 23 // setup variables 24 define( 'CFS_VERSION', '2.6. 4' );24 define( 'CFS_VERSION', '2.6.5' ); 25 25 define( 'CFS_DIR', dirname( __FILE__ ) ); 26 26 define( 'CFS_URL', plugins_url( '', __FILE__ ) ); -
custom-field-suite/trunk/includes/field.php
r2287953 r3042177 9 9 /** 10 10 * Constructor 11 * @param object $parent 11 * @param object $parent 12 12 * @since 1.0.5 13 13 */ … … 20 20 /** 21 21 * Generate the field HTML 22 * @param object $field 22 * @param object $field 23 23 * @since 1.0.5 24 24 */ 25 25 function html( $field ) { 26 26 ?> 27 <input type="text" name="<?php echo $field->input_name; ?>" class="<?php echo $field->input_class; ?>" value="<?php echo $field->value; ?>" />27 <input type="text" name="<?php echo esc_attr( $field->input_name ); ?>" class="<?php echo esc_attr( $field->input_class ); ?>" value="<?php echo esc_attr( $field->value ); ?>" /> 28 28 <?php 29 29 } … … 33 33 * Generate settings HTML for the field group edit screen 34 34 * @param int $key The unique field identifier 35 * @param object $field 35 * @param object $field 36 36 * @since 1.0.5 37 37 */ … … 70 70 /** 71 71 * Format the value directly after database load 72 * 72 * 73 73 * Values are retrieved from the database as an array, even for field types that 74 74 * don't expect arrays. For field types that should return array values, make 75 75 * sure to override this method and return $value. 76 * 77 * @param mixed $value 76 * 77 * @param mixed $value 78 78 * @param mixed $field The field object (optional) 79 79 * @return mixed The field value … … 87 87 /** 88 88 * Format the value for use with $cfs->get 89 * @param mixed $value 89 * @param mixed $value 90 90 * @param mixed $field The field object (optional) 91 91 * @return mixed … … 99 99 /** 100 100 * Format the value for use with HTML input elements 101 * @param mixed $value 101 * @param mixed $value 102 102 * @param mixed $field The field object (optional) 103 103 * @return mixed … … 111 111 /** 112 112 * Format the value before saving to DB 113 * @param mixed $value 113 * @param mixed $value 114 114 * @param mixed $field The field object (optional) 115 115 * @return mixed … … 134 134 /** 135 135 * Helper method to retrieve a field setting 136 * @param object $field 137 * @param string $option_name 138 * @param mixed $default_value 136 * @param object $field 137 * @param string $option_name 138 * @param mixed $default_value 139 139 * @return mixed 140 140 * @since 1.4.3 -
custom-field-suite/trunk/includes/fields/file.php
r2287953 r3042177 32 32 <input type="button" class="media button add<?php echo $css[0]; ?>" value="<?php _e( 'Add File', 'cfs' ); ?>" /> 33 33 <input type="button" class="media button remove<?php echo $css[1]; ?>" value="<?php _e( 'Remove', 'cfs' ); ?>" /> 34 <input type="hidden" name="<?php echo $field->input_name; ?>" class="file_value" value="<?php echo $field->value; ?>" />34 <input type="hidden" name="<?php echo esc_attr( $field->input_name ); ?>" class="file_value" value="<?php echo esc_attr( $field->value ); ?>" /> 35 35 <?php 36 36 } … … 110 110 display: none; 111 111 } 112 112 113 113 .cfs_frame .media-frame-title, 114 114 .cfs_frame .media-frame-router, -
custom-field-suite/trunk/includes/fields/loop.php
r2931047 r3042177 126 126 <div class="cfs_loop_body open"> 127 127 <?php foreach ( $results as $field ) : ?> 128 <label><?php echo $field->label; ?></label>128 <label><?php echo esc_html( $field->label ); ?></label> 129 129 130 130 <?php if ( ! empty( $field->notes ) ) : ?> 131 <p class="notes"><?php echo $field->notes; ?></p>131 <p class="notes"><?php echo esc_html( $field->notes ); ?></p> 132 132 <?php endif; ?> 133 133 134 <div class="field field-<?php echo $field->name; ?> cfs_<?php echo $field->type; ?>">134 <div class="field field-<?php echo esc_attr( $field->name ); ?> cfs_<?php echo esc_attr( $field->type ); ?>"> 135 135 <?php 136 136 if ( 'loop' == $field->type ) : … … 214 214 <div class="cfs_loop_body<?php echo $css_class; ?>"> 215 215 <?php foreach ( $results as $field ) : ?> 216 <label><?php echo $field->label; ?></label>216 <label><?php echo esc_html( $field->label ); ?></label> 217 217 218 218 <?php if ( ! empty( $field->notes ) ) : ?> 219 <p class="notes"><?php echo $field->notes; ?></p>219 <p class="notes"><?php echo esc_html( $field->notes ); ?></p> 220 220 <?php endif; ?> 221 221 222 <div class="field field-<?php echo $field->name; ?> cfs_<?php echo $field->type; ?>">222 <div class="field field-<?php echo esc_attr( $field->name ); ?> cfs_<?php echo esc_attr( $field->type ); ?>"> 223 223 <?php if ( 'loop' == $field->type ) : ?> 224 224 <?php $this->recursive_html( $group_id, $field->id, "{$parent_tag}[$i][$field->id]", $i ); ?> … … 250 250 251 251 <div class="table_footer"> 252 <input type="button" class="button-primary cfs_add_field" value="<?php echo esc_attr( $button_label ); ?>" data-loop-tag="<?php echo $parent_tag; ?>" data-rows="<?php echo ( $row_offset + 1 ); ?>" />252 <input type="button" class="button-primary cfs_add_field" value="<?php echo esc_attr( $button_label ); ?>" data-loop-tag="<?php echo esc_attr( $parent_tag ); ?>" data-rows="<?php echo ( $row_offset + 1 ); ?>" /> 253 253 </div> 254 254 <?php -
custom-field-suite/trunk/includes/fields/relationship.php
r2287953 r3042177 62 62 <?php foreach ( $available_posts as $post ) : ?> 63 63 <?php $class = ( isset( $selected_posts[ $post->ID ] ) ) ? ' class="used"' : ''; ?> 64 <div rel="<?php echo $post->ID; ?>"<?php echo $class; ?> title="<?php echo $post->post_type; ?>"><?php echo apply_filters( 'cfs_relationship_display', $post->post_title, $post->ID, $field ); ?></div>64 <div rel="<?php echo $post->ID; ?>"<?php echo $class; ?> title="<?php echo esc_attr( $post->post_type ); ?>"><?php echo apply_filters( 'cfs_relationship_display', $post->post_title, $post->ID, $field ); ?></div> 65 65 <?php endforeach; ?> 66 66 </div> … … 72 72 </div> 73 73 <div class="clear"></div> 74 <input type="hidden" name="<?php echo $field->input_name; ?>" class="<?php echo $field->input_class; ?>" value="<?php echo $field->value; ?>" />74 <input type="hidden" name="<?php echo esc_attr( $field->input_name ); ?>" class="<?php echo esc_attr( $field->input_class ); ?>" value="<?php echo esc_attr( $field->value ); ?>" /> 75 75 <?php 76 76 } -
custom-field-suite/trunk/includes/fields/select.php
r2931047 r3042177 33 33 } 34 34 ?> 35 <select name="<?php echo $field->input_name; ?>" class="<?php echo trim( $field->input_class ); ?>"<?php echo $multiple; ?>>35 <select name="<?php echo esc_attr( $field->input_name ); ?>" class="<?php echo esc_attr( $field->input_class ); ?>"<?php echo $multiple; ?>> 36 36 <?php foreach ( $field->options['choices'] as $val => $label ) : ?> 37 37 <?php $val = ( '{empty}' == $val ) ? '' : $val; ?> -
custom-field-suite/trunk/includes/fields/textarea.php
r2287953 r3042177 12 12 function html( $field ) { 13 13 ?> 14 <textarea name="<?php echo $field->input_name; ?>" class="<?php echo $field->input_class; ?>" rows="4"><?php echo $field->value; ?></textarea>14 <textarea name="<?php echo esc_attr( $field->input_name ); ?>" class="<?php echo esc_attr( $field->input_class ); ?>" rows="4"><?php echo $field->value; ?></textarea> 15 15 <?php 16 16 } -
custom-field-suite/trunk/includes/fields/true_false.php
r2287953 r3042177 18 18 <input type="checkbox" <?php echo $field->value ? ' checked' : ''; ?>> 19 19 <span><?php echo $field->options['message']; ?></span> 20 <input type="hidden" name="<?php echo $field->input_name; ?>" class="<?php echo $field->input_class; ?>" value="<?php echo $field->value; ?>" />20 <input type="hidden" name="<?php echo esc_attr( $field->input_name ); ?>" class="<?php echo esc_attr( $field->input_class ); ?>" value="<?php echo esc_attr( $field->value ); ?>" /> 21 21 </label> 22 22 <?php -
custom-field-suite/trunk/includes/fields/wysiwyg.php
r2910695 r3042177 20 20 </div> 21 21 <div class="wp-editor-container"> 22 <textarea name="<?php echo $field->input_name; ?>" class="wp-editor-area <?php echo $field->input_class; ?>" style="height:300px"><?php echo $field->value; ?></textarea>22 <textarea name="<?php echo esc_attr( $field->input_name ); ?>" class="wp-editor-area <?php echo esc_attr( $field->input_class ); ?>" style="height:300px"><?php echo $field->value; ?></textarea> 23 23 </div> 24 24 </div> … … 111 111 $(this).find('.wysiwyg').attr('id', input_id); 112 112 $(this).find('a.add_media').attr('data-editor', input_id); 113 113 114 114 // if all editors on page are in 'text' tab, tinyMCE.settings will not be set 115 if ('undefined' == typeof tinyMCE.settings) {115 if ('undefined' === typeof tinyMCE.settings || Object.keys(tinyMCE.settings).length === 0) { 116 116 117 117 // let's pull from tinyMCEPreInit for main content area (if it's set) 118 if ('undefined' != typeof tinyMCEPreInit && 'undefined' != typeof tinyMCEPreInit.mceInit.content) {118 if ('undefined' !== typeof tinyMCEPreInit && 'undefined' !== typeof tinyMCEPreInit.mceInit.content) { 119 119 tinyMCE.settings = tinyMCEPreInit.mceInit.content; 120 120 } … … 125 125 resize : 'vertical', 126 126 toolbar2 : 'code' 127 }; 127 }; 128 128 } 129 129 } 130 130 131 131 // add the "code" button 132 132 if ('undefined' !== typeof tinyMCE.settings.toolbar2) { … … 139 139 wpautop = tinyMCE.settings.wpautop; 140 140 resize = tinyMCE.settings.resize; 141 142 tinyMCE.settings.plugins = 'code,link'; 141 142 if (tinyMCE.settings.plugins){ 143 if ( tinyMCE.settings.plugins.indexOf('code,link') === -1 ){ 144 tinyMCE.settings.plugins = tinyMCE.settings.plugins + ',code,link'; 145 } 146 } else { 147 tinyMCE.settings.plugins = 'code,link'; 148 } 143 149 144 150 tinyMCE.settings.wpautop = false; -
custom-field-suite/trunk/readme.txt
r2931047 r3042177 3 3 Tags: custom fields, fields, postmeta, relationship, repeater, file upload 4 4 Requires at least: 5.0 5 Tested up to: 6. 2.25 Tested up to: 6.4.3 6 6 Stable tag: trunk 7 7 License: GPLv2 … … 47 47 == Changelog == 48 48 49 = 2.6.5 = 50 * Extra sanitization to prevent XSS via admin-imported field groups (props WordFence) 51 49 52 = 2.6.4 = 50 53 * Fixed: cleared PHP8 deprecation notices
Note: See TracChangeset
for help on using the changeset viewer.