1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-02-24 12:03:21 +01:00

Merge branch 'develop-ascraeus' into develop

* develop-ascraeus:
  [ticket/13227] Properly handle curlwrapper headers in remote avatars
  [ticket/13231] Update the dependencies of the migration contact_admin_form
This commit is contained in:
Nils Adermann 2014-10-27 19:04:13 -07:00
commit 2438bfbfc6
2 changed files with 22 additions and 1 deletions

View File

@ -130,8 +130,24 @@ class remote extends \phpbb\avatar\driver\driver
{
// Timeout after 1 second
stream_set_timeout($file_stream, 1);
// read some data to ensure headers are present
fread($file_stream, 1024);
$meta = stream_get_meta_data($file_stream);
foreach ($meta['wrapper_data'] as $header)
if (isset($meta['wrapper_data']['headers']) && is_array($meta['wrapper_data']['headers']))
{
$headers = $meta['wrapper_data']['headers'];
}
else if (isset($meta['wrapper_data']) && is_array($meta['wrapper_data']))
{
$headers = $meta['wrapper_data'];
}
else
{
$headers = array();
}
foreach ($headers as $header)
{
$header = preg_split('/ /', $header, 2);
if (strtr(strtolower(trim($header[0], ':')), '_', '-') === 'content-type')

View File

@ -20,6 +20,11 @@ class contact_admin_form extends \phpbb\db\migration\migration
return isset($this->config['contact_admin_form_enable']);
}
static public function depends_on()
{
return array('\phpbb\db\migration\data\v310\config_db_text');
}
public function update_data()
{
return array(