Version 4.3.6

This commit is contained in:
Neo committed 2025-12-19 05:49:12 -08:00
1 parent fe1acf984a
commit 1a0c7fd3c2
609 files changed
+14707 -5726

No files matched your search

@@ -0,0 +1,15 @@
{
"1": {
"method": "update",
"params": [
"core_members",
{
"pp_photo_type": "custom"
},
[
"pp_photo_type=?",
"upload"
]
]
}
}
@@ -472,7 +472,7 @@ class _Upgrade
*/
public function step9()
{
\IPS\Db::i()->update( 'core_member_ranks', 'pips=100', array('pips>?', 100 ) );
\IPS\Db::i()->update( 'core_member_ranks', 'pips=100', array('pips!=? AND pips IS NOT NULL AND pips>?', '', 100 ) );
return TRUE;
}
@@ -1,5 +1,5 @@
[
{
{
"1": {
"method": "changeIndex",
"params": [
"core_reputation_index",
@@ -22,7 +22,7 @@
}
]
},
{
"2": {
"method": "createTable",
"params": [
{
@@ -72,4 +72,4 @@
}
]
}
]
}
@@ -11,7 +11,7 @@
$options = array();
/* Usage reporting */
$options[] = new \IPS\Helpers\Form\YesNo( '103000_usage_reporting', TRUE );
// $options[] = new \IPS\Helpers\Form\YesNo( '103000_usage_reporting', FALSE );
/* Is IPS Connect enabled? */
$ipsConnectEnabled = FALSE;
@@ -31,7 +31,7 @@ if( $ipsConnectEnabled )
{
$options[] = new \IPS\Helpers\Form\Custom( 'ipsconnect', null, FALSE, array( 'getHtml' => function( $element ) use ( $members ){
$url = \IPS\Http\Url::ips('docs/login_invision');
return "<br>IPS Connect has been replaced with a new OAuth-based system for connecting two or more communities.<br><br><strong>If you have already upgraded the master install in your IPS Connect network</strong> follow the <a href='{$url}' target='_blank'>Connect Two Invision Communities</a> guide to get the Client Identifier and Client Secret and enter them below.<br><strong>If you have not yet upgraded the master install in your IPS Connect network or do not want to enter these details yet</strong> you can leave the settings below blank, but make sure you have bookmarked the <a href='{$url}' target='_blank'>Connect Two Invision Communities</a> guide to refer to after you have finished the upgrade.<br><br><strong class='ipsType_warning'><i class='fa fa-exclamation-triangle'></i> If you do not provide these details now you will not be able to log in using IPS Connect once the upgrade is complete. If you find yourself unable to log in after the upgrade, use the Forgot Password tool to regain access to your account.</strong>";
return "<br>IPS Connect has been replaced with a new OAuth-based system for connecting two or more communities.<br><br><strong>If you have already upgraded the master install in your IPS Connect network</strong> follow the <a href='{$url}' target='_blank' rel='noopener'>Connect Two Invision Communities</a> guide to get the Client Identifier and Client Secret and enter them below.<br><strong>If you have not yet upgraded the master install in your IPS Connect network or do not want to enter these details yet</strong> you can leave the settings below blank, but make sure you have bookmarked the <a href='{$url}' target='_blank' rel='noopener'>Connect Two Invision Communities</a> guide to refer to after you have finished the upgrade.<br><br><strong class='ipsType_warning'><i class='fa fa-exclamation-triangle'></i> If you do not provide these details now you will not be able to log in using IPS Connect once the upgrade is complete. If you find yourself unable to log in after the upgrade, use the Forgot Password tool to regain access to your account.</strong>";
} ), function( $val ) {}, NULL, NULL, 'ipsconnect' );
$row = \IPS\Db::i()->select( '*', 'core_login_handlers', array( 'login_key=? AND login_enabled=1', 'Ipsconnect' ) )->first();
@@ -65,7 +65,7 @@ if( \IPS\Settings::i()->logins_over_https OR ( \IPS\Settings::i()->nexus_https A
$pluralS = count( $setting ) > 1 ? 's' : '';
$pluralThis = count( $setting ) > 1 ? 'these' : 'this';
$pluralIs = count( $setting ) > 1 ? 'are' : 'is';
return "You currently have the {$settingString} setting{$pluralS} enabled. Due to recent changes to some browsers, {$pluralThis} feature{$pluralS} can cause browser warnings and so {$pluralIs} no longer supported in Invision Community. To keep the security benefits, we recommend moving your entire community to using https after this upgrade is complete. <a href='{$url}' rel='external' target='_blank'>Learn how</a>";
return "You currently have the {$settingString} setting{$pluralS} enabled. Due to recent changes to some browsers, {$pluralThis} feature{$pluralS} can cause browser warnings and so {$pluralIs} no longer supported in Invision Community. To keep the security benefits, we recommend moving your entire community to using https after this upgrade is complete. <a href='{$url}' rel='external' target='_blank' rel='noopener'>Learn how</a>";
} ), function( $val ) {}, NULL, NULL, 'https_settings_changes' );
}
@@ -74,7 +74,7 @@ if( \IPS\Settings::i()->security_remove_acp_link )
{
$options[] = new \IPS\Helpers\Form\Custom( 'admincp_hide_deprecate', null, FALSE, array( 'getHtml' => function( $element ) use ( $members ){
$url = \IPS\Http\Url::ips('docs/hide_acp');
return "<br>The setting to hide the link to the AdminCP has been removed. After completing the upgrade, follow the <a href='{$url}' target='_blank'>Hiding the AdminCP</a> guide to retain this functionality.<br><br><strong class='ipsType_warning'><i class='fa fa-exclamation-triangle'></i> Before continuing, ensure you have bookmarked this guide to refer to after you have finished the upgrade.</strong>";
return "<br>The setting to hide the link to the AdminCP has been removed. After completing the upgrade, follow the <a href='{$url}' target='_blank' rel='noopener'>Hiding the AdminCP</a> guide to retain this functionality.<br><br><strong class='ipsType_warning'><i class='fa fa-exclamation-triangle'></i> Before continuing, ensure you have bookmarked this guide to refer to after you have finished the upgrade.</strong>";
} ), function( $val ) {}, NULL, NULL, 'admincp_hide_deprecate' );
}
@@ -84,6 +84,6 @@ if( \IPS\Settings::i()->bot_antispam_type === 'recaptcha' )
$options[] = new \IPS\Helpers\Form\Custom( 'recaptcha_v1_removed', null, FALSE, array( 'getHtml' => function( $element ) use ( $members ){
$url = \IPS\Http\Url::ips('docs/captcha_recaptcha_invisible');
return "<br>Your community was set to use reCAPTCHA 1, a CAPTCHA method where the user is shown two distorted words and must type the displayed words. Google recently retired this service so we are automatically upgrading you to the latest <a href='{$url}' target='_blank'>Invisible reCAPTCHA</a> method. This doesn't require user input as the system intelligently detects if the user is human in the background.";
return "<br>Your community was set to use reCAPTCHA 1, a CAPTCHA method where the user is shown two distorted words and must type the displayed words. Google recently retired this service so we are automatically upgrading you to the latest <a href='{$url}' target='_blank' rel='noopener'>Invisible reCAPTCHA</a> method. This doesn't require user input as the system intelligently detects if the user is human in the background.";
} ), function( $val ) {}, NULL, NULL, 'recaptcha_v1_removed' );
}
+39 -86
View File
@@ -633,16 +633,6 @@
true
]
},
"9": {
"method": "dropColumn",
"params": [
"core_members",
[
"ipsconnect_id",
"ipsconnect_revalidate_url"
]
]
},
"10": {
"method": "createTable",
"params": [
@@ -945,27 +935,6 @@
}
]
},
"12": {
"method": "changeColumn",
"params": [
"core_members",
"members_pass_hash",
{
"name": "members_pass_hash",
"type": "VARCHAR",
"length": 255,
"decimals": null,
"values": [],
"allow_null": true,
"default": null,
"comment": "",
"unsigned": false,
"zerofill": false,
"auto_increment": false,
"binary": false
}
]
},
"13": {
"method": "changeColumn",
"params": [
@@ -1089,6 +1058,12 @@
]
},
"23": {
"method": "delete",
"params": [
"core_search_index"
]
},
"24": {
"method": "changeIndex",
"params": [
"core_search_index",
@@ -1111,7 +1086,7 @@
}
]
},
"24": {
"25": {
"method": "addColumn",
"params": [
"core_email_templates",
@@ -1131,7 +1106,7 @@
}
]
},
"25": {
"26": {
"method": "delete",
"params": [
"core_tasks",
@@ -1142,7 +1117,7 @@
]
]
},
"26": {
"27": {
"method": "addIndex",
"params": [
"core_moderator_logs",
@@ -1158,7 +1133,7 @@
}
]
},
"27": {
"28": {
"method": "addIndex",
"params": [
"core_rc_reports",
@@ -1174,7 +1149,7 @@
}
]
},
"28": {
"29": {
"method": "createTable",
"params": [
{
@@ -1278,7 +1253,7 @@
}
]
},
"29": {
"30": {
"method": "addColumn",
"params": [
"core_rc_reports",
@@ -1298,7 +1273,7 @@
}
]
},
"30": {
"31": {
"method": "createTable",
"params": [
{
@@ -1406,7 +1381,7 @@
}
]
},
"31": {
"32": {
"method": "createTable",
"params": [
{
@@ -1502,7 +1477,7 @@
}
]
},
"32": {
"33": {
"method": "createTable",
"params": [
{
@@ -1554,7 +1529,7 @@
}
]
},
"33": {
"34": {
"method": "addColumn",
"params": [
"core_rc_index",
@@ -1574,14 +1549,14 @@
}
]
},
"34": {
"35": {
"method": "dropColumn",
"params": [
"core_theme_templates",
"template_unique_key"
]
},
"35": {
"36": {
"method": "addIndex",
"params": [
"core_theme_templates",
@@ -1604,14 +1579,14 @@
}
]
},
"36": {
"37": {
"method": "dropColumn",
"params": [
"core_theme_css",
"css_unique_key"
]
},
"37": {
"38": {
"method": "addIndex",
"params": [
"core_theme_css",
@@ -1635,7 +1610,7 @@
}
]
},
"38": {
"39": {
"method": "update",
"params": [
"core_member_history",
@@ -1643,7 +1618,7 @@
"log_type IN('member_group_id', 'group_promotion', 'group_promotion_o', 'mgroup_others')"
]
},
"39": {
"40": {
"method": "update",
"params": [
"core_member_history",
@@ -1651,7 +1626,7 @@
"log_type='merged'"
]
},
"40": {
"41": {
"method": "update",
"params": [
"core_member_history",
@@ -1659,7 +1634,7 @@
"log_type='spammer'"
]
},
"41": {
"42": {
"method": "changeColumn",
"params": [
"core_member_history",
@@ -1680,7 +1655,7 @@
}
]
},
"42": {
"43": {
"method": "addColumn",
"params": [
"core_themes",
@@ -1700,7 +1675,7 @@
}
]
},
"43": {
"44": {
"method": "addColumn",
"params": [
"core_sys_conf_settings",
@@ -1723,7 +1698,7 @@
}
]
},
"44": {
"45": {
"method": "addColumn",
"params": [
"core_profile_steps",
@@ -1743,7 +1718,7 @@
}
]
},
"45": {
"46": {
"method": "createTable",
"params": [
{
@@ -1845,7 +1820,7 @@
}
]
},
"46": {
"47": {
"method": "addColumn",
"params": [
"core_clubs",
@@ -1865,7 +1840,7 @@
}
]
},
"47": {
"48": {
"method": "addColumn",
"params": [
"core_clubs",
@@ -1885,7 +1860,7 @@
}
]
},
"48": {
"49": {
"method": "addColumn",
"params": [
"core_clubs",
@@ -1905,7 +1880,7 @@
}
]
},
"49": {
"50": {
"method": "addColumn",
"params": [
"core_clubs",
@@ -1925,7 +1900,7 @@
}
]
},
"50": {
"51": {
"method": "changeColumn",
"params": [
"core_clubs_memberships",
@@ -1958,7 +1933,7 @@
}
]
},
"51": {
"52": {
"method": "addColumn",
"params": [
"core_groups",
@@ -1978,7 +1953,7 @@
}
]
},
"52": {
"53": {
"method": "addColumn",
"params": [
"core_announcements",
@@ -1998,7 +1973,7 @@
}
]
},
"53": {
"54": {
"method": "addColumn",
"params": [
"core_announcements",
@@ -2018,7 +1993,7 @@
}
]
},
"54": {
"55": {
"method": "delete",
"params": [
"core_sys_conf_settings",
@@ -2028,7 +2003,7 @@
]
]
},
"55": {
"56": {
"method": "addIndex",
"params": [
"core_rc_reports",
@@ -2044,7 +2019,7 @@
}
]
},
"56": {
"57": {
"method": "addIndex",
"params": [
"core_members_known_ip_addresses",
@@ -2275,22 +2250,6 @@
}
]
},
"71": {
"method": "addIndex",
"params": [
"core_members",
{
"type": "key",
"name": "last_activity",
"columns": [
"last_activity"
],
"length": [
null
]
}
]
},
"72": {
"method": "changeIndex",
"params": [
@@ -2313,12 +2272,6 @@
]
},
"73": {
"method": "delete",
"params": [
"core_search_index"
]
},
"74": {
"method": "addColumn",
"params": [
"core_search_index",
+32 -45
View File
@@ -45,6 +45,9 @@ class _Upgrade
{
$settings['auth_types'] = \IPS\Login::AUTH_TYPE_USERNAME;
}
/* < 4.3 didn't allow this handler to be disabled, make sure that it is enabled (some communities may have worked around this limitation) */
$row['login_acp'] = TRUE;
$row['login_enabled'] = TRUE;
break;
case 'facebook':
$classname = 'IPS\\Login\\Handler\\OAuth2\\Facebook';
@@ -122,6 +125,7 @@ class _Upgrade
\IPS\Lang::saveCustom( 'core', "login_method_{$id}", $title );
\IPS\Db::i()->update( 'core_members_known_devices', array( 'login_handler' => $id ), array( 'login_handler=?', $row['login_key'] ) );
\IPS\Db::i()->update( 'core_profile_steps', array( 'step_subcompletion_act' => $id ), array( 'step_completion_act=? and step_subcompletion_act=?', 'social_login', $row['login_key'] ) );
}
return true;
@@ -316,21 +320,42 @@ class _Upgrade
/**
* Step 3
* Drop old columns
* Adjust the members table
*
* @return array If returns TRUE, upgrader will proceed to next step. If it returns any other value, it will set this as the value of the 'extra' GET parameter and rerun this step (useful for loops)
*/
public function step3()
{
$columnsToDrop = array();
$statements = array(
'DROP COLUMN ipsconnect_id',
'DROP COLUMN ipsconnect_revalidate_url',
'CHANGE members_pass_hash members_pass_hash VARCHAR(255) NULL DEFAULT NULL',
'ADD INDEX last_activity (last_activity)'
);
foreach ( array('fb_uid','fb_token','live_id','live_token','twitter_id','twitter_token','twitter_secret','tc_last_sid_import','tc_photo','tc_bwoptions','fb_photo','fb_photo_thumb','fb_bwoptions','google_id','google_token','linkedin_id','linkedin_token') as $col )
{
if ( \IPS\Db::i()->checkForColumn( 'core_members', $col ) )
{
$columnsToDrop[] = $col;
$statements[] = 'DROP COLUMN ' . $col;
}
}
\IPS\Db::i()->dropColumn( 'core_members', $columnsToDrop );
$toRunQueries = array( array(
'table' => 'core_members',
'query' => "ALTER TABLE " . \IPS\Db::i()->prefix . "core_members " . implode( ', ', $statements )
) );
$toRun = \IPS\core\Setup\Upgrade::runManualQueries( $toRunQueries );
if ( count( $toRun ) )
{
\IPS\core\Setup\Upgrade::adjustMultipleRedirect( array( 1 => 'core', 'extra' => array( '_upgradeStep' => 4 ) ) );
/* Queries to run manually */
return array( 'html' => \IPS\Theme::i()->getTemplate( 'forms' )->queries( $toRun, \IPS\Http\Url::internal( 'controller=upgrade' )->setQueryString( array( 'key' => $_SESSION['uniqueKey'], 'mr_continue' => 1, 'mr' => \IPS\Request::i()->mr ) ) ) );
}
return TRUE;
}
@@ -341,7 +366,7 @@ class _Upgrade
*/
public function step3CustomTitle()
{
return 'Removing unused login data';
return 'Adjusting members table';
}
/**
@@ -521,49 +546,11 @@ class _Upgrade
/**
* Step 9
* Remove announcement widgets
*
* @return bool
*/
public function step9()
{
foreach( \IPS\Db::i()->select( 'id, widgets', 'core_widget_areas', array( 'widgets LIKE(?)', '"key": "announcements"' ) )->setKeyField('id')->setValueField( 'widgets' ) as $id => $config )
{
$json = json_decode( $config, TRUE );
foreach( $json as $key => $value )
{
if( $value['key'] == 'announcements' AND $value['app'] == 'core' )
{
unset( $json[ $key ] );
}
}
\IPS\Db::i()->update( 'core_widget_areas', array( 'widgets' => json_encode( $json ) ), array( 'id=?', $id ) );
}
\IPS\Db::i()->delete( 'core_widgets', array( 'app=? AND `key`=?', 'core', 'announcements' ) );
return TRUE;
}
/**
* Custom title for this step
*
* @return string
*/
public function step9CustomTitle()
{
return "Removing announcement widgets";
}
/**
* Step 10
* Remove orphaned known device data
*
* @return bool
*/
public function step10()
public function step9()
{
$queries = array();
@@ -622,7 +609,7 @@ class _Upgrade
*
* @return string
*/
public function step10CustomTitle()
public function step9CustomTitle()
{
return "Removing orphaned member data";
}
+1 -11
View File
@@ -49,7 +49,7 @@ class _Upgrade
*
* @return array If returns TRUE, upgrader will proceed to next step. If it returns any other value, it will set this as the value of the 'extra' GET parameter and rerun this step (useful for loops)
*/
public function step2()
public function finish()
{
\IPS\Db::i()->delete(
'core_sys_lang_words',
@@ -61,14 +61,4 @@ class _Upgrade
return TRUE;
}
/**
* Custom title for this step
*
* @return string
*/
public function step2CustomTitle()
{
return 'Removing orphaned language strings';
}
}
@@ -0,0 +1,14 @@
{
"1": {
"method": "update",
"params": [
"core_announcements",
{
"announce_color": "none"
},
[
"announce_color IS NULL"
]
]
}
}
@@ -0,0 +1,45 @@
{
"1": {
"method": "delete",
"params": [
"core_search_index"
]
},
"2": {
"method": "changeIndex",
"params": [
"core_search_index",
"container",
{
"type": "key",
"name": "container",
"columns": [
"index_class",
"index_container_id",
"index_date_commented"
],
"length": [
250,
null,
null
]
}
]
},
"3": {
"method": "addIndex",
"params": [
"core_search_index",
{
"type": "key",
"name": "index_date_commented",
"columns": [
"index_date_commented"
],
"length": [
null
]
}
]
}
}
@@ -0,0 +1,36 @@
<?php
/**
* @brief 4.3.2 Upgrade Code
* @author <a href='https://www.invisioncommunity.com'>Invision Power Services, Inc.</a>
* @copyright (c) Invision Power Services, Inc.
* @license https://www.invisioncommunity.com/legal/standards/
* @package Invision Community
* @since 27 Apr 2018
*/
namespace IPS\core\setup\upg_103009;
/* To prevent PHP errors (extending class does not exist) revealing path */
if ( !defined( '\IPS\SUITE_UNIQUE_KEY' ) )
{
header( ( isset( $_SERVER['SERVER_PROTOCOL'] ) ? $_SERVER['SERVER_PROTOCOL'] : 'HTTP/1.0' ) . ' 403 Forbidden' );
exit;
}
/**
* 4.3.2 Upgrade Code
*/
class _Upgrade
{
/**
* Rebuild search index
*
* @return array If returns TRUE, upgrader will proceed to next step. If it returns any other value, it will set this as the value of the 'extra' GET parameter and rerun this step (useful for loops)
*/
public function finish()
{
\IPS\Content\Search\Index::i()->rebuild();
return TRUE;
}
}
@@ -0,0 +1,56 @@
{
"1": {
"method": "update",
"params": [
"core_member_history",
{
"log_type": "coverphoto",
"log_data": "{\"action\":\"remove\"}"
},
[
"log_type=? and log_data=?",
"photo",
"{\"coverphoto\":\"remove\"}"
]
]
},
"2": {
"method": "update",
"params": [
"core_member_history",
{
"log_type": "coverphoto",
"log_data": "{\"action\":\"new\"}"
},
[
"log_type=? and log_data=?",
"photo",
"{\"coverphoto\":\"new\"}"
]
]
},
"3": {
"method": "delete",
"params": [
"core_search_index"
]
},
"4": {
"method": "addIndex",
"params": [
"core_search_index",
{
"type": "key",
"name": "author_posted_in",
"columns": [
"index_author",
"index_item_index_id"
],
"length": [
null,
null
]
}
]
}
}
@@ -0,0 +1,39 @@
<?php
/**
* @brief 4.3.3 Upgrade Code
* @author <a href='https://www.invisioncommunity.com'>Invision Power Services, Inc.</a>
* @copyright (c) Invision Power Services, Inc.
* @license https://www.invisioncommunity.com/legal/standards/
* @package Invision Community
* @since 17 May 2018
*/
namespace IPS\core\setup\upg_103011;
/* To prevent PHP errors (extending class does not exist) revealing path */
if ( !defined( '\IPS\SUITE_UNIQUE_KEY' ) )
{
header( ( isset( $_SERVER['SERVER_PROTOCOL'] ) ? $_SERVER['SERVER_PROTOCOL'] : 'HTTP/1.0' ) . ' 403 Forbidden' );
exit;
}
/**
* 4.3.3 Upgrade Code
*/
class _Upgrade
{
/**
* Finish step
*
* @return array If returns TRUE, upgrader will proceed to next step. If it returns any other value, it will set this as the value of the 'extra' GET parameter and rerun this step (useful for loops)
*/
public function finish()
{
if( isset( \IPS\Settings::i()->search_method ) AND \IPS\Settings::i()->search_method == 'mysql' )
{
\IPS\Content\Search\Index::i()->rebuild();
}
return TRUE;
}
}
@@ -0,0 +1,47 @@
{
"1": {
"method": "changeColumn",
"params": [
"core_oauth_authorize_prompts",
"response_type",
{
"name": "response_type",
"type": "ENUM",
"length": null,
"decimals": null,
"values": [
"code",
"token"
],
"allow_null": false,
"default": "code",
"comment": "The response type",
"unsigned": false,
"zerofill": false,
"auto_increment": false,
"binary": false
}
]
},
"2": {
"method": "changeColumn",
"params": [
"core_admin_permission_rows",
"row_id",
{
"name": "row_id",
"type": "BIGINT",
"length": 20,
"decimals": null,
"values": [],
"allow_null": false,
"default": "0",
"comment": "",
"unsigned": false,
"zerofill": false,
"auto_increment": false,
"binary": false
}
]
}
}
@@ -0,0 +1,178 @@
<?php
/**
* @brief 4.3.4 Upgrade Code
* @author <a href='https://www.invisioncommunity.com'>Invision Power Services, Inc.</a>
* @copyright (c) Invision Power Services, Inc.
* @license https://www.invisioncommunity.com/legal/standards/
* @package Invision Community
* @since 05 Jun 2018
*/
namespace IPS\core\setup\upg_103021;
/* To prevent PHP errors (extending class does not exist) revealing path */
if ( !defined( '\IPS\SUITE_UNIQUE_KEY' ) )
{
header( ( isset( $_SERVER['SERVER_PROTOCOL'] ) ? $_SERVER['SERVER_PROTOCOL'] : 'HTTP/1.0' ) . ' 403 Forbidden' );
exit;
}
/**
* 4.3.4 Upgrade Code
*/
class _Upgrade
{
/**
* Only truncate search index if ! CiC
*
* @return array If returns TRUE, upgrader will proceed to next step. If it returns any other value, it will set this as the value of the 'extra' GET parameter and rerun this step (useful for loops)
*/
public function step1()
{
/* Discussed with Charles, and CIC accounts can run these queries fast and it takes more resources to rebuild the index afterwards en-masse */
if ( ! \IPS\CIC )
{
\IPS\Db::i()->delete( 'core_search_index' );
}
$json = <<<EOF
[
{
"method": "changeIndex",
"params": [
"core_search_index",
"index_date_updated",
{
"type": "key",
"name": "index_date_updated",
"columns": [
"index_date_updated",
"index_date_commented"
],
"length": [
null,
null
]
}
]
},
{
"method": "changeIndex",
"params": [
"core_search_index",
"index_date_created",
{
"type": "key",
"name": "index_date_created",
"columns": [
"index_date_created",
"index_date_commented"
],
"length": [
null,
null
]
}
]
},
{
"method": "changeIndex",
"params": [
"core_search_index",
"author_lookup",
{
"type": "key",
"name": "author_lookup",
"columns": [
"index_author",
"index_class",
"index_hidden",
"index_date_updated",
"index_date_commented"
],
"length": [
null,
250,
null,
null,
null
]
}
]
},
{
"method": "addIndex",
"params": [
"core_search_index",
{
"type": "key",
"name": "index_item_author",
"columns": [
"index_item_author",
"index_date_commented"
],
"length": [
null,
null
]
}
]
},
{
"method": "changeIndex",
"params": [
"core_search_index",
"index_date_commented",
{
"type": "key",
"name": "index_date_commented",
"columns": [
"index_date_commented",
"index_date_updated"
],
"length": [
null,
null
]
}
]
}
]
EOF;
$queries = json_decode( $json, TRUE );
foreach( $queries as $query )
{
try
{
$run = call_user_func_array( array( \IPS\Db::i(), $query['method'] ), $query['params'] );
}
catch( \IPS\Db\Exception $e )
{
if( !in_array( $e->getCode(), array( 1007, 1008, 1050, 1060, 1061, 1062, 1091, 1051 ) ) )
{
throw $e;
}
}
}
return TRUE;
}
/**
* Finish step
*
* @return array If returns TRUE, upgrader will proceed to next step. If it returns any other value, it will set this as the value of the 'extra' GET parameter and rerun this step (useful for loops)
*/
public function finish()
{
if( ! \IPS\CIC AND isset( \IPS\Settings::i()->search_method ) AND \IPS\Settings::i()->search_method == 'mysql' )
{
\IPS\Content\Search\Index::i()->rebuild();
}
return TRUE;
}
}
@@ -0,0 +1,23 @@
{
"1": {
"method": "changeColumn",
"params": [
"core_plugins",
"plugin_enabled",
{
"name": "plugin_enabled",
"type": "TINYINT",
"length": 1,
"decimals": null,
"values": [],
"allow_null": false,
"default": "1",
"comment": "Plugin is enabled?",
"unsigned": false,
"zerofill": false,
"auto_increment": false,
"binary": false
}
]
}
}
@@ -0,0 +1,63 @@
<?php
/**
* @brief 4.3.6 Beta 1 Upgrade Code
* @author <a href='https://www.invisioncommunity.com'>Invision Power Services, Inc.</a>
* @copyright (c) Invision Power Services, Inc.
* @license https://www.invisioncommunity.com/legal/standards/
* @package Invision Community
* @since 01 Aug 2018
*/
namespace IPS\core\setup\upg_103033;
/* To prevent PHP errors (extending class does not exist) revealing path */
if ( !defined( '\IPS\SUITE_UNIQUE_KEY' ) )
{
header( ( isset( $_SERVER['SERVER_PROTOCOL'] ) ? $_SERVER['SERVER_PROTOCOL'] : 'HTTP/1.0' ) . ' 403 Forbidden' );
exit;
}
/**
* 4.3.6 Beta 1 Upgrade Code
*/
class _Upgrade
{
/**
* Step 1
* Remove announcement widgets
*
* @return bool
*/
public function step1()
{
foreach( \IPS\Db::i()->select( 'id, widgets', 'core_widget_areas', array( "widgets LIKE CONCAT( '%', ?, '%' )", 'announcements' ) )->setKeyField('id')->setValueField( 'widgets' ) as $id => $config )
{
$json = json_decode( $config, TRUE );
foreach( $json as $key => $value )
{
if( $value['key'] == 'announcements' AND $value['app'] == 'core' )
{
unset( $json[ $key ] );
}
}
\IPS\Db::i()->update( 'core_widget_areas', array( 'widgets' => json_encode( $json ) ), array( 'id=?', $id ) );
}
\IPS\Db::i()->delete( 'core_widgets', array( 'app=? AND `key`=?', 'core', 'announcements' ) );
return TRUE;
}
/**
* Custom title for this step
*
* @return string
*/
public function step1CustomTitle()
{
return "Removing announcement widgets";
}
}
@@ -0,0 +1,23 @@
{
"1": {
"method": "changeColumn",
"params": [
"core_queue",
"data",
{
"name": "data",
"type": "MEDIUMTEXT",
"length": 0,
"decimals": null,
"values": [],
"allow_null": false,
"default": "",
"comment": "",
"unsigned": false,
"zerofill": false,
"auto_increment": false,
"binary": false
}
]
}
}
@@ -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'] );
}
}