Skip to content

Commit

Permalink
Fix replace file_get_contents with getURLContent
Browse files Browse the repository at this point in the history
  • Loading branch information
eldy committed Aug 18, 2021
1 parent ae3a0fc commit 13e64d2
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 10 deletions.
19 changes: 12 additions & 7 deletions htdocs/blockedlog/ajax/check_signature.php
Original file line number Diff line number Diff line change
Expand Up @@ -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.
*/


Expand All @@ -38,13 +38,15 @@


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();
Expand All @@ -63,8 +65,11 @@

$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);
6 changes: 4 additions & 2 deletions htdocs/core/class/google.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -66,10 +66,12 @@ public function getGeoCoordinatesOfAddress($address)
$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, '>');
Expand Down
3 changes: 2 additions & 1 deletion htdocs/printing/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,8 @@
$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;
Expand Down

0 comments on commit 13e64d2

Please sign in to comment.