phpBB

Code Changes

File: includes/acp/acp_board.php

  Unmodified   Added   Modified   Removed
Line 193Line 193
						'allow_post_flash'		=> array('lang' => 'ALLOW_POST_FLASH',		'validate' => 'bool',	'type' => 'radio:yes_no', 'explain' => true),
'allow_smilies' => array('lang' => 'ALLOW_SMILIES', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => false),
'allow_post_links' => array('lang' => 'ALLOW_POST_LINKS', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true),

						'allow_post_flash'		=> array('lang' => 'ALLOW_POST_FLASH',		'validate' => 'bool',	'type' => 'radio:yes_no', 'explain' => true),
'allow_smilies' => array('lang' => 'ALLOW_SMILIES', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => false),
'allow_post_links' => array('lang' => 'ALLOW_POST_LINKS', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true),

						'allowed_schemes_links'	=> array('lang' => 'ALLOWED_SCHEMES_LINKS',	'validate' => 'string',	'type' => 'text:0:255', 'explain' => true),

						'allowed_schemes_links'	=> array('lang' => 'ALLOWED_SCHEMES_LINKS',	'validate' => 'csv',	'type' => 'text:0:255', 'explain' => true),

						'allow_nocensors'		=> array('lang' => 'ALLOW_NO_CENSORS',		'validate' => 'bool',	'type' => 'radio:yes_no', 'explain' => true),
'allow_bookmarks' => array('lang' => 'ALLOW_BOOKMARKS', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true),
'enable_post_confirm' => array('lang' => 'VISUAL_CONFIRM_POST', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true),

						'allow_nocensors'		=> array('lang' => 'ALLOW_NO_CENSORS',		'validate' => 'bool',	'type' => 'radio:yes_no', 'explain' => true),
'allow_bookmarks' => array('lang' => 'ALLOW_BOOKMARKS', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true),
'enable_post_confirm' => array('lang' => 'VISUAL_CONFIRM_POST', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true),

Line 496Line 496
		$this->new_config = clone $config;
$cfg_array = (isset($_REQUEST['config'])) ? $request->variable('config', array('' => ''), true) : $this->new_config;
$error = array();

		$this->new_config = clone $config;
$cfg_array = (isset($_REQUEST['config'])) ? $request->variable('config', array('' => ''), true) : $this->new_config;
$error = array();

 

// Prevalidate allowed URL schemes
if ($mode == 'post')
{
$schemes = array_filter(explode(',', $cfg_array['allowed_schemes_links']));
foreach ($schemes as $scheme)
{
if (!preg_match('#^[a-z][a-z0-9+\\-.]*$#Di', $scheme))
{
$error[] = $language->lang('URL_SCHEME_INVALID', $language->lang('ALLOWED_SCHEMES_LINKS'), $scheme);
}
}
}

if ($mode == 'avatar' && $cfg_array['allow_avatar_upload'])
{
// If avatar uploading is enabled but the path setting is empty,
// config variable validation is bypassed. Catch the case here
if (!$cfg_array['avatar_path'])
{
$error[] = $language->lang('AVATAR_NO_UPLOAD_PATH');
}
else if (!$submit)
{
$filesystem = $phpbb_container->get('filesystem');
$avatar_path_exists = $filesystem->exists($phpbb_root_path . $cfg_array['avatar_path']);
$avatar_path_writable = $filesystem->is_writable($phpbb_root_path . $cfg_array['avatar_path']);

// Not existing or writable path will be caught on submit by validate_config_vars().
// Display the warning if the directory was changed on the server afterwards
if (!$avatar_path_exists || !$avatar_path_writable)
{
$error[] = $language->lang('AVATAR_NO_UPLOAD_DIR');
}
}
}


// We validate the complete config if wished
validate_config_vars($display_vars['vars'], $cfg_array, $error);


// We validate the complete config if wished
validate_config_vars($display_vars['vars'], $cfg_array, $error);