Browse Source

on transforme certains caracteres interdits en xml en unicode

svn/root/tags/v1.1.10
tofulm@gmail.com 7 years ago
parent
commit
3fd04e29c6
  1. 13
      sms_fonctions.php

13
sms_fonctions.php

@ -33,10 +33,11 @@ function smsfactor($message,$destinataire,$arg){
$username = lire_config('sms/login_smsfactor');
$password = lire_config('sms/mdp_smsfactor');
$sender = ($arg['sender']) ? $arg['sender'] : lire_config('sms/expediteur_smsfactor');
$message = nettoyer_xml($message);
require_once('classes/smsfactor/sendSMSclass.php');
$SENDSMS = new SendSMSclass();
$retour = $SENDSMS->SendSMS($username,$password,$sender,$message,$destinataire);
$retour = $SENDSMS->SendSMS($username,$password,$sender,$message,$destinataire);
$reponse = new SimpleXMLElement($retour);
if ( $reponse->message == "OK" ){
@ -45,3 +46,13 @@ function smsfactor($message,$destinataire,$arg){
return false;
}
}
function nettoyer_xml($texte){
$texte = str_replace('&', '&', $texte);
$texte = str_replace('<', '&lt;', $texte);
$texte = str_replace('>', '&gt;', $texte);
$texte = str_replace('"', '&quot;', $texte);
$texte = str_replace("'", "&apos;", $texte);
return $texte;
}

Loading…
Cancel
Save