BUG 6400 Replacing json_encode|json_decode by their G implementations
This fixes the problem of some pages of ProcessMaker not working on PHP 5.1, since there is no json_encode or json_decode native functions on PHP 5.1.
This commit is contained in:
@@ -53,7 +53,7 @@ class WebResource
|
||||
if (isset($post['function'])&&$post['function']!='') {
|
||||
/*Call a function*/
|
||||
header('Content-Type: text/json');
|
||||
$parameters=json_decode((urldecode($post['parameters'])));
|
||||
$parameters=G::json_decode((urldecode($post['parameters'])));
|
||||
$paramsRef=array();
|
||||
foreach($parameters as $key => $value)
|
||||
{
|
||||
|
||||
@@ -12,7 +12,7 @@ try
|
||||
|
||||
}
|
||||
catch ( Exception $e ) {
|
||||
print json_encode ( $e->getMessage() );
|
||||
print G::json_encode ( $e->getMessage() );
|
||||
}
|
||||
|
||||
$steps = array();
|
||||
@@ -167,4 +167,4 @@ try
|
||||
}]
|
||||
}]";*/
|
||||
//echo $nodes;
|
||||
echo json_encode($steps);
|
||||
echo G::json_encode($steps);
|
||||
|
||||
@@ -14,7 +14,7 @@ try
|
||||
|
||||
}
|
||||
catch ( Exception $e ) {
|
||||
print json_encode ( $e->getMessage() );
|
||||
print G::json_encode ( $e->getMessage() );
|
||||
}
|
||||
|
||||
$steps = array();
|
||||
@@ -121,4 +121,4 @@ try
|
||||
'children' => $assignTaskChildren
|
||||
);
|
||||
|
||||
echo json_encode($steps);
|
||||
echo G::json_encode($steps);
|
||||
|
||||
@@ -261,12 +261,12 @@
|
||||
$result['ROUTES'] = $arrayRoutes;
|
||||
$result['EVENTS'] = $arrayEvents;
|
||||
$result['GATEWAYS'] = $arrayGateways;
|
||||
$aTasks = json_encode($arrayTasks);
|
||||
$aSubProcess = json_encode($arraySubProcess);
|
||||
$aRoutes = json_encode($arrayRoutes);
|
||||
$aEvents = json_encode($arrayEvents);
|
||||
$aGateways = json_encode($arrayGateways);
|
||||
$aProcess = json_encode($process);
|
||||
$aLanes = json_encode($lanes);
|
||||
$aTasks = G::json_encode($arrayTasks);
|
||||
$aSubProcess = G::json_encode($arraySubProcess);
|
||||
$aRoutes = G::json_encode($arrayRoutes);
|
||||
$aEvents = G::json_encode($arrayEvents);
|
||||
$aGateways = G::json_encode($arrayGateways);
|
||||
$aProcess = G::json_encode($process);
|
||||
$aLanes = G::json_encode($lanes);
|
||||
echo "tasks:$aTasks|gateways:$aGateways|events:$aEvents|annotations:$aLanes|process:$aProcess|subprocess:$aSubProcess|routes:$aRoutes";
|
||||
?>
|
||||
?>
|
||||
|
||||
@@ -289,16 +289,16 @@ if ( isset ($_REQUEST['action']) ) {
|
||||
|
||||
if(isset($_POST['VAR_OUT']) && $_POST['VAR_OUT'] != ''){
|
||||
$varOut = explode('|',$_POST['VAR_OUT']);
|
||||
$aVarOut1 = json_decode($varOut[0]);
|
||||
$aVarOut2 = json_decode($varOut[1]);
|
||||
$aVarOut1 = G::json_decode($varOut[0]);
|
||||
$aVarOut2 = G::json_decode($varOut[1]);
|
||||
for($i=1; $i<=count($aVarOut1); $i++){
|
||||
$out[$aVarOut1[$i-1]]= $aVarOut2[$i-1];
|
||||
}
|
||||
}
|
||||
if(isset($_POST['VAR_IN']) && $_POST['VAR_IN'] != ''){
|
||||
$varIn = explode('|',$_POST['VAR_IN']);
|
||||
$aVarIn1 = json_decode($varIn[0]);
|
||||
$aVarIn2 = json_decode($varIn[1]);
|
||||
$aVarIn1 = G::json_decode($varIn[0]);
|
||||
$aVarIn2 = G::json_decode($varIn[1]);
|
||||
for($i=1; $i<=count($aVarIn1); $i++){
|
||||
$in[$aVarIn1[$i-1]]= $aVarIn2[$i-1];
|
||||
}
|
||||
@@ -385,7 +385,7 @@ if ( isset ($_REQUEST['action']) ) {
|
||||
$ooutputDocument = new OutputDocument();
|
||||
if (isset($_GET['OUT_DOC_UID'])) {
|
||||
$rows = $ooutputDocument->load($_GET['OUT_DOC_UID']);
|
||||
$tmpData = json_encode( $rows ) ;
|
||||
$tmpData = G::json_encode( $rows ) ;
|
||||
$tmpData = str_replace("\\/","/",'{success:true,data:'.$tmpData.'}'); // unescape the slashes
|
||||
$result = $tmpData;
|
||||
echo $result;
|
||||
|
||||
@@ -174,6 +174,6 @@ Notes:
|
||||
/* Handles the error output. This error message will be sent to the uploadSuccess event handler. The event handler
|
||||
will have to check for any error messages and react as needed. */
|
||||
function HandleError($message) {
|
||||
die('{success:false,error:'.json_encode($message).'}');
|
||||
die('{success:false,error:'.G::json_encode($message).'}');
|
||||
}
|
||||
?>
|
||||
?>
|
||||
|
||||
@@ -47,7 +47,7 @@ try
|
||||
}
|
||||
|
||||
|
||||
$result = json_encode( $rows ) ;
|
||||
$result = G::json_encode( $rows ) ;
|
||||
$result = str_replace("\\/","/",'{success:true,data:'.$result.'}'); // unescape the slashes
|
||||
}
|
||||
else
|
||||
@@ -57,11 +57,11 @@ try
|
||||
echo $result;
|
||||
}
|
||||
|
||||
//print json_encode( $result ) ;
|
||||
//print G::json_encode( $result ) ;
|
||||
|
||||
}
|
||||
catch ( Exception $e ) {
|
||||
print json_encode ( $e->getMessage() );
|
||||
print G::json_encode ( $e->getMessage() );
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
@@ -14,5 +14,5 @@ if (isset($_GET['tid'] ))
|
||||
array_shift($rows);
|
||||
$result['totalCount'] = count($rows);
|
||||
$result['data'] = $rows;
|
||||
print json_encode($result);
|
||||
print G::json_encode($result);
|
||||
?>
|
||||
|
||||
@@ -15,13 +15,13 @@ try
|
||||
$rows = $o->load($_GET['tid']);
|
||||
}
|
||||
|
||||
$tmpData = json_encode( $rows ) ;
|
||||
$tmpData = G::json_encode( $rows ) ;
|
||||
$tmpData = str_replace("\\/","/",'{success:true,data:'.$tmpData.'}'); // unescape the slashes
|
||||
|
||||
$result = $tmpData;
|
||||
echo $result;
|
||||
}
|
||||
catch ( Exception $e ) {
|
||||
print json_encode ( $e->getMessage() );
|
||||
print G::json_encode ( $e->getMessage() );
|
||||
}
|
||||
?>
|
||||
?>
|
||||
|
||||
@@ -29,9 +29,9 @@ try
|
||||
|
||||
$result['totalCount'] = count($rows);
|
||||
$result['data'] = $rows;
|
||||
print json_encode( $result ) ;
|
||||
print G::json_encode( $result ) ;
|
||||
|
||||
}
|
||||
catch ( Exception $e ) {
|
||||
print json_encode ( $e->getMessage() );
|
||||
print G::json_encode ( $e->getMessage() );
|
||||
}
|
||||
|
||||
@@ -10,7 +10,7 @@ try
|
||||
$oEvent = new Event();
|
||||
$aRows = $oEvent->load($_GET['startInterId']);
|
||||
//$sch_uid = $oData['EVN_ACTION'];
|
||||
$result = json_encode( $aRows );
|
||||
$result = G::json_encode( $aRows );
|
||||
$result = str_replace("\\/","/",'{success:true,data:'.$result.'}'); // unescape the slashes
|
||||
/*else
|
||||
{
|
||||
@@ -18,10 +18,10 @@ try
|
||||
}*/
|
||||
echo $result;
|
||||
}
|
||||
//print json_encode( $result ) ;
|
||||
//print G::json_encode( $result ) ;
|
||||
}
|
||||
catch ( Exception $e ) {
|
||||
print json_encode ( $e->getMessage() );
|
||||
print G::json_encode ( $e->getMessage() );
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -16,8 +16,8 @@ try
|
||||
}
|
||||
// $result['totalCount'] = count($rows);
|
||||
// $result['data'] = $rows;
|
||||
// print json_encode( $result) ;
|
||||
$tmpData = json_encode( $rows ) ;
|
||||
// print G::json_encode( $result) ;
|
||||
$tmpData = G::json_encode( $rows ) ;
|
||||
$tmpData = str_replace("\\/","/",'{success:true,data:'.$tmpData.'}'); // unescape the slashes
|
||||
|
||||
$result = $tmpData;
|
||||
@@ -26,5 +26,5 @@ try
|
||||
|
||||
}
|
||||
catch ( Exception $e ) {
|
||||
print json_encode ( $e->getMessage() );
|
||||
print G::json_encode ( $e->getMessage() );
|
||||
}
|
||||
|
||||
@@ -14,5 +14,5 @@ if ( isset($_GET['pid'] )&& isset($_GET['action']) )
|
||||
}
|
||||
$result['totalCount'] = count($rows);
|
||||
$result['data'] = $rows;
|
||||
print json_encode($result);
|
||||
print G::json_encode($result);
|
||||
?>
|
||||
|
||||
@@ -20,7 +20,7 @@ if (isset($_GET['tid']))
|
||||
$rows = $oOutputDocument->load($_GET['tid']);
|
||||
}
|
||||
|
||||
$tmpData = json_encode( $rows ) ;
|
||||
$tmpData = G::json_encode( $rows ) ;
|
||||
$tmpData = str_replace("\\/","/",'{success:true,data:'.$tmpData.'}'); // unescape the slashes
|
||||
|
||||
$result = $tmpData;
|
||||
@@ -28,9 +28,9 @@ if (isset($_GET['tid']))
|
||||
|
||||
/* $result['totalCount'] = count($rows);
|
||||
$result['data'] = $rows;
|
||||
print json_encode( $result) ;*/
|
||||
print G::json_encode( $result) ;*/
|
||||
|
||||
}
|
||||
catch ( Exception $e ) {
|
||||
print json_encode ( $e->getMessage() );
|
||||
print G::json_encode ( $e->getMessage() );
|
||||
}
|
||||
|
||||
@@ -31,10 +31,10 @@ try
|
||||
|
||||
$result['totalCount'] = count($rows);
|
||||
$result['data'] = $rows;
|
||||
print json_encode( $result ) ;
|
||||
print G::json_encode( $result ) ;
|
||||
|
||||
}
|
||||
catch ( Exception $e ) {
|
||||
print json_encode ( $e->getMessage() );
|
||||
print G::json_encode ( $e->getMessage() );
|
||||
}
|
||||
?>
|
||||
|
||||
@@ -51,7 +51,7 @@ $Fields['FILENAME_LINKXPDL'] = $xpdlFields['FILENAME_LINKXPDL'];
|
||||
$Fields['FILENAME_LINK'] = $http . $_SERVER['HTTP_HOST'] . '/sys' . SYS_SYS . '/' . SYS_LANG . '/' . SYS_SKIN . '/processes/' . $Fields['FILENAME_LINK'];
|
||||
$Fields['FILENAME_LINKXPDL'] = $http . $_SERVER['HTTP_HOST'] . '/sys' . SYS_SYS . '/' . SYS_LANG . '/' . SYS_SKIN . '/processes/' . $Fields['FILENAME_LINKXPDL'];
|
||||
|
||||
$result = json_encode( $Fields );
|
||||
$result = G::json_encode( $Fields );
|
||||
$result = str_replace("\\/","/",'{success:true,data:'.$result.'}'); // unescape the slashes
|
||||
echo $result;
|
||||
|
||||
|
||||
@@ -36,10 +36,10 @@ try
|
||||
|
||||
$result['totalCount'] = count($rows);
|
||||
$result['data'] = $rows;
|
||||
print json_encode( $result ) ;
|
||||
print G::json_encode( $result ) ;
|
||||
|
||||
}
|
||||
catch ( Exception $e ) {
|
||||
print json_encode ( $e->getMessage() );
|
||||
print G::json_encode ( $e->getMessage() );
|
||||
}
|
||||
?>
|
||||
?>
|
||||
|
||||
@@ -30,11 +30,11 @@ try
|
||||
|
||||
$result['totalCount'] = count($rows);
|
||||
$result['data'] = $rows;
|
||||
print json_encode( $result ) ;
|
||||
print G::json_encode( $result ) ;
|
||||
|
||||
}
|
||||
catch ( Exception $e ) {
|
||||
print json_encode ( $e->getMessage() );
|
||||
print G::json_encode ( $e->getMessage() );
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
@@ -9,7 +9,7 @@ try
|
||||
if($_GET['type'] == 2) //Loading sub process details
|
||||
{
|
||||
$rows = $oProcessMap->subProcessExtProperties($_GET['pid'], $_GET['tid'],'','0');
|
||||
$tmpData = json_encode( $rows ) ;
|
||||
$tmpData = G::json_encode( $rows ) ;
|
||||
$tmpData = str_replace("\\/","/",'{success:true,data:'.$tmpData.'}'); // unescape the slashes
|
||||
|
||||
$result = $tmpData;
|
||||
@@ -20,12 +20,12 @@ try
|
||||
$rows = $oProcessMap->subProcessExtProperties($_GET['pid'], $_GET['tid'],'',$_GET['type']);
|
||||
$result['totalCount'] = count($rows);
|
||||
$result['data'] = $rows;
|
||||
print json_encode( $result ) ;
|
||||
print G::json_encode( $result ) ;
|
||||
}
|
||||
|
||||
}
|
||||
catch ( Exception $e ) {
|
||||
print json_encode ( $e->getMessage() );
|
||||
print G::json_encode ( $e->getMessage() );
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
@@ -49,7 +49,7 @@ try
|
||||
}
|
||||
}
|
||||
|
||||
$tmpData = json_encode( $rows ) ;
|
||||
$tmpData = G::json_encode( $rows ) ;
|
||||
$tmpData = str_replace("\\/","/",'{success:true,data:'.$tmpData.'}'); // unescape the slashes
|
||||
|
||||
$result = $tmpData;
|
||||
@@ -58,7 +58,7 @@ try
|
||||
}
|
||||
|
||||
catch ( Exception $e ) {
|
||||
print json_encode ( $e->getMessage() );
|
||||
print G::json_encode ( $e->getMessage() );
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
@@ -18,11 +18,11 @@ try
|
||||
|
||||
$result['totalCount'] = count($rows);
|
||||
$result['data'] = $rows;
|
||||
print json_encode( $result ) ;
|
||||
print G::json_encode( $result ) ;
|
||||
|
||||
}
|
||||
catch ( Exception $e ) {
|
||||
print json_encode ( $e->getMessage() );
|
||||
print G::json_encode ( $e->getMessage() );
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
@@ -15,10 +15,10 @@ try
|
||||
|
||||
$result['totalCount'] = count($rows);
|
||||
$result['data'] = $rows;
|
||||
print json_encode( $result ) ;
|
||||
print G::json_encode( $result ) ;
|
||||
|
||||
}
|
||||
catch ( Exception $e ) {
|
||||
print json_encode ( $e->getMessage() );
|
||||
print G::json_encode ( $e->getMessage() );
|
||||
}
|
||||
?>
|
||||
|
||||
@@ -56,5 +56,5 @@ foreach ( $aFields as $aField ) {
|
||||
array_shift($aRows);
|
||||
$result['totalCount'] = count($aRows);
|
||||
$result['data'] = $aRows;
|
||||
print json_encode($result);
|
||||
print G::json_encode($result);
|
||||
?>
|
||||
|
||||
@@ -40,7 +40,7 @@ try{
|
||||
$result['status_code'] = $idProcess;
|
||||
$result['message'] = "the process don't exists";
|
||||
$result['timestamp'] = date('Y-m-d H:i:s');
|
||||
echo json_encode($result);
|
||||
echo G::json_encode($result);
|
||||
die;
|
||||
}
|
||||
}
|
||||
@@ -49,15 +49,15 @@ try{
|
||||
$result['status_code'] = 1;
|
||||
$result['message'] = "you don't send the process uid";
|
||||
$result['timestamp'] = date('Y-m-d H:i:s');
|
||||
echo json_encode($result);
|
||||
echo G::json_encode($result);
|
||||
die;
|
||||
}
|
||||
$aTasks = json_decode ( $_POST['tasks'] );
|
||||
$aRoutes = json_decode ( $_POST['routes'] );
|
||||
$aEvents = json_decode ( $_POST['events'] );
|
||||
$aGateways = json_decode ( $_POST['gateways'] );
|
||||
$aAnnotations = json_decode ( $_POST['annotations'] );
|
||||
$aSubprocess = json_decode ( $_POST['subprocess'] );
|
||||
$aTasks = G::json_decode ( $_POST['tasks'] );
|
||||
$aRoutes = G::json_decode ( $_POST['routes'] );
|
||||
$aEvents = G::json_decode ( $_POST['events'] );
|
||||
$aGateways = G::json_decode ( $_POST['gateways'] );
|
||||
$aAnnotations = G::json_decode ( $_POST['annotations'] );
|
||||
$aSubprocess = G::json_decode ( $_POST['subprocess'] );
|
||||
$fields = $oProcess->serializeProcess($idProcess);
|
||||
$oData = unserialize($fields);
|
||||
$aRoutes = $oProcess->super_unique($aRoutes);
|
||||
|
||||
@@ -8,7 +8,7 @@ require_once ( "classes/model/AdditionalTables.php" );
|
||||
require_once ( "classes/model/Fields.php" );
|
||||
// passing the parameters
|
||||
$pmTableName = (isset($_POST['tableName'])) ? $_POST['tableName'] : 'contenders';
|
||||
$pmTableFields = (isset($_POST['tableFields'])) ? json_decode($_POST['tableFields']) : array();
|
||||
$pmTableFields = (isset($_POST['tableFields'])) ? G::json_decode($_POST['tableFields']) : array();
|
||||
|
||||
// default parameters
|
||||
//$pmTableName = 'Sender';
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
* Coral Gables, FL, 33134, USA, or email info@colosa.com.
|
||||
*
|
||||
*/
|
||||
$aData = json_decode($_POST['data']);
|
||||
$aData = G::json_decode($_POST['data']);
|
||||
$appSelectedUids = array ();
|
||||
$items = explode(",",$_POST['APP_UIDS']);
|
||||
foreach ($items as $item) {
|
||||
|
||||
@@ -82,8 +82,8 @@ if (($RBAC_Response=$RBAC->userCanAccess("PM_FACTORY"))!=1) return $RBAC_Respons
|
||||
$aVariables = array();
|
||||
if(isset($aData['FIELDS']))
|
||||
{
|
||||
$aFields = json_decode($_POST['FIELDS']);
|
||||
$aVariables = json_decode($_POST['VARIABLES']);
|
||||
$aFields = G::json_decode($_POST['FIELDS']);
|
||||
$aVariables = G::json_decode($_POST['VARIABLES']);
|
||||
}
|
||||
$aData['FIELDS'] = array();
|
||||
for($i=0;$i<count($aFields);$i++){
|
||||
|
||||
@@ -305,7 +305,7 @@ try {
|
||||
$oProcessMap->processFilesManager($oData->pro_uid);
|
||||
break;
|
||||
case 'exploreDirectory':
|
||||
$objData = json_decode($_REQUEST['data']);
|
||||
$objData = G::json_decode($_REQUEST['data']);
|
||||
$_SESSION['PFMDirectory'] = $objData->{'main_directory'};
|
||||
$oProcessMap->exploreDirectory($oData->pro_uid, $oData->main_directory, $oData->directory);
|
||||
break;
|
||||
@@ -505,4 +505,4 @@ try {
|
||||
catch (Exception $oException) {
|
||||
die($oException->getMessage() . "\n" . $oException->getTraceAsString());
|
||||
}
|
||||
?>
|
||||
?>
|
||||
|
||||
Reference in New Issue
Block a user