phpBB

Code Changes

File: includes/functions_acp.php

  Unmodified   Added   Modified   Removed
Line 283Line 283
		case 'time':
case 'number':
case 'range':

		case 'time':
case 'number':
case 'range':

			$max = '';
$min = ( isset($tpl_type[1]) ) ? (int) $tpl_type[1] : false;
if ( isset($tpl_type[2]) )
{
$max = (int) $tpl_type[2];
}

			$min = isset($tpl_type[1]) ? (int) $tpl_type[1] : false;
$max = isset($tpl_type[2]) ? (int) $tpl_type[2] : false;









			$tpl = '<input id="' . $key . '" type="' . $tpl_type[0] . '"' . (( $min != '' ) ? ' min="' . $min . '"' : '') . (( $max != '' ) ? ' max="' . $max . '"' : '') . ' name="' . $name . '" value="' . $new_ary[$config_key] . '" />';

			$tpl = '<input id="' . $key . '" type="' . $tpl_type[0] . '"' . (( $min !== false ) ? ' min="' . $min . '"' : '') . (( $max !== false ) ? ' max="' . $max . '"' : '') . ' name="' . $name . '" value="' . $new_ary[$config_key] . '" />';

		break;

case 'dimension':

		break;

case 'dimension':

			$max = '';

$min = (int) $tpl_type[1];

if ( isset($tpl_type[2]) )
{
$max = (int) $tpl_type[2];
}

			$min = isset($tpl_type[1]) ? (int) $tpl_type[1] : false;
$max = isset($tpl_type[2]) ? (int) $tpl_type[2] : false;











			$tpl = '<input id="' . $key . '" type="number"' . (( $min !== '' ) ? ' min="' . $min . '"' : '') . (( $max != '' ) ? ' max="' . $max . '"' : '') . ' name="config[' . $config_key . '_width]" value="' . $new_ary[$config_key . '_width'] . '" /> x <input type="number"' . (( $min !== '' ) ? ' min="' . $min . '"' : '') . (( $max != '' ) ? ' max="' . $max . '"' : '') . ' name="config[' . $config_key . '_height]" value="' . $new_ary[$config_key . '_height'] . '" />';

			$tpl = '<input id="' . $key . '" type="number"' . (( $min !== false ) ? ' min="' . $min . '"' : '') . (( $max !== false ) ? ' max="' . $max . '"' : '') . ' name="config[' . $config_key . '_width]" value="' . $new_ary[$config_key . '_width'] . '" /> x <input type="number"' . (( $min !== '' ) ? ' min="' . $min . '"' : '') . (( $max != '' ) ? ' max="' . $max . '"' : '') . ' name="config[' . $config_key . '_height]" value="' . $new_ary[$config_key . '_height'] . '" />';

		break;

case 'textarea':

		break;

case 'textarea':

Line 445Line 435
		switch ($validator[$type])
{
case 'url':

		switch ($validator[$type])
{
case 'url':

 
			case 'csv':
if ($validator[$type] == 'url')
{

				$cfg_array[$config_name] = trim($cfg_array[$config_name]);

if (!empty($cfg_array[$config_name]) && !preg_match('#^' . get_preg_expression('url') . '$#iu', $cfg_array[$config_name]))
{
$error[] = $language->lang('URL_INVALID', $language->lang($config_definition['lang']));

				$cfg_array[$config_name] = trim($cfg_array[$config_name]);

if (!empty($cfg_array[$config_name]) && !preg_match('#^' . get_preg_expression('url') . '$#iu', $cfg_array[$config_name]))
{
$error[] = $language->lang('URL_INVALID', $language->lang($config_definition['lang']));

 
					}
}
else if ($validator[$type] == 'csv')
{
// Validate comma separated values
$unfiltered_array = explode(',', $cfg_array[$config_name]);
$filtered_array = array_filter($unfiltered_array);
if (!empty($filtered_array) && count($unfiltered_array) !== count($filtered_array))
{
$error[] = $language->lang('CSV_INVALID', $language->lang($config_definition['lang']));

				}


				}


 
				}

			// no break here

case 'string':

			// no break here

case 'string':