Plugin Directory

Changeset 496522


Ignore:
Timestamp:
01/28/2012 04:12:38 PM (14 years ago)
Author:
SpeakFeel
Message:

Fixed json encoding issue.

Location:
joemobi/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • joemobi/trunk/ReadMe.txt

    r489390 r496522  
    44Requires at least: 2.9.0
    55Tested up to: 3.3
    6 Stable tag: 2.04
     6Stable tag: 2.05
    77
    88Create Native Android and BlackBerry applications from your WordPress site using this plugin and http://www.JoeMobi.com
     
    8585= 2.04
    8686- Fixes publish interaction so that notification to not repeat on edits of published posts.
     87
     88= 2.05
     89- Fixes json encoding issue with some plugins.
    8790 
  • joemobi/trunk/singletons/response.php

    r491242 r496522  
    6262      // $encoded = str_replace('<br \/>', '<br \>', $encoded);
    6363     
    64       // Fix for parsing error? not sure. Leaving out for now.
    65       //$encoded = str_replace('\\/', '/', $encoded);
    66       //$encoded = str_replace('\>', '/>', $encoded);
    67      
    68      
     64      // Test
     65     
     66      $filtered = $encoded;
     67     
     68      // Fix for parsing errors.
     69      // Removes optional escaped /
     70            while (stripos($filtered, '\\/') !== false) {
     71                $filtered = str_replace('\\/', '/', $filtered);
     72            }
     73            //$filtered = str_replace('\\>', '/>', $filtered);
     74     
     75      // After the filter test to ensure we can still decode the value.
     76      $decoded = json_decode($filtered);
     77      if ($decoded && $decoded != null) {
     78        // Decode was ok. return filtered values. 
     79                return $filtered;
     80            }
     81     
     82      // Filter failed so return as it was. 
    6983      return $encoded;
     84     
    7085    } else {
    7186      // Use PEAR's Services_JSON encoder otherwise
Note: See TracChangeset for help on using the changeset viewer.