correction à tester/valider : on peut passer les paramètres de l'url du PDF en string systématiquement

This commit is contained in:
cy_altern 2021-01-14 21:40:43 +01:00
parent 70ef56ad29
commit 4240e86452

View file

@ -4,19 +4,23 @@ if (!defined('_ECRIRE_INC_VERSION')){
} }
function inc_charger_pdf_dist($fichier_pdf, $contexte = []){ function inc_charger_pdf_dist($fichier_pdf, $contexte = []){
var_dump($contexte);
$login = lire_config('curl_login'); $login = lire_config('curl_login');
$password = lire_config('curl_mdp'); $password = lire_config('curl_mdp');
$url = $GLOBALS['meta']['adresse_site'].'/spip.php?page=spipdf&spipdf='.$fichier_pdf; $url = $GLOBALS['meta']['adresse_site'].'/spip.php?page=spipdf&spipdf='.$fichier_pdf;
if (is_array($contexte) and count($contexte)) { if (is_array($contexte) and count($contexte)) {
foreach ($contexte as $champ => $val) { foreach ($contexte as $champ => $val) {
if (intval($val)) { /* if (intval($val) === $val) {
// if (intval($val)) {
$val = intval($val); $val = intval($val);
} else { } else {
$val = "$val"; $val = "$val";
} }
*/
$url .= "&$champ=$val"; $url .= "&$champ=$val";
} }
} }
$CurlConnect = curl_init(); $CurlConnect = curl_init();
// pour une connexion https locale avec certificat auto-signé // pour une connexion https locale avec certificat auto-signé