WordPress.org

Plugin Directory


Ignore:
Timestamp:
08/22/17 08:48:18 (3 months ago)
Author:
bastho
Message:

Retro-compatibility for php < 5.5, remove fatal error "Can't use function return value in write context"
http://php.net/manual/en/function.empty.php

File:
1 edited

Legend:

Unmodified
Added
Removed
  • event-post/trunk/eventpost.php

    r1714641 r1717414  
    44  Plugin URI: http://event-post.com 
    55  Description: Add calendar and/or geolocation metadata on posts. For a better experience, we recommand to use it with <a href="https://wordpress.org/plugins/shortcode-ui/" target="_blank">Shortcake (shortcode UI)</a> installed. 
    6   Version: 5.0 
     6  Version: 5.0.1 
    77  Author: N.O.U.S. Open Useful and Simple 
    88  Contributors: bastho,ecolosites 
     
    600600    /** 
    601601     * 
     602     * @param type $str 
     603     * @return string 
     604     * @since 5.0.1 
     605     */ 
     606    public function date_cleanup($str){ 
     607        return trim(str_replace(array('0', ' ', ':', '-'), '', $str)); 
     608    } 
     609 
     610    /** 
     611     * 
    602612     * @param string $str 
    603613     * @return boolean 
    604614     */ 
    605615    public function dateisvalid($str) { 
    606         return is_string($str) && trim(str_replace(array(':', '0'), '', $str)) != ''; 
     616        return is_string($str) && $this->date_cleanup($str) != ''; 
    607617    } 
    608618 
     
    19231933        $tax = (false !== $tax = filter_input(INPUT_GET, 'tax')) ? $tax : ''; 
    19241934 
    1925         if(empty(str_replace(array('0', ' ', ':', '-'), '', $from))){ 
     1935        $cleaned_from = $this->date_cleanup($from); 
     1936        $cleaned_to = $this->date_cleanup($to); 
     1937        if(empty($cleaned_from)){ 
    19261938            $from=false; 
    19271939        } 
    1928         if(empty(str_replace(array('0', ' ', ':', '-'), '', $to))){ 
     1940        if(empty($cleaned_to)){ 
    19291941            $to=false; 
    19301942        } 
Note: See TracChangeset for help on using the changeset viewer.