Explorar o código

Fix replace file_get_contents with getURLContent

Laurent Destailleur %!s(int64=3) %!d(string=hai) anos
pai
achega
13e64d2f79

+ 12 - 7
htdocs/blockedlog/ajax/check_signature.php

@@ -17,9 +17,9 @@
  */
 
 /**
- *      \file       htdocs/blockedlog/ajax/block-info.php
+ *      \file       htdocs/blockedlog/ajax/check_signature.php
  *      \ingroup    blockedlog
- *      \brief      block-info
+ *      \brief      This page is not used yet.
  */
 
 
@@ -38,13 +38,15 @@ if (!defined('NOREQUIREHTML')) {
 
 
 require '../../main.inc.php';
+require_once DOL_DOCUMENT_ROOT.'/core/lib/geturl.lib.php';
+require_once DOL_DOCUMENT_ROOT.'/blockedlog/class/blockedlog.class.php';
+require_once DOL_DOCUMENT_ROOT.'/blockedlog/class/authority.class.php';
+
 
 if (empty($conf->global->BLOCKEDLOG_AUTHORITY_URL)) {
 	exit('BLOCKEDLOG_AUTHORITY_URL not set');
 }
 
-require_once DOL_DOCUMENT_ROOT.'/blockedlog/class/blockedlog.class.php';
-require_once DOL_DOCUMENT_ROOT.'/blockedlog/class/authority.class.php';
 
 $auth = new BlockedLogAuthority($db);
 $auth->syncSignatureWithAuthority();
@@ -63,8 +65,11 @@ if (is_array($bocks)) {
 
 $hash = $auth->getBlockchainHash();
 
-$url = $conf->global->BLOCKEDLOG_AUTHORITY_URL.'/blockedlog/ajax/authority.php?s='.$auth->signature.'&h='.$hash;
+// Call external authority
+$url = $conf->global->BLOCKEDLOG_AUTHORITY_URL.'/blockedlog/ajax/authority.php?s='.urlencode($auth->signature).'&h='.urlencode($hash);
+
+$resarray = getURLContent($url, 'GET', '', 1, array(), array(), 2);
+$res = $resarray['content'];
 
-$res = file_get_contents($url);
 //echo $url;
-echo $res;
+echo dol_escape_htmltag($res);

+ 4 - 2
htdocs/core/class/google.class.php

@@ -66,10 +66,12 @@ class GoogleAPI
 		$i = 0;
 
 		// Desired address
-		$urladdress = "https://maps.google.com/maps/geo?q=".urlencode($address)."&output=xml&key=".$this->key;
+		$urladdress = "https://maps.google.com/maps/geo?q=".urlencode($address)."&output=xml&key=".urlencode($this->key);
 
 		// Retrieve the URL contents
-		$page = file_get_contents($urladdress);
+		require_once DOL_DOCUMENT_ROOT.'/core/lib/geturl.lib.php';
+		$pagearray = getURLContent($urladdress, 'GET');
+		$page = $pagearray['content'];
 
 		$code = strstr($page, '<coordinates>');
 		$code = strstr($code, '>');

+ 2 - 1
htdocs/printing/index.php

@@ -58,7 +58,8 @@ foreach ($result as $driver) {
 	$classname = 'printing_'.$driver;
 	$langs->load($driver);
 	$printer = new $classname($db);
-	if ($conf->global->{$printer->active}) {
+	$keyforprinteractive = $printer->active;
+	if ($keyforprinteractive && $conf->global->$keyforprinteractive) {
 		//$printer->listJobs('commande');
 		$result = $printer->listJobs();
 		print $printer->resprint;