Post Snippets - Version 1.4.7

Version Description

Download this release

Release Info

Developer artstorm
Plugin Icon 128x128 Post Snippets
Version 1.4.7
Comparing to
See all releases

Code changes from version 1.4.6 to 1.4.7

Files changed (2) hide show
  1. post-snippets.php +13 -3
  2. readme.txt +4 -1
post-snippets.php CHANGED
@@ -3,7 +3,7 @@
3
  Plugin Name: Post Snippets
4
  Plugin URI: http://coding.cglounge.com/wordpress-plugins/post-snippets/
5
  Description: Stores snippets of HTML code or reoccurring text that you often use in your posts. You can use predefined variables to replace parts of the snippet on insert. All snippets are available in the post editor with a TinyMCE button or Quicktags.
6
- Version: 1.4.6
7
  Author: Johan Steen
8
  Author URI: http://coding.cglounge.com/
9
  Text Domain: post-snippets
@@ -243,7 +243,17 @@ JAVASCRIPT;
243
  $snippets[$i]['vars'] = str_replace(" ", "", trim($_POST[$i.'_vars']) );
244
  $snippets[$i]['shortcode'] = isset($_POST[$i.'_shortcode']) ? true : false;
245
  $snippets[$i]['quicktag'] = isset($_POST[$i.'_quicktag']) ? true : false;
246
- $snippets[$i]['snippet'] = htmlspecialchars_decode( trim(stripslashes($_POST[$i.'_snippet'])), ENT_NOQUOTES);
 
 
 
 
 
 
 
 
 
 
247
  }
248
  update_option($this->plugin_options, $snippets);
249
  $this->admin_message( __( 'Snippets have been updated.', 'post-snippets' ) );
@@ -279,7 +289,7 @@ JAVASCRIPT;
279
  </div>
280
  </div>
281
  <div class="clear"></div>
282
-
283
  <table class="widefat fixed" cellspacing="0">
284
  <thead>
285
  <tr>
3
  Plugin Name: Post Snippets
4
  Plugin URI: http://coding.cglounge.com/wordpress-plugins/post-snippets/
5
  Description: Stores snippets of HTML code or reoccurring text that you often use in your posts. You can use predefined variables to replace parts of the snippet on insert. All snippets are available in the post editor with a TinyMCE button or Quicktags.
6
+ Version: 1.4.7
7
  Author: Johan Steen
8
  Author URI: http://coding.cglounge.com/
9
  Text Domain: post-snippets
243
  $snippets[$i]['vars'] = str_replace(" ", "", trim($_POST[$i.'_vars']) );
244
  $snippets[$i]['shortcode'] = isset($_POST[$i.'_shortcode']) ? true : false;
245
  $snippets[$i]['quicktag'] = isset($_POST[$i.'_quicktag']) ? true : false;
246
+ /* Check if the plugin runs on PHP below version 5.1.0
247
+ Because of a bug in WP 2.7.x in includes/compat.php the htmlspecialchars_decode
248
+ don't revert back to a PHP 4.x compatible version. So this is a workaround to make
249
+ the plugin work correctly on PHP versions below 5.1.
250
+ This problem is fixed in WP 2.8.
251
+ */
252
+ if (version_compare(PHP_VERSION, '5.1.0', '<')) {
253
+ $snippets[$i]['snippet'] = htmlspecialchars_decode( trim(stripslashes($_POST[$i.'_snippet'])), ENT_NOQUOTES);
254
+ } else {
255
+ $snippets[$i]['snippet'] = wp_specialchars_decode( trim(stripslashes($_POST[$i.'_snippet'])), ENT_NOQUOTES);
256
+ }
257
  }
258
  update_option($this->plugin_options, $snippets);
259
  $this->admin_message( __( 'Snippets have been updated.', 'post-snippets' ) );
289
  </div>
290
  </div>
291
  <div class="clear"></div>
292
+
293
  <table class="widefat fixed" cellspacing="0">
294
  <thead>
295
  <tr>
readme.txt CHANGED
@@ -4,7 +4,7 @@ Donate link: http://coding.cglounge.com/wordpress-plugins/post-snippets/#pintwar
4
  Tags: post, admin, snippet, html, custom, page, dynamic, editor, quicktag
5
  Requires at least: 2.7
6
  Tested up to: 2.7.1
7
- Stable tag: 1.4.6
8
 
9
  Store snippets of HTML code or reoccurring text that you often use in your posts. Custom variables can be used.
10
 
@@ -47,6 +47,9 @@ Meditation.
47
 
48
  == Changelog ==
49
 
 
 
 
50
  = Version 1.4.6 - 25 Apr 2009 =
51
  * Updated all code to follow the WordPress Coding Standards for consistency, if someone wants to modify my code.
52
  * Removed the nodechangehandler from the TinyMCE js, as it didn't fill any purpose.
4
  Tags: post, admin, snippet, html, custom, page, dynamic, editor, quicktag
5
  Requires at least: 2.7
6
  Tested up to: 2.7.1
7
+ Stable tag: 1.4.7
8
 
9
  Store snippets of HTML code or reoccurring text that you often use in your posts. Custom variables can be used.
10
 
47
 
48
  == Changelog ==
49
 
50
+ = Version 1.4.7 - 27 Apr 2009 =
51
+ * Added a workaround for a bug in WordPress 2.7.x wp-includes/compat.php that prevented the plugin to work correctly on webservers running with PHP below version 5.1.0 together with WP 2.7.x. This bug is patched in WordPress 2.8.
52
+
53
  = Version 1.4.6 - 25 Apr 2009 =
54
  * Updated all code to follow the WordPress Coding Standards for consistency, if someone wants to modify my code.
55
  * Removed the nodechangehandler from the TinyMCE js, as it didn't fill any purpose.