Version 5.0.13
This commit is contained in:
1 parent
b89858b2ff
commit
5efe744c5f
1407 files changed
+69690
-30177
No files matched your search
@@ -11,8 +11,11 @@
|
||||
|
||||
namespace IPS\cms\widgets;
|
||||
|
||||
use Error;
|
||||
use Exception;
|
||||
use IPS\Application\Module;
|
||||
use IPS\Data\Store;
|
||||
use IPS\Dispatcher;
|
||||
use IPS\Helpers\Form;
|
||||
use IPS\Http\Url;
|
||||
use IPS\Log;
|
||||
@@ -46,6 +49,18 @@ class Codemirror extends Widget
|
||||
|
||||
public bool $allowNoBox = true;
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*
|
||||
* @param array|string $app Application key (core,cms,gallery, etc)
|
||||
* @return bool
|
||||
*/
|
||||
public function isExecutableByApp( array|string $app ): bool
|
||||
{
|
||||
$module = Module::get( 'core', 'customization', 'admin' );
|
||||
return Dispatcher::i()->checkAcpPermission( 'theme_sets_manage', 'core', $module, true );
|
||||
}
|
||||
|
||||
/**
|
||||
* Specify widget configuration
|
||||
*
|
||||
@@ -102,6 +117,9 @@ class Codemirror extends Widget
|
||||
unset( Store::i()->$functionName );
|
||||
}
|
||||
|
||||
/* Escape ${ */
|
||||
$values['content'] = preg_replace('/(?<!\\\\)\$\{/', '\\\${', $values['content'] );
|
||||
|
||||
return $values;
|
||||
}
|
||||
|
||||
@@ -141,7 +159,7 @@ class Codemirror extends Widget
|
||||
Output::i()->jsFiles = array_merge( Output::i()->jsFiles, Output::i()->js( 'front_core.js', 'core' ) );
|
||||
return $this->output( $themeFunction() );
|
||||
}
|
||||
catch( Exception $e )
|
||||
catch( Error | Exception $e )
|
||||
{
|
||||
Log::log( $e->getMessage(), 'codeblock' );
|
||||
return "";
|
||||
|
||||
Reference in new issue
Block a user