Version 4.1.19

This commit is contained in:
Neo committed 2025-12-19 05:38:56 -08:00
1 parent 28bd025b35
commit 2bd5025018
2674 files changed
+233518 -77766

No files matched your search

+15 -19
View File
@@ -2,9 +2,9 @@
/**
* @brief IN_DEV Skin Set
* @author <a href='http://www.invisionpower.com'>Invision Power Services, Inc.</a>
* @copyright (c) 2001 - SVN_YYYY Invision Power Services, Inc.
* @copyright (c) 2001 - 2016 Invision Power Services, Inc.
* @license http://www.invisionpower.com/legal/standards/
* @package IPS Social Suite
* @package IPS Community Suite
* @since 16 Apr 2013
* @version SVN_VERSION_NUMBER
*/
@@ -126,7 +126,7 @@ class _Theme extends \IPS\Theme
if ( !isset( $this->templates[ $app ][ $location ][ $group ] ) )
{
$class = 'Template';
if ( isset( \IPS\IPS::$hooks[ "\IPS\Theme\class_{$app}_{$location}_{$group}" ] ) )
if ( isset( \IPS\IPS::$hooks[ "\IPS\Theme\class_{$app}_{$location}_{$group}" ] ) AND \IPS\RECOVERY_MODE === FALSE )
{
foreach ( \IPS\IPS::$hooks[ "\IPS\Theme\class_{$app}_{$location}_{$group}" ] as $id => $data )
{
@@ -226,7 +226,7 @@ class _Theme extends \IPS\Theme
{
foreach ( new \GlobIterator( \IPS\ROOT_PATH . '/plugins/' . $plugin->location . '/dev/css/*' ) as $file )
{
$return[] = str_replace( \IPS\ROOT_PATH, rtrim( \IPS\Settings::i()->base_url, '/' ), $file );
$return[] = str_replace( array( 'http://', 'https://' ), '//', \IPS\Settings::i()->base_url ) . "applications/core/interface/css/css.php?css=" . 'plugins/' . $plugin->location . '/dev/css/' . $file->getFilename();
}
}
}
@@ -307,7 +307,7 @@ class _Theme extends \IPS\Theme
* @param string $path Path to resource
* @param string|null $app Application key
* @param string|null $location Location
* @return string URL to resource
* @return \IPS\Http\Url|NULL URL to resource
*/
public function resource( $path, $app=NULL, $location=NULL, $noProtocol=FALSE )
{
@@ -320,10 +320,10 @@ class _Theme extends \IPS\Theme
return \IPS\Settings::i()->base_url . "/applications/{$app}/interface/{$path}";
}
$url = $baseUrl . str_replace( \IPS\ROOT_PATH . '/', '', static::_getResourcePath( $app, $location, $path ) );
if( $noProtocol )
$url = \IPS\Http\Url::createFromString( $baseUrl . str_replace( \IPS\ROOT_PATH . '/', '', static::_getResourcePath( $app, $location, $path ) ), false );
if( $noProtocol and $url instanceof \IPS\Http\Url )
{
$url = str_replace( array( 'http://', 'https://' ), '//', $url );
$url = $url->setScheme(NULL);
}
return $url;
}
@@ -408,7 +408,7 @@ class _Theme extends \IPS\Theme
{
if ( isset( $currentTemplates[ $app ][ $location->getFilename() ][ $group->getFilename() ][ $name ] ) )
{
if ( md5( trim( $currentTemplates[ $app ][ $location->getFilename() ][ $group->getFilename() ][ $name ]['template_content'] ) ) == md5( trim( $html ) ) )
if( \IPS\Login::compareHashes( md5( trim( $html ) ), md5( trim( $currentTemplates[ $app ][ $location->getFilename() ][ $group->getFilename() ][ $name ]['template_content'] ) ) ) )
{
/* No change */
continue;
@@ -585,7 +585,7 @@ class _Theme extends \IPS\Theme
$css = str_replace( '/* No Content */', '', $css );
if ( isset( $currentCss[ $app ][ $location ][ $finalPath ][ $file->getFilename() ] ) )
{
if ( md5( trim( $currentCss[ $app ][ $location ][ $finalPath ][ $file->getFilename() ]['css_content'] ) ) == md5( trim( $css ) ) )
if( \IPS\Login::compareHashes( md5( trim( $css ) ), md5( trim( $currentCss[ $app ][ $location ][ $finalPath ][ $file->getFilename() ]['css_content'] ) ) ) )
{
/* No change */
continue;
@@ -720,7 +720,7 @@ class _Theme extends \IPS\Theme
/* files larger than 1.5mb don't base64_encode() as they may not get stored in the resources_data column */
if ( filesize( $root . $path . $file->getFilename() ) > ( 1.5 * 1024 * 1024 ) )
{
\IPS\Log::i( LOG_INFO )->write( $root . $path . $file->getFilename() . " too large to import", 'designers_mode_import' );
\IPS\Log::log( $root . $path . $file->getFilename() . " too large to import", 'designers_mode_import' );
continue;
}
@@ -728,7 +728,7 @@ class _Theme extends \IPS\Theme
if ( ! base64_encode( $content ) )
{
\IPS\Log::i( LOG_INFO )->write( $root . $path . $file->getFilename() . " could not be saved correctly", 'designers_mode_import' );
\IPS\Log::log( $root . $path . $file->getFilename() . " could not be saved correctly", 'designers_mode_import' );
continue;
}
@@ -736,7 +736,7 @@ class _Theme extends \IPS\Theme
$name = self::makeBuiltTemplateLookupHash($app, $location, $path) . '_' . $file->getFilename();
$fileName = (string) \IPS\File::create( 'core_Theme', $name, $content, 'set_resources_' . ( $id == 0 ? 1 : $id ) );
if ( ! isset( $master[ $file->getFilename() ] ) or $master[ $file->getFilename() ] != md5( $content ) )
if ( ! isset( $master[ $file->getFilename() ] ) or !\IPS\Login::compareHashes( md5( $content ), $master[ $file->getFilename() ] ) )
{
$custom = 1;
}
@@ -1086,14 +1086,11 @@ class _Theme extends \IPS\Theme
\IPS\Db::i()->select(
'sv.*, core_theme_settings_fields.*',
'core_theme_settings_fields',
array( 'sc_set_id=?', 1 ),
NULL,
NULL,
'sc_key'
array( 'sc_set_id=?', 1 )
)->join(
array('core_theme_settings_values', 'sv'),
'sv.sv_id=core_theme_settings_fields.sc_id'
) as $row
)->setKeyField('sc_key') as $row
)
{
$row['sc_default'] = ( $row['sv_value'] ) ? $row['sv_value'] : $row['sc_default'];
@@ -1102,7 +1099,6 @@ class _Theme extends \IPS\Theme
$data[ $row['sc_app'] ][] = $row;
}
foreach( $data as $app => $json )
{
$file = \IPS\ROOT_PATH . "/applications/{$app}/data/themesettings.json";