Version 4.3.6
This commit is contained in:
1 parent
fe1acf984a
commit
1a0c7fd3c2
609 files changed
+14707
-5726
No files matched your search
@@ -437,24 +437,38 @@ class _Upgrade
|
||||
/* Fix profile photo URL if appropriate - we'll address the rest of the file storage later but it would be better to avoid multiple loops on members */
|
||||
if( $row['pp_main_photo'] )
|
||||
{
|
||||
/* Remove double slashes from a previous bad configuration */
|
||||
if( preg_match( '/(?<!:)(\/{2,})/', $row['pp_main_photo'] ) )
|
||||
{
|
||||
$row['pp_main_photo'] = preg_replace( '/(?<!:)(\/{2,})/', '/', $row['pp_main_photo'] );
|
||||
}
|
||||
|
||||
$_test = parse_url( $row['pp_main_photo'] );
|
||||
$_local = parse_url( \IPS\Settings::i()->base_url );
|
||||
|
||||
if( isset( $_test['host'] ) AND $_test['host'] == $_local['host'] )
|
||||
{
|
||||
/* We just want dir/file.ext and not the full URL */
|
||||
$row['pp_main_photo'] = str_replace( rtrim( $settings['upload_url'], '/' ) . '/', '', $row['pp_main_photo'] );
|
||||
$row['pp_main_photo'] = str_replace( \IPS\Settings::i()->base_url, '', $row['pp_main_photo'] );
|
||||
}
|
||||
}
|
||||
|
||||
if( $row['pp_thumb_photo'] )
|
||||
{
|
||||
/* Remove double slashes from a previous bad configuration */
|
||||
if( preg_match( '/(?<!:)(\/{2,})/', $row['pp_thumb_photo'] ) )
|
||||
{
|
||||
$row['pp_thumb_photo'] = preg_replace( '/(?<!:)(\/{2,})/', '/', $row['pp_thumb_photo'] );
|
||||
}
|
||||
|
||||
$_test = parse_url( $row['pp_thumb_photo'] );
|
||||
$_local = parse_url( \IPS\Settings::i()->base_url );
|
||||
|
||||
if( isset( $_test['host'] ) AND $_test['host'] == $_local['host'] )
|
||||
{
|
||||
/* We just want dir/file.ext and not the full URL */
|
||||
$row['pp_thumb_photo'] = str_replace( rtrim( $settings['upload_url'], '/' ) . '/', '', $row['pp_thumb_photo'] );
|
||||
$row['pp_thumb_photo'] = str_replace( \IPS\Settings::i()->base_url, '', $row['pp_thumb_photo'] );
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user