Changeset 145693
- Timestamp:
- 08/14/2009 02:32:16 AM (17 years ago)
- Location:
- gallery2-image-block-widget/trunk
- Files:
-
- 2 edited
-
Gallery2_ImageBlock.php (modified) (4 diffs)
-
readme.txt (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
gallery2-image-block-widget/trunk/Gallery2_ImageBlock.php
r64764 r145693 4 4 Plugin URI: http://www.theschierers.net/blog/g2-imageblock-plugin 5 5 Description: Display a Gallery2 Image Block if you're NOT using WPG2 6 Version: 0.1. 46 Version: 0.1.5 7 7 Author: Chris Schierer (aka Lentil) 8 8 Author URI: http://www.theschierers.net/blog … … 13 13 // 0.1.3 2008-05-07 Initial public release candidate. 14 14 // 0.1.4 2008-09-14 Update to mark valid for WP 2.6.2 15 // 0.1.5 2009-08-13 Add locally defined sanitize_key_names function, Valid for WP2.8.4 16 17 function sanitize_key_names($name) { 18 $name = strtolower($name); // all lowercase 19 $name = preg_replace('/[^a-z0-9 ]/','', $name); // nothing but a-z 0-9 and spaces 20 $name = preg_replace('/\s+/','-', $name); // spaces become hyphens 21 return $name; 22 } 23 15 24 16 25 // Put functions into one big function we'll call at the plugins_loaded … … 95 104 // Remember to sanitize and format use input appropriately. 96 105 foreach($options as $key => $value) 97 if(array_key_exists('G2_ImageBlock-'.sanitize ($key), $_POST))98 $options[$key] = strip_tags(stripslashes($_POST['G2_ImageBlock-'.sanitize ($key)]));106 if(array_key_exists('G2_ImageBlock-'.sanitize_key_names($key), $_POST)) 107 $options[$key] = strip_tags(stripslashes($_POST['G2_ImageBlock-'.sanitize_key_names($key)])); 99 108 100 109 // Save changes … … 107 116 // before displayihng them on the page. 108 117 foreach($options as $key => $value): ?> 109 <p style="text-align:left"><label for="G2_ImageBlock-<?=sanitize ($key)?>"><?=$key?>: <input style="width: 200px;" id="G2_ImageBlock-<?=sanitize($key)?>" name="G2_ImageBlock-<?=sanitize($key)?>" type="text" value="<?=htmlspecialchars($value, ENT_QUOTES)?>" /></label></p>118 <p style="text-align:left"><label for="G2_ImageBlock-<?=sanitize_key_names($key)?>"><?=$key?>: <input style="width: 200px;" id="G2_ImageBlock-<?=sanitize_key_names($key)?>" name="G2_ImageBlock-<?=sanitize_key_names($key)?>" type="text" value="<?=htmlspecialchars($value, ENT_QUOTES)?>" /></label></p> 110 119 <? endforeach; 111 120 echo '<input type="hidden" id="G2_ImageBlock-submit" name="G2_ImageBlock-submit" value="1" />'; -
gallery2-image-block-widget/trunk/readme.txt
r64764 r145693 4 4 Tags: Gallery2, image block, plugin, widget 5 5 Requires at least: 2.5.1? 6 Tested up to: 2. 6.26 Tested up to: 2.8.4 7 7 Stable tag: trunk 8 8
Note: See TracChangeset
for help on using the changeset viewer.