WordPress.org

Plugin Directory

Changeset 1663687


Ignore:
Timestamp:
05/24/17 07:10:29 (5 months ago)
Author:
urkekg
Message:

Fix bug 'number_format() expects parameter 1 to be float, string given' when change percent value is empty

Location:
stock-quote
Files:
19 added
2 edited

Legend:

Unmodified
Added
Removed
  • stock-quote/trunk/readme.txt

    r1661836 r1663687  
    55Requires at least: 3.9.0 
    66Tested up to: 4.7.5 
    7 Stable tag: 0.1.7 
     7Stable tag: 0.1.7.1 
    88License: GPLv3 or later 
    99License URI: http://www.gnu.org/licenses/gpl-3.0.html 
     
    144144 
    145145== Changelog == 
     146= 0.1.7.1 (20170524) = 
     147* Fix: when changep is empty - PHP Warning:  number_format() expects parameter 1 to be float, string given in wp-content/plugins/stock-quote/stock-quote.php on line 436 
     148 
    146149= 0.1.7 (20170521) = 
    147150* Add: `decimals`, `number_format` and `template` as shortcode parameters 
  • stock-quote/trunk/stock-quote.php

    r1661836 r1663687  
    44Plugin URI: https://urosevic.net/wordpress/plugins/stock-quote/ 
    55Description: Quick and easy insert static inline stock information for specific exchange symbol by customizable shortcode. 
    6 Version: 0.1.7 
     6Version: 0.1.7.1 
    77Author: Aleksandar Urosevic 
    88Author URI: https://urosevic.net 
     
    7070 */ 
    7171 
    72 define( 'WPAU_STOCK_QUOTE_VER', '0.1.7' ); 
     72define( 'WPAU_STOCK_QUOTE_VER', '0.1.7.1' ); 
    7373 
    7474if ( ! class_exists( 'WPAU_STOCK_QUOTE' ) ) { 
     
    392392                $q_exch    = $quote->e; 
    393393 
     394                // Fallback if numeric values are zero or empty 
     395                if ( empty( $q_change ) ) { 
     396                    $q_change = (int) 0; 
     397                } 
     398                if ( empty( $q_price ) ) { 
     399                    $q_price = (int) 0; 
     400                } 
     401                if ( empty( $q_changep ) ) { 
     402                    $q_changep = (int) 0; 
     403                } 
     404 
    394405                // Define class based on change. 
    395406                $prefix    = ''; 
Note: See TracChangeset for help on using the changeset viewer.