From 4bdef6fd21a5dcab455b0cd1ee2652de606929c3 Mon Sep 17 00:00:00 2001 From: MateBartus Date: Thu, 12 Mar 2015 00:25:00 +0100 Subject: [ticket/13697] Moving filesystem related functions to filesystem service * Moving filesystem service to \phpbb\filesystem namespace * Wraping Symfony's Filesystem component * Moving filesystem related functions from includes/functions.php into \phpbb\filesystem\filesystem Functions moved (and deprecated): - phpbb_chmod - phpbb_is_writable - phpbb_is_absolute - phpbb_own_realpath - phpbb_realpath * Adding interface for filesystem service PHPBB3-13697 --- phpBB/includes/functions_acp.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'phpBB/includes/functions_acp.php') diff --git a/phpBB/includes/functions_acp.php b/phpBB/includes/functions_acp.php index a53a54368e..6d59b513af 100644 --- a/phpBB/includes/functions_acp.php +++ b/phpBB/includes/functions_acp.php @@ -405,7 +405,7 @@ function build_cfg_template($tpl_type, $key, &$new, $config_key, $vars) */ function validate_config_vars($config_vars, &$cfg_array, &$error) { - global $phpbb_root_path, $user, $phpbb_dispatcher; + global $phpbb_root_path, $user, $phpbb_dispatcher, $phpbb_filesystem; $type = 0; $min = 1; @@ -586,7 +586,7 @@ function validate_config_vars($config_vars, &$cfg_array, &$error) // Check if the path is writable if ($config_definition['validate'] == 'wpath' || $config_definition['validate'] == 'rwpath' || $config_definition['validate'] === 'absolute_path_writable') { - if (file_exists($path) && !phpbb_is_writable($path)) + if (file_exists($path) && !$phpbb_filesystem->is_writable($path)) { $error[] = sprintf($user->lang['DIRECTORY_NOT_WRITABLE'], $cfg_array[$config_name]); } -- cgit v1.2.1 From f90b16df0d1c4a17c1874b1416f8c21495d7b4f7 Mon Sep 17 00:00:00 2001 From: Marc Alexander Date: Mon, 12 Oct 2015 18:39:29 +0200 Subject: [ticket/14234] Use replacement variables instead of references in events PHPBB3-14234 --- phpBB/includes/functions_acp.php | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'phpBB/includes/functions_acp.php') diff --git a/phpBB/includes/functions_acp.php b/phpBB/includes/functions_acp.php index eea18a0c47..b6f9de98f3 100644 --- a/phpBB/includes/functions_acp.php +++ b/phpBB/includes/functions_acp.php @@ -383,6 +383,7 @@ function build_cfg_template($tpl_type, $key, &$new, $config_key, $vars) $tpl .= $vars['append']; } + $new_ary = $new; /** * Overwrite the html code we display for the config value * @@ -392,14 +393,17 @@ function build_cfg_template($tpl_type, $key, &$new, $config_key, $vars) * 1 [optional] => string: size, int: minimum * 2 [optional] => string: max. length, int: maximum * @var string key Should be used for the id attribute in html - * @var array new Array with the config values we display + * @var array new_var Array with the config values we display * @var string name Should be used for the name attribute * @var array vars Array with the options for the config * @var string tpl The resulting html code we display * @since 3.1.0-a1 + * @change 3.1.7-RC1 Replaced new with new_ary */ - $vars = array('tpl_type', 'key', 'new', 'name', 'vars', 'tpl'); + $vars = array('tpl_type', 'key', 'new_ary', 'name', 'vars', 'tpl'); extract($phpbb_dispatcher->trigger_event('core.build_config_template', compact($vars))); + $new = $new_ary; + unset($new); return $tpl; } -- cgit v1.2.1 From 578ee077c114f63a6de0c277669ba91bd9f1219f Mon Sep 17 00:00:00 2001 From: Marc Alexander Date: Mon, 12 Oct 2015 19:26:59 +0200 Subject: [ticket/14234] Fix change version and remove more references PHPBB3-14234 --- phpBB/includes/functions_acp.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'phpBB/includes/functions_acp.php') diff --git a/phpBB/includes/functions_acp.php b/phpBB/includes/functions_acp.php index b6f9de98f3..9ed20cd450 100644 --- a/phpBB/includes/functions_acp.php +++ b/phpBB/includes/functions_acp.php @@ -398,12 +398,12 @@ function build_cfg_template($tpl_type, $key, &$new, $config_key, $vars) * @var array vars Array with the options for the config * @var string tpl The resulting html code we display * @since 3.1.0-a1 - * @change 3.1.7-RC1 Replaced new with new_ary + * @change 3.2.0-a1 Replaced new with new_ary */ $vars = array('tpl_type', 'key', 'new_ary', 'name', 'vars', 'tpl'); extract($phpbb_dispatcher->trigger_event('core.build_config_template', compact($vars))); $new = $new_ary; - unset($new); + unset($new_ary); return $tpl; } -- cgit v1.2.1 From 102d737d811739aa6ff9687e1585c2012b394d02 Mon Sep 17 00:00:00 2001 From: Marc Alexander Date: Mon, 12 Oct 2015 22:20:52 +0200 Subject: [ticket/14234] Fix event doc blocks PHPBB3-14234 --- phpBB/includes/functions_acp.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'phpBB/includes/functions_acp.php') diff --git a/phpBB/includes/functions_acp.php b/phpBB/includes/functions_acp.php index 9ed20cd450..390b59b9e9 100644 --- a/phpBB/includes/functions_acp.php +++ b/phpBB/includes/functions_acp.php @@ -393,7 +393,7 @@ function build_cfg_template($tpl_type, $key, &$new, $config_key, $vars) * 1 [optional] => string: size, int: minimum * 2 [optional] => string: max. length, int: maximum * @var string key Should be used for the id attribute in html - * @var array new_var Array with the config values we display + * @var array new_ary Array with the config values we display * @var string name Should be used for the name attribute * @var array vars Array with the options for the config * @var string tpl The resulting html code we display -- cgit v1.2.1 From 065b0a632f308366c7383a322c620b7f2db7b97d Mon Sep 17 00:00:00 2001 From: Mate Bartus Date: Mon, 30 Nov 2015 18:05:46 +0100 Subject: [ticket/14325] Preserve event variable BC PHPBB3-14325 --- phpBB/includes/functions_acp.php | 37 ++++++++++++++++++------------------- 1 file changed, 18 insertions(+), 19 deletions(-) (limited to 'phpBB/includes/functions_acp.php') diff --git a/phpBB/includes/functions_acp.php b/phpBB/includes/functions_acp.php index 390b59b9e9..f6c01c46ff 100644 --- a/phpBB/includes/functions_acp.php +++ b/phpBB/includes/functions_acp.php @@ -230,7 +230,7 @@ function h_radio($name, $input_ary, $input_default = false, $id = false, $key = /** * Build configuration template for acp configuration pages */ -function build_cfg_template($tpl_type, $key, &$new, $config_key, $vars) +function build_cfg_template($tpl_type, $key, &$new_ary, $config_key, $vars) { global $user, $module, $phpbb_dispatcher; @@ -238,18 +238,18 @@ function build_cfg_template($tpl_type, $key, &$new, $config_key, $vars) $name = 'config[' . $config_key . ']'; // Make sure there is no notice printed out for non-existent config options (we simply set them) - if (!isset($new[$config_key])) + if (!isset($new_ary[$config_key])) { - $new[$config_key] = ''; + $new_ary[$config_key] = ''; } switch ($tpl_type[0]) { case 'password': - if ($new[$config_key] !== '') + if ($new_ary[$config_key] !== '') { // replace passwords with asterixes - $new[$config_key] = '********'; + $new_ary[$config_key] = '********'; } case 'text': case 'url': @@ -267,7 +267,7 @@ function build_cfg_template($tpl_type, $key, &$new, $config_key, $vars) $size = (int) $tpl_type[1]; $maxlength = (int) $tpl_type[2]; - $tpl = ''; + $tpl = ''; break; case 'number': @@ -279,7 +279,7 @@ function build_cfg_template($tpl_type, $key, &$new, $config_key, $vars) $maxlength = strlen( (string) $max ); } - $tpl = ''; + $tpl = ''; break; case 'dimension': @@ -293,19 +293,19 @@ function build_cfg_template($tpl_type, $key, &$new, $config_key, $vars) $size = $maxlength = strlen( (string) $max ); } - $tpl = ' x '; + $tpl = ' x '; break; case 'textarea': $rows = (int) $tpl_type[1]; $cols = (int) $tpl_type[2]; - $tpl = ''; + $tpl = ''; break; case 'radio': - $key_yes = ($new[$config_key]) ? ' checked="checked"' : ''; - $key_no = (!$new[$config_key]) ? ' checked="checked"' : ''; + $key_yes = ($new_ary[$config_key]) ? ' checked="checked"' : ''; + $key_no = (!$new_ary[$config_key]) ? ' checked="checked"' : ''; $tpl_type_cond = explode('_', $tpl_type[1]); $type_no = ($tpl_type_cond[0] == 'disabled' || $tpl_type_cond[0] == 'enabled') ? false : true; @@ -342,7 +342,7 @@ function build_cfg_template($tpl_type, $key, &$new, $config_key, $vars) switch ($value) { case '{CONFIG_VALUE}': - $value = $new[$config_key]; + $value = $new_ary[$config_key]; break; case '{KEY}': @@ -355,7 +355,7 @@ function build_cfg_template($tpl_type, $key, &$new, $config_key, $vars) } else { - $args = array($new[$config_key], $key); + $args = array($new_ary[$config_key], $key); } $return = call_user_func_array($call, $args); @@ -383,7 +383,7 @@ function build_cfg_template($tpl_type, $key, &$new, $config_key, $vars) $tpl .= $vars['append']; } - $new_ary = $new; + $new = $new_ary; /** * Overwrite the html code we display for the config value * @@ -393,17 +393,16 @@ function build_cfg_template($tpl_type, $key, &$new, $config_key, $vars) * 1 [optional] => string: size, int: minimum * 2 [optional] => string: max. length, int: maximum * @var string key Should be used for the id attribute in html - * @var array new_ary Array with the config values we display + * @var array new Array with the config values we display * @var string name Should be used for the name attribute * @var array vars Array with the options for the config * @var string tpl The resulting html code we display * @since 3.1.0-a1 - * @change 3.2.0-a1 Replaced new with new_ary */ - $vars = array('tpl_type', 'key', 'new_ary', 'name', 'vars', 'tpl'); + $vars = array('tpl_type', 'key', 'new', 'name', 'vars', 'tpl'); extract($phpbb_dispatcher->trigger_event('core.build_config_template', compact($vars))); - $new = $new_ary; - unset($new_ary); + $new_ary = $new; + unset($new); return $tpl; } -- cgit v1.2.1 From 73e6e5b77faadbb7676961bf38122d669de111db Mon Sep 17 00:00:00 2001 From: Marc Alexander Date: Thu, 3 Dec 2015 17:50:29 +0100 Subject: [ticket/13454] Remove unused variables This is the first part of the changes. More to come. PHPBB3-13454 --- phpBB/includes/functions_acp.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'phpBB/includes/functions_acp.php') diff --git a/phpBB/includes/functions_acp.php b/phpBB/includes/functions_acp.php index 4a52657023..b0b5074480 100644 --- a/phpBB/includes/functions_acp.php +++ b/phpBB/includes/functions_acp.php @@ -24,7 +24,7 @@ if (!defined('IN_PHPBB')) */ function adm_page_header($page_title) { - global $config, $db, $user, $template; + global $config, $user, $template; global $phpbb_root_path, $phpbb_admin_path, $phpEx, $SID, $_SID; global $phpbb_dispatcher; @@ -140,8 +140,8 @@ function adm_page_header($page_title) */ function adm_page_footer($copyright_html = true) { - global $db, $config, $template, $user, $auth, $cache; - global $starttime, $phpbb_root_path, $phpbb_admin_path, $phpEx; + global $db, $config, $template, $user, $auth; + global $phpbb_root_path; global $request, $phpbb_dispatcher; // A listener can set this variable to `true` when it overrides this function -- cgit v1.2.1 From f50ba9ab4f6e74e4d472c9e2012dfdd29720dfe9 Mon Sep 17 00:00:00 2001 From: Marc Alexander Date: Thu, 3 Dec 2015 18:19:02 +0100 Subject: [ticket/13454] Remove unused variables This is part 2 of the pr. PHPBB3-13454 --- phpBB/includes/functions_acp.php | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'phpBB/includes/functions_acp.php') diff --git a/phpBB/includes/functions_acp.php b/phpBB/includes/functions_acp.php index b0b5074480..19548f59d2 100644 --- a/phpBB/includes/functions_acp.php +++ b/phpBB/includes/functions_acp.php @@ -273,7 +273,7 @@ function build_cfg_template($tpl_type, $key, &$new_ary, $config_key, $vars) break; case 'number': - $min = $max = $maxlength = ''; + $max = $maxlength = ''; $min = ( isset($tpl_type[1]) ) ? (int) $tpl_type[1] : false; if ( isset($tpl_type[2]) ) { @@ -285,7 +285,7 @@ function build_cfg_template($tpl_type, $key, &$new_ary, $config_key, $vars) break; case 'dimension': - $min = $max = $maxlength = $size = ''; + $max = $maxlength = $size = ''; $min = (int) $tpl_type[1]; @@ -321,8 +321,6 @@ function build_cfg_template($tpl_type, $key, &$new_ary, $config_key, $vars) case 'select': case 'custom': - $return = ''; - if (isset($vars['method'])) { $call = array($module->module, $vars['method']); -- cgit v1.2.1 From 266576c6a4224f4b803040c678020e825a1510b5 Mon Sep 17 00:00:00 2001 From: Marc Alexander Date: Fri, 4 Dec 2015 11:50:39 +0100 Subject: [ticket/13454] Remove unused variables Part 4 PHPBB3-13454 --- phpBB/includes/functions_acp.php | 2 -- 1 file changed, 2 deletions(-) (limited to 'phpBB/includes/functions_acp.php') diff --git a/phpBB/includes/functions_acp.php b/phpBB/includes/functions_acp.php index 19548f59d2..3f64bc19f9 100644 --- a/phpBB/includes/functions_acp.php +++ b/phpBB/includes/functions_acp.php @@ -650,8 +650,6 @@ function validate_range($value_ary, &$error) foreach ($value_ary as $value) { $column = explode(':', $value['column_type']); - $max = $min = 0; - $type = 0; if (!isset($column_types[$column[0]])) { continue; -- cgit v1.2.1 From 78349ed80f24cb61ad05f997e97d805cc5b0409f Mon Sep 17 00:00:00 2001 From: Tristan Darricau Date: Fri, 11 Dec 2015 21:31:27 +0100 Subject: [ticket/14306] Automatically enable a safe mode when container building fails PHPBB3-14306 --- phpBB/includes/functions_acp.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'phpBB/includes/functions_acp.php') diff --git a/phpBB/includes/functions_acp.php b/phpBB/includes/functions_acp.php index 4a52657023..803e4f5e54 100644 --- a/phpBB/includes/functions_acp.php +++ b/phpBB/includes/functions_acp.php @@ -26,7 +26,7 @@ function adm_page_header($page_title) { global $config, $db, $user, $template; global $phpbb_root_path, $phpbb_admin_path, $phpEx, $SID, $_SID; - global $phpbb_dispatcher; + global $phpbb_dispatcher, $phpbb_container; if (defined('HEADER_INC')) { @@ -105,6 +105,8 @@ function adm_page_header($page_title) 'S_CONTENT_ENCODING' => 'UTF-8', 'S_CONTENT_FLOW_BEGIN' => ($user->lang['DIRECTION'] == 'ltr') ? 'left' : 'right', 'S_CONTENT_FLOW_END' => ($user->lang['DIRECTION'] == 'ltr') ? 'right' : 'left', + + 'CONTAINER_EXCEPTION' => $phpbb_container->hasParameter('container_exception') ? $phpbb_container->getParameter('container_exception') : false, )); // An array of http headers that phpbb will set. The following event may override these. -- cgit v1.2.1 From c5e0635bc79197011744394a221b5ccdcf305fc6 Mon Sep 17 00:00:00 2001 From: Marc Alexander Date: Sat, 30 Jan 2016 12:21:30 +0100 Subject: [ticket/14492] Add basic layout for enabling viglink PHPBB3-14492 --- phpBB/includes/functions_acp.php | 1 + 1 file changed, 1 insertion(+) (limited to 'phpBB/includes/functions_acp.php') diff --git a/phpBB/includes/functions_acp.php b/phpBB/includes/functions_acp.php index 766669480d..8bf42aa36e 100644 --- a/phpBB/includes/functions_acp.php +++ b/phpBB/includes/functions_acp.php @@ -88,6 +88,7 @@ function adm_page_header($page_title) 'T_ICONS_PATH' => "{$phpbb_root_path}{$config['icons_path']}/", 'T_RANKS_PATH' => "{$phpbb_root_path}{$config['ranks_path']}/", 'T_UPLOAD_PATH' => "{$phpbb_root_path}{$config['upload_path']}/", + 'T_FONT_AWESOME_LINK' => !empty($config['allow_cdn']) && !empty($config['load_font_awesome_url']) ? $config['load_font_awesome_url'] : "{$phpbb_root_path}assets/css/font-awesome.min.css?assets_version=" . $config['assets_version'], 'T_ASSETS_VERSION' => $config['assets_version'], -- cgit v1.2.1