Version 4.5.0

This commit is contained in:
Neo committed 2025-12-19 05:51:58 -08:00
1 parent 1a0c7fd3c2
commit f79dcf067a
3791 files changed
+248032 -76372

No files matched your search

+10 -6
View File
@@ -26,7 +26,7 @@ if( strstr( \IPS\Request::i()->css, ',' ) )
continue;
}
$css = str_replace( '../', '../', $css );
$css = str_replace( array( '../', '..\\' ), array( '../', '..\\' ), $css );
$file = file_get_contents( \IPS\ROOT_PATH . '/' . $css );
$params = processFile( $file );
@@ -50,7 +50,7 @@ else
exit();
}
$contents = file_get_contents( \IPS\ROOT_PATH . '/' . str_replace( '../', '../', \IPS\Request::i()->css ) );
$contents = file_get_contents( \IPS\ROOT_PATH . '/' . str_replace( array( '../', '..\\' ), array( '../', '..\\' ), \IPS\Request::i()->css ) );
$params = processFile( $contents );
@@ -84,6 +84,10 @@ if ( $needsParsing )
$functionName = 'css_' . mt_rand();
$contents = str_replace( '\\', '\\\\', $contents );
/* If we have something like `{expression="\IPS\SOME_CONSTANT"}` we cannot double escape it, however we do need to escape font icons and similar. */
$contents = preg_replace_callback( "/{expression=\"(.+?)\"}/ms", function( $matches ) {
return '{expression="' . str_replace( '\\\\', '\\', $matches[1] ) . '"}';
}, $contents );
\IPS\Theme::makeProcessFunction( $contents, $functionName );
$functionName = "IPS\Theme\\{$functionName}";
@@ -105,12 +109,12 @@ function needsParsing( $fileName )
{
preg_match( '#applications/(.+?)/dev/css/(.+?)/(.*)\.css#', $fileName, $appMatches );
preg_match( '#plugins/(.+?)/dev/css/(.*)\.css#', $fileName, $pluginMatches );
return (bool) ( count( $appMatches ) or count( $pluginMatches ) );
return (bool) ( \count( $appMatches ) or \count( $pluginMatches ) );
}
else
{
preg_match( '#themes/(?:\d+)/css/(.+?)/(.+?)/(.*)\.css#', $fileName, $themeMatches );
return count( $themeMatches );
return \count( $themeMatches );
}
return FALSE;
@@ -142,10 +146,10 @@ function processFile( $contents )
$return['app'] = trim( $attr[2] );
break;
case 'position':
$return['pos'] = intval( $attr[2] );
$return['pos'] = \intval( $attr[2] );
break;
case 'hidden':
$return['hidden'] = intval( $attr[2] );
$return['hidden'] = \intval( $attr[2] );
break;
}
}