1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-07-30 21:40:43 +02:00

Merge branch '3.2.x' into 3.3.x

This commit is contained in:
Marc Alexander
2020-08-06 17:21:58 +02:00
21 changed files with 350 additions and 116 deletions

View File

@@ -0,0 +1,36 @@
<?php
/**
*
* This file is part of the phpBB Forum Software package.
*
* @copyright (c) phpBB Limited <https://www.phpbb.com>
* @license GNU General Public License, version 2 (GPL-2.0)
*
* For full copyright and license information, please see
* the docs/CREDITS.txt file.
*
*/
namespace phpbb\db\migration\data\v32x;
class v3210 extends \phpbb\db\migration\migration
{
public function effectively_installed()
{
return phpbb_version_compare($this->config['version'], '3.2.10', '>=');
}
static public function depends_on()
{
return array(
'\phpbb\db\migration\data\v32x\v3210rc2',
);
}
public function update_data()
{
return array(
array('config.update', array('version', '3.2.10')),
);
}
}

View File

@@ -254,6 +254,13 @@ class manager
/** @var \phpbb\profilefields\type\type_interface $profile_field */
$profile_field = $this->type_collection[$row['field_type']];
$cp_data['pf_' . $row['field_ident']] = $profile_field->get_profile_field($row);
/**
* Replace Emoji and other 4bit UTF-8 chars not allowed by MySQL
* with their Numeric Character Reference's Hexadecimal notation.
*/
$cp_data['pf_' . $row['field_ident']] = utf8_encode_ucr($cp_data['pf_' . $row['field_ident']]);
$check_value = $cp_data['pf_' . $row['field_ident']];
if (($cp_result = $profile_field->validate_profile_field($check_value, $row)) !== false)

View File

@@ -273,8 +273,6 @@ class factory implements \phpbb\textformatter\cache_interface
->add('#imageurl', __NAMESPACE__ . '\\parser::filter_img_url')
->addParameterByName('urlConfig')
->addParameterByName('logger')
->addParameterByName('max_img_height')
->addParameterByName('max_img_width')
->markAsSafeAsURL()
->setJS('UrlFilter.filter');

View File

@@ -380,11 +380,10 @@ class parser implements \phpbb\textformatter\parser_interface
* @param string $url Original URL
* @param array $url_config Config used by the URL filter
* @param Logger $logger
* @param integer $max_height Maximum height allowed
* @param integer $max_width Maximum width allowed
*
* @return string|bool Original value if valid, FALSE otherwise
*/
static public function filter_img_url($url, array $url_config, Logger $logger, $max_height, $max_width)
static public function filter_img_url($url, array $url_config, Logger $logger)
{
// Validate the URL
$url = UrlFilter::filter($url, $url_config, $logger);
@@ -393,29 +392,6 @@ class parser implements \phpbb\textformatter\parser_interface
return false;
}
if ($max_height || $max_width)
{
$imagesize = new \FastImageSize\FastImageSize();
$size_info = $imagesize->getImageSize($url);
if ($size_info === false)
{
$logger->err('UNABLE_GET_IMAGE_SIZE');
return false;
}
if ($max_height && $max_height < $size_info['height'])
{
$logger->err('MAX_IMG_HEIGHT_EXCEEDED', array('max_height' => $max_height));
return false;
}
if ($max_width && $max_width < $size_info['width'])
{
$logger->err('MAX_IMG_WIDTH_EXCEEDED', array('max_width' => $max_width));
return false;
}
}
return $url;
}