From f6a480f82813b85128a0a36729d5319dda0688fc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ricardo=20Montan=CC=83ana?= Date: Mon, 17 Mar 2014 23:45:13 +0100 Subject: [PATCH] #9 Corregido el problema de detectar http y https en el enlace de la url de llamada. --- EtiquetasPDF.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/EtiquetasPDF.php b/EtiquetasPDF.php index a9fec0a..ae00d1e 100644 --- a/EtiquetasPDF.php +++ b/EtiquetasPDF.php @@ -72,9 +72,8 @@ class EtiquetasPDF { //print_r($def);echo $bdd;die(); // Iniciamos la creación del documento $this->def = simplexml_load_file($definicion); - $this->bdd->ejecuta(trim($this->def->Datos->Consulta)); //Ejecuta la consulta y prepara las variables de la base de datos. - //$this->bdd->ejecuta(trim($this->def->Datos->Consulta)); + $this->bdd->ejecuta(trim($this->def->Datos->Consulta)); //Inicializa las variables para el control de las etiquetas. $this->pdf->AddPage(); $tamLinea = 5; @@ -82,7 +81,8 @@ class EtiquetasPDF { $primero = true; $i = 0; $url = explode("/", $_SERVER['SCRIPT_NAME']); $aplicacion = $url[1]; - $enlace = "http://".$_SERVER['SERVER_NAME']."/".$aplicacion."/index.php?elementos&opc=editar&id="; + $protocolo = !empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] !== 'off' || $_SERVER['SERVER_PORT'] == 443 ? "https://" : "http://"; + $enlace = $protocolo . $_SERVER['SERVER_NAME'] . "/" . $aplicacion . "/index.php?elementos&opc=editar&id="; while($tupla = $this->bdd->procesaResultado()) { if ($i % 2) { //Columna 2