Changeset 848510
- Timestamp:
- 01/30/2014 10:28:15 PM (12 years ago)
- Location:
- tailored-tools
- Files:
-
- 36 added
- 4 edited
-
tags/1.7.6 (added)
-
tags/1.7.6/embed-js.php (added)
-
tags/1.7.6/form.contact.php (added)
-
tags/1.7.6/form.sample.php (added)
-
tags/1.7.6/googlemaps.php (added)
-
tags/1.7.6/js (added)
-
tags/1.7.6/js/chosen.jquery.min.js (added)
-
tags/1.7.6/js/jquery.timepicker.js (added)
-
tags/1.7.6/js/loader.js (added)
-
tags/1.7.6/js/tinymce.js.php (added)
-
tags/1.7.6/lib (added)
-
tags/1.7.6/lib/class.akismet.php (added)
-
tags/1.7.6/lib/class.ayah.php (added)
-
tags/1.7.6/lib/class.forms.php (added)
-
tags/1.7.6/lib/class.recaptcha.php (added)
-
tags/1.7.6/lib/class.smartdomdocument.php (added)
-
tags/1.7.6/lib/countries.php (added)
-
tags/1.7.6/lib/json.php (added)
-
tags/1.7.6/lib/lib.ayah.php (added)
-
tags/1.7.6/lib/recaptchalib.php (added)
-
tags/1.7.6/lib/tinymce.php (added)
-
tags/1.7.6/readme.txt (added)
-
tags/1.7.6/resource (added)
-
tags/1.7.6/resource/admin.css (added)
-
tags/1.7.6/resource/calendar.png (added)
-
tags/1.7.6/resource/chosen-sprite.png (added)
-
tags/1.7.6/resource/chosen-sprite@2x.png (added)
-
tags/1.7.6/resource/chosen.css (added)
-
tags/1.7.6/resource/custom.css (added)
-
tags/1.7.6/resource/exclaim.gif (added)
-
tags/1.7.6/resource/icons.png (added)
-
tags/1.7.6/resource/mce-icon.gif (added)
-
tags/1.7.6/resource/time.png (added)
-
tags/1.7.6/shortcodes.php (added)
-
tags/1.7.6/tools.php (added)
-
trunk/lib/class.forms.php (modified) (1 diff)
-
trunk/lib/class.smartdomdocument.php (added)
-
trunk/readme.txt (modified) (2 diffs)
-
trunk/shortcodes.php (modified) (4 diffs)
-
trunk/tools.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
tailored-tools/trunk/lib/class.forms.php
r811631 r848510 287 287 if (!$q['required']) return; 288 288 if ($q['type'] != 'file') { 289 if (!isset($_POST[$key]) || trim($_POST[$key])=='') $this->error[] = $q['error']; 290 if ($q['type'] == 'email' && !empty($_POST[$key]) && !is_email($_POST[$key])) $this->error[] = '<em>'.$_POST[$key].'</em> does not look like an email address'; 289 // if (!isset($_POST[$key]) || trim($_POST[$key])=='') $this->error[] = $q['error']; 290 if (!isset($_POST[$key]) || (!is_array($_POST[$key]) && trim($_POST[$key])=='')) $this->error[] = $q['error']; 291 if ($q['type']=='email' && !empty($_POST[$key]) && !is_email($_POST[$key])) $this->error[] = '<em>'.$_POST[$key].'</em> does not look like an email address'; 291 292 } else 292 293 if ($q['type'] == 'file') { -
tailored-tools/trunk/readme.txt
r811631 r848510 3 3 Tags: 4 4 Requires at least: 3.0 5 Tested up to: 3. 76 Stable tag: 1.7. 45 Tested up to: 3.8.1 6 Stable tag: 1.7.6 7 7 8 8 Contains some helper classes to help you build custom forms. … … 54 54 55 55 == Changelog == 56 = 1.7.6 = 57 * Noticed a problem with [tabs] shortcode not including some image elements. Now resolved, plus added a filter for allowed tags (tailored_tools_ui_tabs_allowed_nodes) 58 59 = 1.7.5 = 60 * We were trim()ing a _POST value without checking if it was an array. Caused issues on at least one client. Now fixed (checking if array before trim). 56 61 57 62 = 1.7.4 = -
tailored-tools/trunk/shortcodes.php
r811631 r848510 42 42 * Shortcode: [tabs] for jQuery UI Tabs 43 43 * Javascript does the heavy lifting 44 * Revised this to use DOMDocument instead of str_replace, to allow for <h2 id="something">44 * Revised this to use SmartDOMDocument instead of str_replace, to allow for <h2 id="something"> 45 45 */ 46 46 function shortcode_ui_tabs($atts=false, $content=null) { 47 if (!class_exists('SmartDOMDocument')) require_once('lib/class.smartdomdocument.php'); 47 48 // Strip start and end <p> tags to avoid broken HTML 48 49 if (substr($content, 0, 4)=='</p>') $content = substr($content, 4); … … 50 51 $content = trim($content); 51 52 52 $dom = new DOMDocument();53 $dom = new SmartDOMDocument(); 53 54 $dom->loadHTML( $content ); 54 55 // Loop H2 and wrap … … 66 67 } 67 68 } 68 // Now go through and remove empty tags69 $allowed_nodes = array( 'param', 'embed', 'iframe', 'div', 'object' );70 $xp = new DOMXPath($dom);71 foreach($xp->query('//*[not(node() or self::br) or normalize-space() = ""]') as $node) {72 if (in_array($node->tagName, $allowed_nodes)) continue;73 $node->parentNode->removeChild($node); // For some reason, this breaks on iFrames and some other elements. Dodge by $allowed_nodes74 }75 69 76 $output = preg_replace('~<(?:!DOCTYPE|/?(?:html|body))[^>]*>\s*~i', '', $dom->saveHTML());70 $output = $dom->saveHTMLExact(); 77 71 $output = '<div class="ui_tabs">'."\n".do_shortcode($output)."\n".'</div>'."\n"; 72 // Try this to remove empty paragraphs 73 $output = str_replace(array('<p></p>', '<p> </p>'), '', $output); 78 74 // Fix some strange HTML 79 75 $output = str_replace('<p><form', '<form', $output); … … 84 80 return $output; 85 81 } 82 86 83 87 84 -
tailored-tools/trunk/tools.php
r811631 r848510 3 3 Plugin Name: Tailored Tools 4 4 Description: Adds some functionality to WordPress that you'll need. (Version 1.5+ has different style rules. Do not upgrade without checking these.) 5 Version: 1.7. 45 Version: 1.7.6 6 6 Author: Tailored Web Services 7 7 Author URI: http://www.tailored.com.au
Note: See TracChangeset
for help on using the changeset viewer.