Changeset 741 for trunk/lib


Ignore:
Timestamp:
Dec 29, 2020 3:18:44 AM (3 years ago)
Author:
anonymous
Message:

Remove excess whitespace and comments from css

Location:
trunk/lib
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/lib/Cart.inc.php

    r611 r741  
    4040        if ($p = mysql_fetch_assoc($qid)) {
    4141            $cart->add($product_id, $p['price'], 1, array(
    42                 'title' => $p['title'],
     42                'name' => $p['name'],
    4343                'shipping' => $p['shipping'],
    4444                'weight' => $p['weight'],
     
    6262    // User views cart.
    6363    foreach ($cart->getList() as $item) {
    64         printf("Item: %s\nQty: %s\nPrice: %s\n\n", $item['title'], $item['quantity'], $item['price']);
     64        printf("Item: %s\nQty: %s\nPrice: %s\n\n", $item['name'], $item['quantity'], $item['price']);
    6565    }
    6666    break;
     
    132132    * @param    float   $price      Price-per-quantity-unit for the item
    133133    * @param    float   $quantity   Quantity of items (can be fractional unites?)
    134     * @param    array   $specs      An array of additional specifications (title, weight, etc)
     134    * @param    array   $specs      An array of additional specifications (name, weight, etc)
    135135    * @return   float               The new adjusted quantity of this item.
    136136    * @author   Quinn Comendant <quinn@strangecode.com>
  • trunk/lib/Utilities.inc.php

    r738 r741  
    16831683    }
    16841684}
     1685
     1686/*
     1687* Test if a string is valid json.
     1688* https://stackoverflow.com/questions/6041741/fastest-way-to-check-if-a-string-is-json-in-php
     1689*
     1690* @access   public
     1691* @param    string  $str  The string to test.
     1692* @return   boolean       True if the string is valid json.
     1693* @author   Quinn Comendant <quinn@strangecode.com>
     1694* @since    06 Dec 2020 18:41:51
     1695*/
     1696function isJSON($str)
     1697{
     1698    json_decode($str);
     1699    return (json_last_error() === JSON_ERROR_NONE);
     1700}
Note: See TracChangeset for help on using the changeset viewer.