Version 5.0.6

This commit is contained in:
Neo committed 2025-12-19 18:55:49 -08:00
1 parent a3a4a9ccbd
commit b89858b2ff
1214 files changed
+92828 -14859

No files matched your search

+23 -2
View File
@@ -38,6 +38,7 @@ use IPS\Theme;
use IPS\Xml\SimpleXML;
use OutOfBoundsException;
use UnderflowException;
use UnexpectedValueException;
use function count;
use function defined;
use function file_get_contents;
@@ -45,6 +46,8 @@ use function in_array;
use function is_array;
use function is_null;
use function is_string;
use function md5;
use function session_id;
use function strlen;
use const IPS\ROOT_PATH;
@@ -140,6 +143,9 @@ class Editor extends FormAbstract
"external_video",
'og_embed',
"raw_embed",
'native_emoji',
'custom_emoji',
'fa_icons'
];
/**
@@ -296,9 +302,13 @@ class Editor extends FormAbstract
which creates a discrepency between wheat displays in a post and what displays in the editor */
// $value = preg_replace( '/<p>\s*<\/p>/', '', $value );
/* It is possible that the autosave key was updated, so we make doubly sure the uploader's post key matches our own */
$finalPostKey = md5( $this->options['autoSaveKey'] . ':' . session_id() );
/* Show full uploader */
if ( $this->uploader )
{
$this->uploader->options['postKey'] = $finalPostKey;
$attachmentArea = $this->uploader->html();
}
/* Or show a loading icon where the uploader will go if the editor is minimized */
@@ -320,7 +330,7 @@ class Editor extends FormAbstract
/* Or if the user can't attach, just show a bar */
else
{
$attachmentArea = Theme::i()->getTemplate( 'forms', 'core', 'global' )->editorAttachmentsPlaceholder( $this->name, $this->postKey, $this->noUploaderError, $this->canUseMediaExtension() );
$attachmentArea = Theme::i()->getTemplate( 'forms', 'core', 'global' )->editorAttachmentsPlaceholder( $this->name, $finalPostKey, $this->noUploaderError, $this->canUseMediaExtension() );
}
if ( Member::loggedIn()->group['g_bypass_badwords'] )
@@ -1000,7 +1010,18 @@ class Editor extends FormAbstract
$editorFile = Application::getRootPath( $app->directory ) . "/applications/" . $app->directory . "/data/editor.xml";
if( file_exists( $editorFile ) )
{
$xml = SimpleXML::loadFile( $editorFile );
try
{
$xml = SimpleXML::loadFile( $editorFile );
if ( !isset( $xml->plugin ) or !is_iterable( $xml->plugin ) )
{
throw new UnexpectedValueException;
}
}
catch ( Exception $e )
{
continue;
}
foreach( $xml->plugin as $plugin )
{
$contents = (string) $plugin;