Advanced Custom Fields - Version 1.1.1

Version Description

  • Fixed Slashes issue on edit screens for text based fields
Download this release

Release Info

Developer elliotcondon
Plugin Icon 128x128 Advanced Custom Fields
Version 1.1.1
Comparing to
See all releases

Code changes from version 1.1.0 to 1.1.1

acf.php CHANGED
@@ -3,7 +3,7 @@
3
  Plugin Name: Advanced Custom Fields
4
  Plugin URI: http://plugins.elliotcondon.com/advanced-custom-fields/
5
  Description: Completely Customise your edit pages with an assortment of field types: Wysiwyg, text, image, select, checkbox and more! Hide unwanted metaboxes and assign to any edit page!
6
- Version: 1.1.0
7
  Author: Elliot Condon
8
  Author URI: http://www.elliotcondon.com/
9
  License: GPL
@@ -33,7 +33,7 @@ class Acf
33
  $this->dir = plugins_url('',__FILE__);
34
  $this->siteurl = get_bloginfo('url');
35
  $this->wpadminurl = admin_url();
36
- $this->version = '1.1.0';
37
 
38
  // set text domain
39
  load_plugin_textdomain('acf', false, $this->path.'/lang' );
@@ -576,6 +576,9 @@ class Acf
576
 
577
  // get var
578
  $value = $wpdb->get_var("SELECT value FROM $table_name WHERE field_id = '$field->id' AND post_id = '$post_id'");
 
 
 
579
  }
580
 
581
 
@@ -585,7 +588,7 @@ class Acf
585
  $value = $this->fields[$field->type]->format_value_for_input($value);
586
  }
587
 
588
-
589
  // return value
590
  return $value;
591
  }
@@ -612,6 +615,7 @@ class Acf
612
 
613
  // get var
614
  $value = $wpdb->get_var("SELECT value FROM $table_name WHERE field_id = '$field->id' AND post_id = '$post_id'");
 
615
  }
616
 
617
 
3
  Plugin Name: Advanced Custom Fields
4
  Plugin URI: http://plugins.elliotcondon.com/advanced-custom-fields/
5
  Description: Completely Customise your edit pages with an assortment of field types: Wysiwyg, text, image, select, checkbox and more! Hide unwanted metaboxes and assign to any edit page!
6
+ Version: 1.1.1
7
  Author: Elliot Condon
8
  Author URI: http://www.elliotcondon.com/
9
  License: GPL
33
  $this->dir = plugins_url('',__FILE__);
34
  $this->siteurl = get_bloginfo('url');
35
  $this->wpadminurl = admin_url();
36
+ $this->version = '1.1.1';
37
 
38
  // set text domain
39
  load_plugin_textdomain('acf', false, $this->path.'/lang' );
576
 
577
  // get var
578
  $value = $wpdb->get_var("SELECT value FROM $table_name WHERE field_id = '$field->id' AND post_id = '$post_id'");
579
+
580
+ $value = stripslashes($value);
581
+
582
  }
583
 
584
 
588
  $value = $this->fields[$field->type]->format_value_for_input($value);
589
  }
590
 
591
+
592
  // return value
593
  return $value;
594
  }
615
 
616
  // get var
617
  $value = $wpdb->get_var("SELECT value FROM $table_name WHERE field_id = '$field->id' AND post_id = '$post_id'");
618
+ $value = stripslashes($value);
619
  }
620
 
621
 
core/fields/text.php CHANGED
@@ -15,7 +15,12 @@ class Text
15
  {
16
  echo '<input type="text" value="'.$field->value.'" id="'.$field->input_id.'" class="'.$field->input_class.'" name="'.$field->input_name.'" />';
17
  }
18
-
 
 
 
 
 
19
 
20
  }
21
 
15
  {
16
  echo '<input type="text" value="'.$field->value.'" id="'.$field->input_id.'" class="'.$field->input_class.'" name="'.$field->input_name.'" />';
17
  }
18
+
19
+ function format_value_for_input($value)
20
+ {
21
+ $value = htmlspecialchars($value, ENT_QUOTES);
22
+ return $value;
23
+ }
24
 
25
  }
26
 
core/fields/textarea.php CHANGED
@@ -18,11 +18,15 @@ class Textarea
18
  echo '<textarea id="'.$field->input_id.'" rows="4" class="'.$field->input_class.'" name="'.$field->input_name.'" >'.$field->value.'</textarea>';
19
  }
20
 
 
 
 
 
 
21
 
22
- function format_value($value)
23
  {
24
  $value = nl2br($value);
25
-
26
  return $value;
27
  }
28
  }
18
  echo '<textarea id="'.$field->input_id.'" rows="4" class="'.$field->input_class.'" name="'.$field->input_name.'" >'.$field->value.'</textarea>';
19
  }
20
 
21
+ function format_value_for_input($value)
22
+ {
23
+ $value = htmlspecialchars($value, ENT_QUOTES);
24
+ return $value;
25
+ }
26
 
27
+ function format_value_for_api($value)
28
  {
29
  $value = nl2br($value);
 
30
  return $value;
31
  }
32
  }
core/fields_meta_box.php CHANGED
@@ -37,7 +37,7 @@
37
 
38
  <input type="hidden" name="acf[fields][<?php echo $key; ?>][id]'" value="<?php echo $field->id; ?>" />
39
  <?php $temp_field = new stdClass(); ?>
40
-
41
  <table class="acf">
42
  <tr>
43
  <td class="order"><?php echo ($key+1); ?></td>
37
 
38
  <input type="hidden" name="acf[fields][<?php echo $key; ?>][id]'" value="<?php echo $field->id; ?>" />
39
  <?php $temp_field = new stdClass(); ?>
40
+
41
  <table class="acf">
42
  <tr>
43
  <td class="order"><?php echo ($key+1); ?></td>
core/input_meta_box.php CHANGED
@@ -49,7 +49,7 @@ if(!in_array('the_content',$adv_options->show_on_page)): ?>
49
  <?php $i = -1; ?>
50
  <?php foreach($fields as $field): $i++ ?>
51
  <?php
52
-
53
  // if they didn't select a type, skip this field
54
  if($field->type == 'null')
55
  {
@@ -57,6 +57,7 @@ if(!in_array('the_content',$adv_options->show_on_page)): ?>
57
  }
58
 
59
 
 
60
  // set value, id and name for field
61
  $field->value = $this->load_value_for_input($post->ID, $field);
62
  $field->input_id = 'acf['.$i.'][value]';
49
  <?php $i = -1; ?>
50
  <?php foreach($fields as $field): $i++ ?>
51
  <?php
52
+
53
  // if they didn't select a type, skip this field
54
  if($field->type == 'null')
55
  {
57
  }
58
 
59
 
60
+
61
  // set value, id and name for field
62
  $field->value = $this->load_value_for_input($post->ID, $field);
63
  $field->input_id = 'acf['.$i.'][value]';
core/update.php CHANGED
@@ -268,4 +268,7 @@ if(version_compare($version,'1.1.0') < 0)
268
  $version = '1.1.0';
269
  }
270
 
 
 
 
271
  ?>
268
  $version = '1.1.0';
269
  }
270
 
271
+
272
+ // update to latest acf version
273
+ update_option('acf_version','1.1.1');
274
  ?>
readme.txt CHANGED
@@ -77,6 +77,9 @@ http://support.plugins.elliotcondon.com/categories/advanced-custom-fields/
77
 
78
  == Changelog ==
79
 
 
 
 
80
  = 1.1.0 =
81
  * Lots of Field Type Bug Fixes
82
  * Now uses custom database tables to save and store data!
77
 
78
  == Changelog ==
79
 
80
+ = 1.1.1 =
81
+ * Fixed Slashes issue on edit screens for text based fields
82
+
83
  = 1.1.0 =
84
  * Lots of Field Type Bug Fixes
85
  * Now uses custom database tables to save and store data!