Plugin Directory

Changeset 1518056


Ignore:
Timestamp:
10/19/2016 07:01:51 PM (9 years ago)
Author:
jensmueller
Message:

fixed a small bug with multiple links to one product on the same page.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • easy-amazon-product-information/trunk/eapi_handler.php

    r1507620 r1518056  
    15091509        $pA->features = "";
    15101510    }else{
    1511         $pA->features = preg_replace("#\"#", "[-]" ,$pA->features);
    1512         $pA->features = json_encode( $pA->features, JSON_UNESCAPED_UNICODE);
     1511        $json_test = true;
     1512        if(!is_array($pA->features)){
     1513            json_decode($pA->features);
     1514            $json_test = false;
     1515        }//it must be prevented that the 'preg_replace' function is executed twice on a json object
     1516        if(!(json_last_error() == JSON_ERROR_NONE) || ($json_test)){
     1517            $pA->features = preg_replace("#\"#", "[-]" ,$pA->features);
     1518            $pA->features = json_encode( $pA->features, JSON_UNESCAPED_UNICODE);
     1519        }
    15131520    }
    15141521    if(!isset($pA->title)){
Note: See TracChangeset for help on using the changeset viewer.