Ajout d'une étape de linting dans DroneCi (#3)

Corrige un doublons laissé par le rebase semi-manuel

Ajout d'une étape de linting dans DroneCi

Fix linting

Co-authored-by: Nigel Sheldon <nigelsheldon@live.fr>
Reviewed-on: https://gitea.nemunai.re/halo-battle/game/pulls/3
This commit is contained in:
Nigel 2020-11-21 18:54:32 +00:00
commit dd61d3b66b
263 changed files with 45327 additions and 42695 deletions

View file

@ -36,7 +36,7 @@
*/
function smarty_function_html_image($params, &$smarty)
{
require_once $smarty->_get_plugin_filepath('shared','escape_special_chars');
require_once $smarty->_get_plugin_filepath('shared', 'escape_special_chars');
$alt = '';
$file = '';
@ -48,8 +48,8 @@ function smarty_function_html_image($params, &$smarty)
$path_prefix = '';
$server_vars = ($smarty->request_use_auto_globals) ? $_SERVER : $GLOBALS['HTTP_SERVER_VARS'];
$basedir = isset($server_vars['DOCUMENT_ROOT']) ? $server_vars['DOCUMENT_ROOT'] : '';
foreach($params as $_key => $_val) {
switch($_key) {
foreach ($params as $_key => $_val) {
switch ($_key) {
case 'file':
case 'height':
case 'width':
@ -60,7 +60,7 @@ function smarty_function_html_image($params, &$smarty)
break;
case 'alt':
if(!is_array($_val)) {
if (!is_array($_val)) {
$$_key = smarty_function_escape_special_chars($_val);
} else {
$smarty->trigger_error("html_image: extra attribute '$_key' cannot be an array", E_USER_NOTICE);
@ -74,7 +74,7 @@ function smarty_function_html_image($params, &$smarty)
break;
default:
if(!is_array($_val)) {
if (!is_array($_val)) {
$extra .= ' '.$_key.'="'.smarty_function_escape_special_chars($_val).'"';
} else {
$smarty->trigger_error("html_image: extra attribute '$_key' cannot be an array", E_USER_NOTICE);
@ -88,18 +88,18 @@ function smarty_function_html_image($params, &$smarty)
return;
}
if (substr($file,0,1) == '/') {
if (substr($file, 0, 1) == '/') {
$_image_path = $basedir . $file;
} else {
$_image_path = $file;
}
if(!isset($params['width']) || !isset($params['height'])) {
if(!$_image_data = @getimagesize($_image_path)) {
if(!file_exists($_image_path)) {
if (!isset($params['width']) || !isset($params['height'])) {
if (!$_image_data = @getimagesize($_image_path)) {
if (!file_exists($_image_path)) {
$smarty->trigger_error("html_image: unable to find '$_image_path'", E_USER_NOTICE);
return;
} else if(!is_readable($_image_path)) {
} elseif (!is_readable($_image_path)) {
$smarty->trigger_error("html_image: unable to read '$_image_path'", E_USER_NOTICE);
return;
} else {
@ -110,21 +110,20 @@ function smarty_function_html_image($params, &$smarty)
if ($smarty->security &&
($_params = array('resource_type' => 'file', 'resource_name' => $_image_path)) &&
(require_once(SMARTY_CORE_DIR . 'core.is_secure.php')) &&
(!smarty_core_is_secure($_params, $smarty)) ) {
(!smarty_core_is_secure($_params, $smarty))) {
$smarty->trigger_error("html_image: (secure) '$_image_path' not in secure directory", E_USER_NOTICE);
}
}
if(!isset($params['width'])) {
if (!isset($params['width'])) {
$width = $_image_data[0];
}
if(!isset($params['height'])) {
if (!isset($params['height'])) {
$height = $_image_data[1];
}
}
if(isset($params['dpi'])) {
if(strstr($server_vars['HTTP_USER_AGENT'], 'Mac')) {
if (isset($params['dpi'])) {
if (strstr($server_vars['HTTP_USER_AGENT'], 'Mac')) {
$dpi_default = 72;
} else {
$dpi_default = 96;
@ -138,5 +137,3 @@ function smarty_function_html_image($params, &$smarty)
}
/* vim: set expandtab: */
?>