Plugin Directory

Changeset 848510


Ignore:
Timestamp:
01/30/2014 10:28:15 PM (12 years ago)
Author:
ajferg
Message:

1.7.6 Update

Location:
tailored-tools
Files:
36 added
4 edited

Legend:

Unmodified
Added
Removed
  • tailored-tools/trunk/lib/class.forms.php

    r811631 r848510  
    287287        if (!$q['required'])        return;
    288288        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';
    291292        } else
    292293        if ($q['type'] == 'file') {
  • tailored-tools/trunk/readme.txt

    r811631 r848510  
    33Tags:               
    44Requires at least:  3.0
    5 Tested up to:       3.7
    6 Stable tag:         1.7.4
     5Tested up to:       3.8.1
     6Stable tag:         1.7.6
    77
    88Contains some helper classes to help you build custom forms.
     
    5454
    5555== 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).
    5661
    5762= 1.7.4 =
  • tailored-tools/trunk/shortcodes.php

    r811631 r848510  
    4242     *  Shortcode:  [tabs] for jQuery UI Tabs
    4343     *  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">
    4545     */
    4646    function shortcode_ui_tabs($atts=false, $content=null) {
     47        if (!class_exists('SmartDOMDocument'))  require_once('lib/class.smartdomdocument.php');
    4748        // Strip start and end <p> tags to avoid broken HTML
    4849        if (substr($content, 0, 4)=='</p>') $content = substr($content, 4);
     
    5051        $content = trim($content);
    5152       
    52         $dom = new DOMDocument();
     53        $dom = new SmartDOMDocument();
    5354        $dom->loadHTML( $content );
    5455        // Loop H2 and wrap
     
    6667            }
    6768        }
    68         // Now go through and remove empty tags
    69         $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_nodes
    74         }
    7569       
    76         $output = preg_replace('~<(?:!DOCTYPE|/?(?:html|body))[^>]*>\s*~i', '', $dom->saveHTML());
     70        $output = $dom->saveHTMLExact();
    7771        $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>&nbsp;</p>'), '', $output);
    7874        // Fix some strange HTML
    7975        $output = str_replace('<p><form', '<form', $output);
     
    8480        return $output;
    8581    }
     82   
    8683   
    8784
  • tailored-tools/trunk/tools.php

    r811631 r848510  
    33Plugin Name:    Tailored Tools
    44Description:    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.4
     5Version:        1.7.6
    66Author:         Tailored Web Services
    77Author URI:     http://www.tailored.com.au
Note: See TracChangeset for help on using the changeset viewer.