mirror of
https://github.com/Dolibarr/dolibarr.git
synced 2025-02-20 13:46:52 +01:00
Fix must use json_encode/decode instead of dol_json_encode/decode
This commit is contained in:
parent
e221e19212
commit
ad04646c05
|
|
@ -105,36 +105,39 @@ if (!isset($_GET["testget"]) && !isset($_POST["testpost"]) && !isset($_GET["main
|
|||
|
||||
print '</td></tr>';
|
||||
print '<tr><td>Sessions support</td><td>';
|
||||
|
||||
if (!function_exists("session_id"))
|
||||
{
|
||||
print '<img src="'.$ErrorPicturePath.'" alt="Error"> '.$langs->trans("ErrorPHPDoesNotSupportSessions");
|
||||
} else {
|
||||
print '<img src="'.$OkayPicturePath.'" alt="Ok"> '.$langs->trans("PHPSupportSessions");
|
||||
}
|
||||
|
||||
print '</td></tr>';
|
||||
|
||||
print '<tr><td>UTF-8 support</td><td>';
|
||||
|
||||
if (!function_exists("utf8_encode"))
|
||||
{
|
||||
print '<img src="'.$WarningPicturePath.'" alt="Warning"> '.$langs->trans("ErrorPHPDoesNotSupport", "UTF8");
|
||||
} else {
|
||||
print '<img src="'.$OkayPicturePath.'" alt="Ok"> '.$langs->trans("PHPSupport", "UTF8");
|
||||
}
|
||||
|
||||
print '</td></tr>';
|
||||
|
||||
print '<tr><td>MBString support</td><td>';
|
||||
|
||||
if (!function_exists("mb_check_encoding"))
|
||||
{
|
||||
print '<img src="'.$WarningPicturePath.'" alt="Warning"> '.$langs->trans("ErrorPHPDoesNotSupport", "mbstring");
|
||||
} else {
|
||||
print '<img src="'.$OkayPicturePath.'" alt="Ok"> '.$langs->trans("PHPSupport", "mbstring");
|
||||
}
|
||||
print '</td></tr>';
|
||||
|
||||
print '<tr><td>JSon support</td><td>';
|
||||
if (!function_exists("json_decode"))
|
||||
{
|
||||
print '<img src="'.$WarningPicturePath.'" alt="Warning"> '.$langs->trans("ErrorPHPDoesNotSupport", "json");
|
||||
} else {
|
||||
print '<img src="'.$OkayPicturePath.'" alt="Ok"> '.$langs->trans("PHPSupport", "json");
|
||||
}
|
||||
print '</td></tr>';
|
||||
|
||||
print '</table>';
|
||||
|
|
|
|||
|
|
@ -1200,7 +1200,7 @@ if ($dirins && $action == 'addproperty' && !empty($module) && !empty($tabobj))
|
|||
|
||||
if (!empty($addfieldentry['arrayofkeyval']) && !is_array($addfieldentry['arrayofkeyval']))
|
||||
{
|
||||
$addfieldentry['arrayofkeyval'] = dol_json_decode($addfieldentry['arrayofkeyval'], true);
|
||||
$addfieldentry['arrayofkeyval'] = json_decode($addfieldentry['arrayofkeyval'], true);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -611,7 +611,7 @@ if (empty($reshook))
|
|||
$tokenstring['stripe_user_id'] = $stripesup->id;
|
||||
$tokenstring['type'] = $stripesup->type;
|
||||
$sql = "UPDATE ".MAIN_DB_PREFIX."oauth_token";
|
||||
$sql .= " SET tokenstring = '".dol_json_encode($tokenstring)."'";
|
||||
$sql .= " SET tokenstring = '".$db->escape(json_encode($tokenstring))."'";
|
||||
$sql .= " WHERE site = 'stripe' AND (site_account IS NULL or site_account = '".$db->escape($site_account)."') AND fk_soc = ".$object->id." AND service = '".$db->escape($service)."' AND entity = ".$conf->entity; // Keep = here for entity. Only 1 record must be modified !
|
||||
// TODO Add site and site_account on oauth_token table
|
||||
$sql .= " WHERE fk_soc = ".$object->id." AND service = '".$db->escape($service)."' AND entity = ".$conf->entity; // Keep = here for entity. Only 1 record must be modified !
|
||||
|
|
@ -630,7 +630,7 @@ if (empty($reshook))
|
|||
$tokenstring['stripe_user_id'] = $stripesup->id;
|
||||
$tokenstring['type'] = $stripesup->type;
|
||||
$sql = "INSERT INTO ".MAIN_DB_PREFIX."oauth_token (service, fk_soc, entity, tokenstring)";
|
||||
$sql .= " VALUES ('".$db->escape($service)."', ".$object->id.", ".$conf->entity.", '".dol_json_encode($tokenstring)."')";
|
||||
$sql .= " VALUES ('".$db->escape($service)."', ".$object->id.", ".$conf->entity.", '".$db->escape(json_encode($tokenstring))."')";
|
||||
// TODO Add site and site_account on oauth_token table
|
||||
} catch (Exception $e) {
|
||||
$error++;
|
||||
|
|
|
|||
|
|
@ -110,7 +110,7 @@ class Stripe extends CommonObject
|
|||
$obj = $this->db->fetch_object($result);
|
||||
$tokenstring = $obj->tokenstring;
|
||||
|
||||
$tmparray = dol_json_decode($tokenstring);
|
||||
$tmparray = json_decode($tokenstring);
|
||||
$key = $tmparray->stripe_user_id;
|
||||
} else {
|
||||
$tokenstring = '';
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user