Version 4.5.0
This commit is contained in:
1 parent
1a0c7fd3c2
commit
f79dcf067a
3791 files changed
+248032
-76372
No files matched your search
@@ -11,7 +11,7 @@
|
||||
namespace IPS\core\setup\upg_40000;
|
||||
|
||||
/* To prevent PHP errors (extending class does not exist) revealing path */
|
||||
if ( !defined( '\IPS\SUITE_UNIQUE_KEY' ) )
|
||||
if ( !\defined( '\IPS\SUITE_UNIQUE_KEY' ) )
|
||||
{
|
||||
header( ( isset( $_SERVER['SERVER_PROTOCOL'] ) ? $_SERVER['SERVER_PROTOCOL'] : 'HTTP/1.0' ) . ' 403 Forbidden' );
|
||||
exit;
|
||||
@@ -110,7 +110,7 @@ class _Upgrade
|
||||
/* Add profile portal */
|
||||
foreach( $profileDefinition['columns'] as $key => $definition )
|
||||
{
|
||||
if ( ! in_array( $key, array( 'pp_member_id', 'pp_setting_moderate_comments', 'pp_setting_count_friends', 'pp_profile_update',
|
||||
if ( ! \in_array( $key, array( 'pp_member_id', 'pp_setting_moderate_comments', 'pp_setting_count_friends', 'pp_profile_update',
|
||||
'pp_setting_moderate_friends', 'avatar_location', 'avatar_size', 'avatar_type', 'pp_about_me', 'pp_rating_hits', 'pp_rating_value', 'pp_rating_real' ) ) )
|
||||
{
|
||||
$membersDefinition['columns'][ $key ] = ( isset( $schema['core_members']['columns'][ $key ] ) ) ? $schema['core_members']['columns'][ $key ] : $definition;
|
||||
@@ -204,7 +204,7 @@ class _Upgrade
|
||||
|
||||
/* Make sure we haven't changed the admin directory */
|
||||
$admindir = 'admin';
|
||||
if ( defined( '\IPS\CP_DIRECTORY' ) AND \IPS\CP_DIRECTORY !== $admindir )
|
||||
if ( \defined( '\IPS\CP_DIRECTORY' ) AND \IPS\CP_DIRECTORY !== $admindir )
|
||||
{
|
||||
$admindir = preg_quote( \IPS\CP_DIRECTORY );
|
||||
}
|
||||
@@ -237,7 +237,7 @@ class _Upgrade
|
||||
$_SESSION['upg_40000_member_id'] = isset( $_SESSION['upg_40000_member_id'] ) ? $_SESSION['upg_40000_member_id'] : 0;
|
||||
$select = \IPS\Db::i()->select( 'core_members.*, profile_portal.*', 'core_members', array( 'core_members.member_id>'. $_SESSION['upg_40000_member_id'] ), 'core_members.member_id', $perCycle )
|
||||
->join( 'profile_portal', 'profile_portal.pp_member_id=core_members.member_id' );
|
||||
if ( count( $select ) )
|
||||
if ( \count( $select ) )
|
||||
{
|
||||
$inserts = array();
|
||||
foreach ( $select as $row )
|
||||
@@ -287,7 +287,7 @@ class _Upgrade
|
||||
{
|
||||
$membersCache = unserialize( $row['members_cache'] );
|
||||
|
||||
if ( is_array( $membersCache ) and isset( $membersCache['notifications'] ) )
|
||||
if ( \is_array( $membersCache ) and isset( $membersCache['notifications'] ) )
|
||||
{
|
||||
if ( $membersCache['show_notification_popup'] )
|
||||
{
|
||||
@@ -317,7 +317,7 @@ class _Upgrade
|
||||
|
||||
foreach( $membersCache['notifications'] as $type => $selected )
|
||||
{
|
||||
if ( is_array( $selected ) )
|
||||
if ( \is_array( $selected ) )
|
||||
{
|
||||
switch( $type )
|
||||
{
|
||||
@@ -325,7 +325,7 @@ class _Upgrade
|
||||
case 'followed_topics':
|
||||
foreach( $selected as $item )
|
||||
{
|
||||
if( is_array( $item ) )
|
||||
if( \is_array( $item ) )
|
||||
{
|
||||
foreach( $item as $method )
|
||||
{
|
||||
@@ -340,7 +340,7 @@ class _Upgrade
|
||||
case 'warning':
|
||||
foreach( $selected as $item )
|
||||
{
|
||||
if( is_array( $item ) )
|
||||
if( \is_array( $item ) )
|
||||
{
|
||||
foreach( $item as $method )
|
||||
{
|
||||
@@ -353,7 +353,7 @@ class _Upgrade
|
||||
}
|
||||
}
|
||||
|
||||
if ( count( $notifications ) )
|
||||
if ( \count( $notifications ) )
|
||||
{
|
||||
foreach( $notifications as $type => $selected )
|
||||
{
|
||||
@@ -500,6 +500,19 @@ class _Upgrade
|
||||
{
|
||||
$row['members_bitoptions'] += 1073741824;
|
||||
$row['member_group_id'] = $memberGroup;
|
||||
|
||||
/* We need to make sure they have a validating table entry, otherwise they may not be able to access the community */
|
||||
if( !\in_array( $row['member_id'], $validatingMemberIds ) )
|
||||
{
|
||||
\IPS\Db::i()->insert( 'core_validating', array(
|
||||
'vid' => \IPS\Login::generateRandomString(),
|
||||
'member_id' => $row['member_id'],
|
||||
'entry_date' => time(),
|
||||
'email_chg' => TRUE,
|
||||
'ip_address' => \IPS\Request::i()->ipAddress(),
|
||||
'prev_email' => $row['email']
|
||||
) );
|
||||
}
|
||||
}
|
||||
else if( $row['member_group_id'] == $guestGroup )
|
||||
{
|
||||
@@ -507,7 +520,7 @@ class _Upgrade
|
||||
}
|
||||
|
||||
/* Or do we need to set validating flag because they have a row in core_validating? */
|
||||
if( in_array( $row['member_id'], $validatingMemberIds ) )
|
||||
if( \in_array( $row['member_id'], $validatingMemberIds ) )
|
||||
{
|
||||
$row['members_bitoptions'] += 1073741824;
|
||||
}
|
||||
@@ -516,7 +529,7 @@ class _Upgrade
|
||||
$newSecondaryGroups = array();
|
||||
foreach( explode( ',', $row['mgroup_others'] ) AS $secondaryGroup )
|
||||
{
|
||||
if ( $secondaryGroup AND ! in_array( $secondaryGroup, array( $bannedGroup, $validatingGroup, $guestGroup ) ) )
|
||||
if ( $secondaryGroup AND ! \in_array( $secondaryGroup, array( $bannedGroup, $validatingGroup, $guestGroup ) ) )
|
||||
{
|
||||
$newSecondaryGroups[] = $secondaryGroup;
|
||||
}
|
||||
@@ -562,7 +575,7 @@ class _Upgrade
|
||||
{
|
||||
if ( $row[ $notNullIntField ] === NULL )
|
||||
{
|
||||
$row[ $notNullIntField ] = intval( $row[ $notNullIntField ] );
|
||||
$row[ $notNullIntField ] = \intval( $row[ $notNullIntField ] );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -589,9 +602,9 @@ class _Upgrade
|
||||
/* Handle other columns, such as those from third party addons */
|
||||
foreach( $row as $field => $value )
|
||||
{
|
||||
if( !$membersDefinition['columns'][ $field ]['allow_null'] AND is_null( $value ) )
|
||||
if( !$membersDefinition['columns'][ $field ]['allow_null'] AND \is_null( $value ) )
|
||||
{
|
||||
if( in_array( $membersDefinition['columns'][ $field ]['type'], array( 'INT', 'TINYINT', 'SMALLINT', 'MEDIUMINT', 'BIGINT' ) ) )
|
||||
if( \in_array( $membersDefinition['columns'][ $field ]['type'], array( 'INT', 'TINYINT', 'SMALLINT', 'MEDIUMINT', 'BIGINT' ) ) )
|
||||
{
|
||||
$row[ $field ] = 0;
|
||||
}
|
||||
@@ -648,7 +661,7 @@ class _Upgrade
|
||||
$_folders = unserialize( $row['pconversation_filters'] );
|
||||
$folders = array();
|
||||
|
||||
if ( is_array( $_folders ) and count( $_folders ) )
|
||||
if ( \is_array( $_folders ) and \count( $_folders ) )
|
||||
{
|
||||
foreach( $_folders as $k => $folder )
|
||||
{
|
||||
@@ -683,7 +696,7 @@ class _Upgrade
|
||||
|
||||
foreach( $row as $k => $v )
|
||||
{
|
||||
if ( ! in_array( $k, array_keys( $membersDefinition['columns'] ) ) )
|
||||
if ( ! \in_array( $k, array_keys( $membersDefinition['columns'] ) ) )
|
||||
{
|
||||
unset( $row[ $k ] );
|
||||
}
|
||||
@@ -700,7 +713,7 @@ class _Upgrade
|
||||
catch( \IPS\Db\Exception $ex )
|
||||
{
|
||||
/* Ignore duplicate warnings */
|
||||
if ( ! in_array( $ex->getCode(), array( 1062 ) ) )
|
||||
if ( ! \in_array( $ex->getCode(), array( 1062 ) ) )
|
||||
{
|
||||
throw $ex;
|
||||
}
|
||||
@@ -713,7 +726,7 @@ class _Upgrade
|
||||
catch( \IPS\Db\Exception $ex )
|
||||
{
|
||||
/* Ignore duplicate warnings */
|
||||
if ( ! in_array( $ex->getCode(), array( 1062 ) ) )
|
||||
if ( ! \in_array( $ex->getCode(), array( 1062 ) ) )
|
||||
{
|
||||
throw $ex;
|
||||
}
|
||||
@@ -776,7 +789,7 @@ class _Upgrade
|
||||
|
||||
unset( $_SESSION['convertMembersEngine'], $_SESSION['convertPfieldsEngine'] );
|
||||
|
||||
if ( count( $toRun ) )
|
||||
if ( \count( $toRun ) )
|
||||
{
|
||||
\IPS\core\Setup\Upgrade::adjustMultipleRedirect( array( 1 => 'core', 'extra' => array( '_upgradeStep' => 2 ) ) );
|
||||
|
||||
@@ -809,7 +822,7 @@ class _Upgrade
|
||||
}
|
||||
else
|
||||
{
|
||||
$message = "Upgrading members...";
|
||||
$message = "Upgrading members";
|
||||
}
|
||||
|
||||
return $message;
|
||||
@@ -851,7 +864,7 @@ class _Upgrade
|
||||
/* Retain log in method (username, email or both) */
|
||||
if( $login['login_user_id'] )
|
||||
{
|
||||
$data = ( is_array( $data ) ) ? $data : array();
|
||||
$data = ( \is_array( $data ) ) ? $data : array();
|
||||
|
||||
switch( $login['login_user_id'] )
|
||||
{
|
||||
@@ -930,7 +943,7 @@ class _Upgrade
|
||||
$fbSettings = array(
|
||||
'app_id' => $settings['fbc_appid'],
|
||||
'app_secret' => $settings['fbc_secret'],
|
||||
'real_name' => ( in_array( $settings['fb_realname'], array( 'prefilled', 'enforced' ) ) ) ? true : false,
|
||||
'real_name' => ( \in_array( $settings['fb_realname'], array( 'prefilled', 'enforced' ) ) ) ? true : false,
|
||||
);
|
||||
|
||||
$update = array( 'login_settings' => json_encode( $fbSettings ) );
|
||||
@@ -1052,7 +1065,7 @@ class _Upgrade
|
||||
/* We can't have special characters in the language string key or it breaks */
|
||||
$thisSet = preg_replace( "/[^a-zA-Z0-9_]/", '_', $emoticons['emo_set'] );
|
||||
|
||||
if( in_array( $thisSet, $emoticonSets ) )
|
||||
if( \in_array( $thisSet, $emoticonSets ) )
|
||||
{
|
||||
continue;
|
||||
}
|
||||
@@ -1243,7 +1256,7 @@ class _Upgrade
|
||||
}
|
||||
|
||||
/* Update as needed */
|
||||
if( count( $update ) )
|
||||
if( \count( $update ) )
|
||||
{
|
||||
\IPS\Db::i()->update( 'core_pfields_content', $update, 'member_id=' . $row['member_id'] );
|
||||
}
|
||||
@@ -1315,7 +1328,7 @@ class _Upgrade
|
||||
|
||||
case 'cbox':
|
||||
$options = explode( '|', $field['pf_content'] );
|
||||
$update['pf_type'] = ( count( $options ) == 1 ) ? 'Checkbox' : 'CheckboxSet';
|
||||
$update['pf_type'] = ( \count( $options ) == 1 ) ? 'Checkbox' : 'CheckboxSet';
|
||||
$update['pf_multiple'] = ( $update['pf_type'] == 'CheckboxSet' ) ? TRUE : FALSE;
|
||||
break;
|
||||
|
||||
@@ -1360,14 +1373,14 @@ class _Upgrade
|
||||
}
|
||||
|
||||
/* Update as needed */
|
||||
if( count( $update ) )
|
||||
if( \count( $update ) )
|
||||
{
|
||||
\IPS\Db::i()->update( 'core_pfields_data', $update, 'pf_id=' . $field['pf_id'] );
|
||||
}
|
||||
}
|
||||
|
||||
/* Determine if we have to loop */
|
||||
if( count( $extra ) )
|
||||
if( \count( $extra ) )
|
||||
{
|
||||
$extra['_count'] = 0;
|
||||
return base64_encode( json_encode( $extra ) );
|
||||
@@ -1455,7 +1468,7 @@ class _Upgrade
|
||||
}) );
|
||||
}
|
||||
|
||||
\IPS\Db::i()->insert( 'core_notification_defaults', array( 'notification_key' => $key, 'default' => $selected, 'disabled' => $disabled, 'editable' => $data['disable_override'] ), TRUE );
|
||||
\IPS\Db::i()->insert( 'core_notification_defaults', array( 'notification_key' => $key, 'default' => $selected, 'disabled' => $disabled, 'editable' => (int) $data['disable_override'] ), TRUE );
|
||||
}
|
||||
}
|
||||
catch( \UnderflowException $e )
|
||||
@@ -1507,7 +1520,7 @@ ADD INDEX follow_member_id (follow_member_id, follow_visible, follow_added),
|
||||
DROP INDEX like_lookup_area"
|
||||
) ) );
|
||||
|
||||
if ( count( $toRun ) )
|
||||
if ( \count( $toRun ) )
|
||||
{
|
||||
\IPS\core\Setup\Upgrade::adjustMultipleRedirect( array( 1 => 'core', 'extra' => array( '_upgradeStep' => 9 ) ) );
|
||||
|
||||
@@ -1543,7 +1556,7 @@ DROP INDEX like_lookup_area"
|
||||
/* Turn this off for all groups */
|
||||
\IPS\Db::i()->update( 'core_groups', "g_bitoptions=g_bitoptions & (~ 67108864)" );
|
||||
|
||||
if( count( $groups ) )
|
||||
if( \count( $groups ) )
|
||||
{
|
||||
\IPS\Db::i()->update( 'core_groups', "g_bitoptions=g_bitoptions & 67108864", 'g_id IN(' . implode( ',', $groups ) . ')' );
|
||||
}
|
||||
@@ -1554,7 +1567,7 @@ DROP INDEX like_lookup_area"
|
||||
/* Turn this off for all groups */
|
||||
\IPS\Db::i()->update( 'core_groups', "g_bitoptions=g_bitoptions & (~ 134217728)" );
|
||||
|
||||
if( count( $groups ) )
|
||||
if( \count( $groups ) )
|
||||
{
|
||||
\IPS\Db::i()->update( 'core_groups', "g_bitoptions=g_bitoptions & 134217728", 'g_id IN(' . implode( ',', $groups ) . ')' );
|
||||
}
|
||||
@@ -1564,7 +1577,7 @@ DROP INDEX like_lookup_area"
|
||||
|
||||
\IPS\Db::i()->update( 'core_groups', "g_bitoptions=g_bitoptions & (~ 536870912)" );
|
||||
|
||||
if( count( $groups ) )
|
||||
if( \count( $groups ) )
|
||||
{
|
||||
\IPS\Db::i()->update( 'core_groups', "g_bitoptions=g_bitoptions & 536870912", 'g_id IN(' . implode( ',', $groups ) . ')' );
|
||||
}
|
||||
@@ -1654,7 +1667,7 @@ DROP INDEX like_lookup_area"
|
||||
'can_see_emails' => false,
|
||||
'can_flag_as_spammer' => $moderator['mod_bitoptions'] & 1,
|
||||
'can_edit_profiles' => false,
|
||||
'can_view_reports' => $moderator['is_group'] ? in_array( $moderator['group_id'], $reportCenter ) : false,
|
||||
'can_view_reports' => $moderator['is_group'] ? \in_array( $moderator['group_id'], $reportCenter ) : false,
|
||||
'mod_see_warn' => false,
|
||||
'mod_can_warn' => (bool) $moderator['allow_warn'],
|
||||
'mod_revoke_warn' => false,
|
||||
@@ -1690,16 +1703,16 @@ DROP INDEX like_lookup_area"
|
||||
|
||||
foreach( $newPerms as $key => $value )
|
||||
{
|
||||
if ( is_array( $value ) )
|
||||
if ( \is_array( $value ) )
|
||||
{
|
||||
if ( isset( $existingPerms[ $key ] ) and is_array( $existingPerms[ $key ] ) )
|
||||
if ( isset( $existingPerms[ $key ] ) and \is_array( $existingPerms[ $key ] ) )
|
||||
{
|
||||
$newPerms[ $key ] = array_merge_recursive( $existingPerms[ $key ], $value );
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$newPerms[ $key ] = ( isset( $existingPerms[ $key ] ) and intval( $existingPerms[ $key ] ) > intval($value) ) ? $existingPerms[ $key ] : $value;
|
||||
$newPerms[ $key ] = ( isset( $existingPerms[ $key ] ) and \intval( $existingPerms[ $key ] ) > \intval($value) ) ? $existingPerms[ $key ] : $value;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1769,7 +1782,7 @@ DROP INDEX like_lookup_area"
|
||||
{
|
||||
$perCycle = 1000;
|
||||
$did = 0;
|
||||
$limit = intval( \IPS\Request::i()->extra );
|
||||
$limit = \intval( \IPS\Request::i()->extra );
|
||||
|
||||
$classes = array();
|
||||
|
||||
@@ -1791,7 +1804,7 @@ DROP INDEX like_lookup_area"
|
||||
$did++;
|
||||
|
||||
/* Bugs in older versions may have a report with a 'status' outside of 1, 2, or 3, which can fail when using MySQL Strict with a Data truncated error. We set it to 3 here, so reports are not suddenly shown as "new" */
|
||||
if ( !in_array( $report['status'], array( 1, 2, 3 ) ) )
|
||||
if ( !\in_array( $report['status'], array( 1, 2, 3 ) ) )
|
||||
{
|
||||
$report['status'] = 3;
|
||||
}
|
||||
@@ -1982,7 +1995,7 @@ DROP INDEX like_lookup_area"
|
||||
{
|
||||
$containerClass = $item::$containerNodeClass;
|
||||
|
||||
if ( in_array( 'IPS\Node\Permissions', class_implements( $containerClass ) ) )
|
||||
if ( \in_array( 'IPS\Node\Permissions', class_implements( $containerClass ) ) )
|
||||
{
|
||||
$containerRow = \IPS\DB::i()->select( "*", $containerTable, array( "{$containerClass::$databasePrefix}{$containerClass::$databaseColumnId} = ?", $item->mapped('container') ) )->first();
|
||||
$container = $containerClass::constructFromData( $containerRow );
|
||||
@@ -2049,7 +2062,7 @@ DROP INDEX like_lookup_area"
|
||||
{
|
||||
$perCycle = 1000;
|
||||
$did = 0;
|
||||
$limit = intval( \IPS\Request::i()->extra );
|
||||
$limit = \intval( \IPS\Request::i()->extra );
|
||||
|
||||
/* Try to prevent timeouts to the extent possible */
|
||||
$cutOff = \IPS\core\Setup\Upgrade::determineCutoff();
|
||||
@@ -2258,7 +2271,7 @@ DROP INDEX like_lookup_area"
|
||||
$columns[] = 'attach_rel_id';
|
||||
}
|
||||
|
||||
if( count( $columns ) )
|
||||
if( \count( $columns ) )
|
||||
{
|
||||
\IPS\Db::i()->dropColumn( 'core_attachments', $columns );
|
||||
}
|
||||
@@ -2306,10 +2319,10 @@ DROP INDEX like_lookup_area"
|
||||
'query' => "ALTER TABLE " . \IPS\Db::i()->prefix . "core_voters ADD COLUMN poll MEDIUMINT UNSIGNED NOT NULL COMMENT 'The poll ID',
|
||||
ADD INDEX poll (poll),
|
||||
DROP INDEX tid,
|
||||
ADD INDEX member(member_id, poll)"
|
||||
ADD INDEX `member`(member_id, poll)"
|
||||
) ) );
|
||||
|
||||
if ( count( $toRun ) )
|
||||
if ( \count( $toRun ) )
|
||||
{
|
||||
\IPS\core\Setup\Upgrade::adjustMultipleRedirect( array( 1 => 'core', 'extra' => array( '_upgradeStep' => 15 ) ) );
|
||||
|
||||
@@ -2370,7 +2383,7 @@ DROP INDEX like_lookup_area"
|
||||
/* Sometimes data from 3.4.x isn't always as well formed as we'd like, especially when non-latin chars are involved */
|
||||
$data = unserialize( $poll['choices'] );
|
||||
|
||||
if( !is_array( $data ) )
|
||||
if( !\is_array( $data ) )
|
||||
{
|
||||
$poll['choices'] = str_replace( '\\"', '"', str_replace( '\\\'', "'", $poll['choices'] ) );
|
||||
$data = unserialize( $poll['choices'] );
|
||||
@@ -2378,17 +2391,17 @@ DROP INDEX like_lookup_area"
|
||||
|
||||
$_decoded = FALSE;
|
||||
|
||||
if( !is_array( $data ) )
|
||||
if( !\is_array( $data ) )
|
||||
{
|
||||
$data = unserialize( utf8_decode( $poll['choices'] ) );
|
||||
|
||||
if( is_array( $data ) )
|
||||
if( \is_array( $data ) )
|
||||
{
|
||||
$_decoded = TRUE;
|
||||
}
|
||||
}
|
||||
|
||||
if( is_array( $data ) AND $_decoded )
|
||||
if( \is_array( $data ) AND $_decoded )
|
||||
{
|
||||
$newPoll = array();
|
||||
|
||||
@@ -2398,7 +2411,7 @@ DROP INDEX like_lookup_area"
|
||||
{
|
||||
$data[ $_key ]['question'] = utf8_encode( $_data['question'] );
|
||||
|
||||
if( is_array( $_data['choice'] ) )
|
||||
if( \is_array( $_data['choice'] ) )
|
||||
{
|
||||
foreach( $_data['choice'] as $_idx => $_choice )
|
||||
{
|
||||
@@ -2422,24 +2435,24 @@ DROP INDEX like_lookup_area"
|
||||
{
|
||||
$data = unserialize( $poll['choices'] );
|
||||
|
||||
if( !is_array( $data ) )
|
||||
if( !\is_array( $data ) )
|
||||
{
|
||||
$poll['choices'] = str_replace( '\\"', '"', str_replace( '\\\'', "'", $poll['choices'] ) );
|
||||
$data = unserialize( $poll['choices'] );
|
||||
}
|
||||
|
||||
if( !is_array( $data ) )
|
||||
if( !\is_array( $data ) )
|
||||
{
|
||||
$data = unserialize( utf8_decode( $poll['choices'] ) );
|
||||
}
|
||||
|
||||
if( is_array( $data ) )
|
||||
if( \is_array( $data ) )
|
||||
{
|
||||
foreach( $data as $_key => $_data )
|
||||
{
|
||||
$data[ $_key ]['question'] = utf8_encode( $_data['question'] );
|
||||
|
||||
if( is_array( $_data['choice'] ) )
|
||||
if( \is_array( $_data['choice'] ) )
|
||||
{
|
||||
foreach( $_data['choice'] as $_idx => $_choice )
|
||||
{
|
||||
@@ -2852,12 +2865,12 @@ DROP INDEX like_lookup_area"
|
||||
{
|
||||
if ( $row['conf_value'] )
|
||||
{
|
||||
if ( in_array( $row['conf_key'], array( 'upload_dir', 'gallery_images_path', 'idm_localsspath', 'idm_localfilepath', 'blog_upload_dir' ) ) and !@is_dir( str_replace( array( '{root_path}', '{root}' ), \IPS\ROOT_PATH, $row['conf_value'] ) ) )
|
||||
if ( \in_array( $row['conf_key'], array( 'upload_dir', 'gallery_images_path', 'idm_localsspath', 'idm_localfilepath', 'blog_upload_dir' ) ) and !@is_dir( str_replace( array( '{root_path}', '{root}' ), \IPS\ROOT_PATH, $row['conf_value'] ) ) )
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
if ( in_array( $row['conf_key'], array( 'upload_url', 'gallery_images_url', 'idm_screenshot_url', 'blog_upload_url' ) ) )
|
||||
if ( \in_array( $row['conf_key'], array( 'upload_url', 'gallery_images_url', 'idm_screenshot_url', 'blog_upload_url' ) ) )
|
||||
{
|
||||
$row['conf_value'] = str_replace( \IPS\Http\Url::baseUrl(), '', $row['conf_value'] );
|
||||
}
|
||||
@@ -2934,7 +2947,7 @@ DROP INDEX like_lookup_area"
|
||||
if( isset( $settings['gallery_images_path'] ) AND $settings['gallery_images_path'] AND $settings['gallery_images_path'] != $settings['upload_dir'] )
|
||||
{
|
||||
$url = $settings['gallery_images_url'] ?: rtrim( \IPS\Settings::i()->base_url, '/' ) . '/applications/gallery/interface/legacy/image.php?path=';
|
||||
$gallery = \IPS\Db::i()->insert( 'core_file_storage', array( 'method' => 'FileSystem', 'configuration' => json_encode( array( 'dir' => str_replace( \IPS\ROOT_PATH, '{root}', $settings['gallery_images_path'] ), 'url' => $url ) ) ) );
|
||||
$gallery = \IPS\Db::i()->insert( 'core_file_storage', array( 'method' => 'FileSystem', 'configuration' => json_encode( array( 'dir' => str_replace( \IPS\ROOT_PATH, '{root}', $settings['gallery_images_path'] ), 'url' => $url, 'toggle' => 1, 'custom_url' => $url ) ) ) );
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -2944,7 +2957,7 @@ DROP INDEX like_lookup_area"
|
||||
/* Blog */
|
||||
if( isset( $settings['blog_upload_dir'] ) AND $settings['blog_upload_dir'] AND $settings['blog_upload_dir'] != $settings['upload_dir'] )
|
||||
{
|
||||
$blog = \IPS\Db::i()->insert( 'core_file_storage', array( 'method' => 'FileSystem', 'configuration' => json_encode( array( 'dir' => str_replace( \IPS\ROOT_PATH, '{root}', $settings['blog_upload_dir'] ), 'url' => $settings['blog_upload_url'] ) ) ) );
|
||||
$blog = \IPS\Db::i()->insert( 'core_file_storage', array( 'method' => 'FileSystem', 'configuration' => json_encode( array( 'dir' => str_replace( \IPS\ROOT_PATH, '{root}', $settings['blog_upload_dir'] ), 'url' => $settings['blog_upload_url'], 'toggle' => 1, 'custom_url' => $settings['blog_upload_url'] ) ) ) );
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -3025,8 +3038,10 @@ DROP INDEX like_lookup_area"
|
||||
}
|
||||
|
||||
$downloads = \IPS\Db::i()->insert( 'core_file_storage', array( 'method' => 'FileSystem', 'configuration' => json_encode( array(
|
||||
'dir' => str_replace( '{root_path}', '{root}', $settings['idm_localfilepath'] ),
|
||||
'url' => $_SESSION['downloads_url']
|
||||
'dir' => str_replace( '{root_path}', '{root}', $settings['idm_localfilepath'] ),
|
||||
'url' => $_SESSION['downloads_url'],
|
||||
'toggle' => 1,
|
||||
'custom_url' => rtrim( \IPS\Settings::i()->base_url, '/' ) . '/' . $_SESSION['downloads_url']
|
||||
) ) ) );
|
||||
|
||||
if( $useCustom )
|
||||
@@ -3079,7 +3094,7 @@ DROP INDEX like_lookup_area"
|
||||
\IPS\Settings::i()->clearCache();
|
||||
|
||||
/* This constant isn't used in 4.0 but may be leftover from 3.x */
|
||||
$publicPath = ( defined( 'PUBLIC_DIRECTORY' ) ? PUBLIC_DIRECTORY : 'public' );
|
||||
$publicPath = ( \defined( 'PUBLIC_DIRECTORY' ) ? PUBLIC_DIRECTORY : 'public' );
|
||||
|
||||
/* Loop over records to fix the paths to urls */
|
||||
if( \IPS\Db::i()->checkForTable( $table ) )
|
||||
@@ -3118,7 +3133,7 @@ DROP INDEX like_lookup_area"
|
||||
if ( $table === 'core_member_ranks' )
|
||||
{
|
||||
/* The "pips" column is not required to be filled in */
|
||||
if ( $row[ $column ] AND !is_numeric( $row[ $column ] ) )
|
||||
if ( $row[ $column ] AND !\is_numeric( $row[ $column ] ) )
|
||||
{
|
||||
if ( file_exists( \IPS\ROOT_PATH . '/' . $publicPath . '/style_extra/team_icons/' . $row[ $column ] ) )
|
||||
{
|
||||
@@ -3204,7 +3219,7 @@ DROP INDEX like_lookup_area"
|
||||
}
|
||||
}
|
||||
|
||||
if ( count( $update ) )
|
||||
if ( \count( $update ) )
|
||||
{
|
||||
foreach( $update as $col => $url )
|
||||
{
|
||||
@@ -3295,7 +3310,7 @@ DROP INDEX like_lookup_area"
|
||||
{
|
||||
$perCycle = 100;
|
||||
$did = 0;
|
||||
$limit = intval( \IPS\Request::i()->extra );
|
||||
$limit = \intval( \IPS\Request::i()->extra );
|
||||
|
||||
/* Try to prevent timeouts to the extent possible */
|
||||
$cutOff = \IPS\core\Setup\Upgrade::determineCutoff();
|
||||
@@ -3371,7 +3386,7 @@ DROP INDEX like_lookup_area"
|
||||
'query' => "UPDATE " . \IPS\Db::i()->prefix . "core_follow SET follow_notify_sent=" . time()
|
||||
) ) );
|
||||
|
||||
if ( count( $toRun ) )
|
||||
if ( \count( $toRun ) )
|
||||
{
|
||||
\IPS\core\Setup\Upgrade::adjustMultipleRedirect( array( 1 => 'core', 'extra' => array( '_upgradeStep' => 21 ) ) );
|
||||
|
||||
@@ -3674,7 +3689,7 @@ DROP INDEX like_lookup_area"
|
||||
}
|
||||
|
||||
/* Disable all apps not currently being upgraded */
|
||||
if ( is_array( $_SESSION['apps'] ) )
|
||||
if ( \is_array( $_SESSION['apps'] ) )
|
||||
{
|
||||
\IPS\Db::i()->update( 'core_applications', array( 'app_enabled' => 0 ), 'app_directory NOT IN (\'' . implode( "','", array_keys( $_SESSION['apps'] ) ) . '\')' );
|
||||
}
|
||||
@@ -3688,6 +3703,11 @@ DROP INDEX like_lookup_area"
|
||||
\IPS\Db::i()->dropTable( 'warn_logs' );
|
||||
}
|
||||
|
||||
if( \IPS\Db::i()->checkForTable('core_rss_imported') )
|
||||
{
|
||||
\IPS\Db::i()->dropTable( 'core_rss_imported' );
|
||||
}
|
||||
|
||||
$acpNotes = \IPS\Db::i()->select( 'cs_value', 'cache_store', array( 'cs_key=?', 'adminnotes' ) )->first();
|
||||
\IPS\Settings::i()->changeValues( array( 'acp_notes' => $acpNotes ) );
|
||||
|
||||
@@ -3905,7 +3925,7 @@ DROP INDEX like_lookup_area"
|
||||
/* Convert sessions table if it is memory and add data column */
|
||||
$sessionTable = \IPS\Db::i()->getTableDefinition( 'core_sessions' );
|
||||
|
||||
if( isset( $sessionTable['engine'] ) AND in_array( mb_strtolower( $sessionTable['engine'] ), array( 'memory', 'heap' ) ) )
|
||||
if( isset( $sessionTable['engine'] ) AND \in_array( mb_strtolower( $sessionTable['engine'] ), array( 'memory', 'heap' ) ) )
|
||||
{
|
||||
\IPS\Db::i()->query( "ALTER TABLE " . \IPS\Db::i()->prefix . "core_sessions ENGINE=" . \IPS\Db::i()->defaultEngine() );
|
||||
}
|
||||
@@ -3936,7 +3956,7 @@ DROP INDEX like_lookup_area"
|
||||
{
|
||||
$offset = isset( \IPS\Request::i()->extra ) ? \IPS\Request::i()->extra : 0;
|
||||
$select = \IPS\Db::i()->select( '*', 'nexus_customer_history', NULL, 'log_id', array( $offset, 500 ) );
|
||||
if ( count( $select ) )
|
||||
if ( \count( $select ) )
|
||||
{
|
||||
foreach ( $select as $row )
|
||||
{
|
||||
@@ -4065,7 +4085,7 @@ DROP INDEX like_lookup_area"
|
||||
{
|
||||
foreach( $groupMasks as $groupId => $masks )
|
||||
{
|
||||
if( in_array( $viewMask, $masks ) )
|
||||
if( \in_array( $viewMask, $masks ) )
|
||||
{
|
||||
$thisColumnGroups[ $groupId ] = $groupId;
|
||||
}
|
||||
@@ -4077,7 +4097,7 @@ DROP INDEX like_lookup_area"
|
||||
}
|
||||
}
|
||||
|
||||
if( count( $update ) )
|
||||
if( \count( $update ) )
|
||||
{
|
||||
\IPS\Db::i()->update( 'core_permission_index', $update, array( 'perm_id=?', $perm['perm_id'] ) );
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user