Version 5.0.13
This commit is contained in:
1 parent
b89858b2ff
commit
5efe744c5f
1407 files changed
+69690
-30177
No files matched your search
+12
-3
@@ -49,6 +49,7 @@ use IPS\Member;
|
||||
use IPS\Member\Club;
|
||||
use IPS\Node\Model;
|
||||
use IPS\Patterns\ActiveRecordIterator;
|
||||
use IPS\Platform\Bridge;
|
||||
use IPS\Request;
|
||||
use IPS\Settings;
|
||||
use IPS\Theme;
|
||||
@@ -135,11 +136,13 @@ class Parser
|
||||
|
||||
/**
|
||||
* @brief Rows from core_attachments_map containing attachments which belong to the content being edited - as they are found by the parser, they will be removed so we are left with attachments that have been removed
|
||||
* @var array<int,array> (array key is attachment ID, value is the row from core_attachments_map)
|
||||
*/
|
||||
public array $existingAttachments = array();
|
||||
|
||||
/**
|
||||
* @brief Attachment IDs
|
||||
* @var array<int> (array of attachment IDs that belong to the content being edited)
|
||||
*/
|
||||
public array $mappedAttachments = array();
|
||||
|
||||
@@ -165,11 +168,13 @@ class Parser
|
||||
|
||||
/**
|
||||
* @brief Case-sensitive Acronyms
|
||||
* @var array<string,array> (array key is the acronym, value is an array with 'a_long' and 'a_type' keys)
|
||||
*/
|
||||
public array $caseSensitiveAcronyms = array();
|
||||
|
||||
/**
|
||||
* @brief Case-insensitive Acronyms
|
||||
* @var array<string,array> (array key is the acronym in lowercase, value is an array with 'a_long' and 'a_type' keys)
|
||||
*/
|
||||
public array $caseInsensitiveAcronyms = array();
|
||||
|
||||
@@ -611,6 +616,7 @@ class Parser
|
||||
/* Attachments (set by _parseAElement, _parseImgElement and "insert existing attachment") - Gallery/Downloads use the full URL rather than an ID, hence Text */
|
||||
$def->addAttribute( 'a', 'data-fileid', new HtmlPurifierIntOrInternalLink() );
|
||||
$def->addAttribute( 'img', 'data-fileid', new HtmlPurifierIntOrInternalLink() );
|
||||
$def->addAttribute( 'img', 'data-full-image', 'Text' );
|
||||
$def->addAttribute( 'a', 'data-fileext', 'Text' );
|
||||
|
||||
/* Existing media (inserted with data-extension by the JS so that _getFile is able to locate) */
|
||||
@@ -690,6 +696,7 @@ class Parser
|
||||
'preload' => new HTMLPurifier_AttrDef_Enum( [ 'auto', 'metadata', 'none' ] ),
|
||||
'style' => 'Text'
|
||||
) );
|
||||
$def->addAttribute( 'video', 'data-video-preview-time', 'Number' );
|
||||
$def->addElement( 'source', 'Inline', 'Flow', 'Common', array(
|
||||
'src' => new HTMLPurifier_AttrDef_URI( TRUE ),
|
||||
'srcset' => new HtmlPurifierSrcsetDef( TRUE ),
|
||||
@@ -762,6 +769,8 @@ class Parser
|
||||
|
||||
/* Allow BR tags */
|
||||
$def->addElement( 'br', 'Inline', "Inline", "Common" );
|
||||
|
||||
Bridge::i()->parserModifyHTMLDefinintion( $def );
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -1135,7 +1144,7 @@ class Parser
|
||||
*
|
||||
* @param DOMElement $element The element from the source document to parse
|
||||
* @param DOMNode $parent The node from the new document which will be this node's parent
|
||||
* @param DOMParser $parser DOMParser Object
|
||||
* @param DOMParser $parser DOMParser Object
|
||||
* @return void
|
||||
*/
|
||||
public function _parseDomElement(DOMElement $element, DOMNode $parent, DOMParser $parser ) : void
|
||||
@@ -3164,7 +3173,7 @@ class Parser
|
||||
}
|
||||
|
||||
/* Loop through our content classes and see if we can find one that matches */
|
||||
foreach ( $application->extensions( 'core', 'ContentRouter' ) as $extension )
|
||||
foreach ( $application->extensions( 'core', 'ContentRouter', true, $member ) as $extension )
|
||||
{
|
||||
/* We need to check the class itself, along with owned nodes (Blogs, etc.) and anything else which isn't
|
||||
normally part of the content item system but the app wants to be embeddable (Commerce product reviews, etc) */
|
||||
@@ -3325,7 +3334,7 @@ class Parser
|
||||
/* If the URL is blacklisted, just return it */
|
||||
try
|
||||
{
|
||||
static::isAllowedContentUrl( $url );
|
||||
static::isAllowedContentUrl( $url instanceof Url ? (string) $url : $url );
|
||||
}
|
||||
catch( UnexpectedValueException $e )
|
||||
{
|
||||
|
||||
Reference in new issue
Block a user