Version 4.5.0
This commit is contained in:
1 parent
1a0c7fd3c2
commit
f79dcf067a
3791 files changed
+248032
-76372
No files matched your search
@@ -12,7 +12,7 @@
|
||||
namespace IPS\cms\setup\upg_100010;
|
||||
|
||||
/* 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;
|
||||
@@ -78,7 +78,7 @@ class _Upgrade
|
||||
{
|
||||
$updates = array();
|
||||
|
||||
if( !is_numeric( $db['database_field_title'] ) or !is_numeric( $db['database_field_content'] ) )
|
||||
if( !\is_numeric( $db['database_field_title'] ) or !\is_numeric( $db['database_field_content'] ) )
|
||||
{
|
||||
$definition = \IPS\Db::i()->getTableDefinition( 'cms_custom_database_' . $db['database_id'] );
|
||||
$fields = array();
|
||||
@@ -93,12 +93,12 @@ class _Upgrade
|
||||
}
|
||||
|
||||
/* Do we need to reset the title field, i.e. if it was mapped to primary_id_field? */
|
||||
if( !is_numeric( $db['database_field_title'] ) AND count( $fields ) )
|
||||
if( !\is_numeric( $db['database_field_title'] ) AND \count( $fields ) )
|
||||
{
|
||||
$updates['database_field_title'] = $fields[0];
|
||||
|
||||
/* If there are other fields to use, remove this one from the array */
|
||||
if( count( $fields ) > 1 )
|
||||
if( \count( $fields ) > 1 )
|
||||
{
|
||||
unset( $fields[0] );
|
||||
}
|
||||
@@ -113,14 +113,14 @@ class _Upgrade
|
||||
}
|
||||
|
||||
/* Do we need to reset the content field, i.e. if it was mapped to primary_id_field? */
|
||||
if( !is_numeric( $db['database_field_content'] ) AND count( $fields ) )
|
||||
if( !\is_numeric( $db['database_field_content'] ) AND \count( $fields ) )
|
||||
{
|
||||
$updates['database_field_content'] = array_shift( $fields );
|
||||
}
|
||||
}
|
||||
|
||||
/* If we have any changes, store them */
|
||||
if( count( $updates ) )
|
||||
if( \count( $updates ) )
|
||||
{
|
||||
\IPS\Db::i()->update( 'cms_databases', $updates, array( 'database_id=?', $db['database_id'] ) );
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user