Fix phpcs

This commit is contained in:
Laurent Destailleur 2020-10-28 17:06:30 +01:00
parent ef59b71cdf
commit 9a85441c61
3 changed files with 5 additions and 6 deletions

View File

@ -29,7 +29,7 @@
* \brief List of bank transactions * \brief List of bank transactions
*/ */
if (!defined('NOREQUIREMENU')) define('NOREQUIREMENU','1'); // If there is no need to load and show top and left menu if (!defined('NOREQUIREMENU')) define('NOREQUIREMENU', '1'); // If there is no need to load and show top and left menu
if (!defined('NOBROWSERNOTIF')) define('NOBROWSERNOTIF', '1'); // Disable browser notification if (!defined('NOBROWSERNOTIF')) define('NOBROWSERNOTIF', '1'); // Disable browser notification
require '../../main.inc.php'; require '../../main.inc.php';

View File

@ -76,7 +76,7 @@ function getURLContent($url, $postorget = 'GET', $param = '', $followlocation =
// Restrict use to some protocols only // Restrict use to some protocols only
$protocols = 0; $protocols = 0;
if (is_array($allowedschemes)) { if (is_array($allowedschemes)) {
foreach($allowedschemes as $allowedscheme) { foreach ($allowedschemes as $allowedscheme) {
if ($allowedscheme == 'http') $protocols |= CURLPROTO_HTTP; if ($allowedscheme == 'http') $protocols |= CURLPROTO_HTTP;
if ($allowedscheme == 'https') $protocols |= CURLPROTO_HTTPS; if ($allowedscheme == 'https') $protocols |= CURLPROTO_HTTPS;
} }
@ -129,8 +129,7 @@ function getURLContent($url, $postorget = 'GET', $param = '', $followlocation =
$info = array(); $info = array();
$response = ''; $response = '';
do do {
{
if ($maxRedirection < 1) break; if ($maxRedirection < 1) break;
curl_setopt($ch, CURLOPT_URL, $newUrl); curl_setopt($ch, CURLOPT_URL, $newUrl);
@ -187,7 +186,7 @@ function getURLContent($url, $postorget = 'GET', $param = '', $followlocation =
$http_code = 0; $http_code = 0;
} }
} }
while($http_code); while ($http_code);
$request = curl_getinfo($ch, CURLINFO_HEADER_OUT); // Reading of request must be done after sending request $request = curl_getinfo($ch, CURLINFO_HEADER_OUT); // Reading of request must be done after sending request

View File

@ -171,7 +171,7 @@ class RestAPIDocumentTest extends PHPUnit\Framework\TestCase
'fileencoding'=>"" 'fileencoding'=>""
); );
$result = getURLContent($url, 'POST', $data, 1,array(), array('http', 'https'), 2); $result = getURLContent($url, 'POST', $data, 1, array(), array('http', 'https'), 2);
echo __METHOD__.' Result for sending document: '.var_export($result, true)."\n"; echo __METHOD__.' Result for sending document: '.var_export($result, true)."\n";
echo __METHOD__.' curl_error_no: '.$result['curl_error_no']."\n"; echo __METHOD__.' curl_error_no: '.$result['curl_error_no']."\n";
$object = json_decode($result['content'], true); $object = json_decode($result['content'], true);