Version 4.7.6
This commit is contained in:
1 parent
8ba7d43898
commit
7b7404e741
1085 files changed
+30590
-7837
No files matched your search
@@ -843,14 +843,28 @@ class _LegacyParser
|
||||
$attachment = array( 'attach_is_image' => 0, 'attach_location' => '' );
|
||||
}
|
||||
|
||||
$url = \IPS\Http\Url::baseUrl( \IPS\Http\Url::PROTOCOL_RELATIVE ) . "applications/core/interface/file/attachment.php?id=" . $attachment['attach_id'];
|
||||
if ( $attachment['attach_security_key'] )
|
||||
{
|
||||
$url .= "&key={$attachment['attach_security_key']}";
|
||||
}
|
||||
|
||||
if( $attachment['attach_is_image'] )
|
||||
{
|
||||
$attachment['attach_thumb_location'] = $attachment['attach_thumb_location'] ?: $attachment['attach_location'];
|
||||
$return = "<a class='ipsAttachLink ipsAttachLink_image' href='{fileStore.core_Attachment}/{$attachment['attach_location']}'><img src='{fileStore.core_Attachment}/{$attachment['attach_thumb_location']}' data-fileid='" . \IPS\Settings::i()->base_url . "applications/core/interface/file/attachment.php?id={$attachment['attach_id']}' class='ipsImage ipsImage_thumbnailed'></a>";
|
||||
}
|
||||
elseif( \in_array( $attachment['attach_ext'], \IPS\File::$videoExtensions ) )
|
||||
{
|
||||
$return = \IPS\Theme::i()->getTemplate( 'editor', 'core', 'global' )->attachedVideo( $attachment['attach_location'], $url, $attachment['attach_file'], \IPS\File::getMimeType( $attachment['attach_file'] ), $attachment['attach_id'] );
|
||||
}
|
||||
elseif( \in_array( $attachment['attach_ext'], \IPS\File::$audioExtensions ) )
|
||||
{
|
||||
$return = \IPS\Theme::i()->getTemplate( 'editor', 'core', 'global' )->attachedAudio( $attachment['attach_location'], $url, $attachment['attach_file'], \IPS\File::getMimeType( $attachment['attach_file'] ), $attachment['attach_id'] );
|
||||
}
|
||||
else
|
||||
{
|
||||
$return = $attachment['attach_location'] ? "<a href='" . \IPS\Settings::i()->base_url . "applications/core/interface/file/attachment.php?id={$attachment['attach_id']}'>{$attachment['attach_file']}</a>" : '';
|
||||
$return = $attachment['attach_location'] ? "<a href='{$url}'>{$attachment['attach_file']}</a>" : '';
|
||||
}
|
||||
|
||||
return $return;
|
||||
|
||||
@@ -1254,7 +1254,7 @@ class _Parser
|
||||
/* If we have any acronyms, they also need to be breakpoints */
|
||||
if ( \count( $this->caseSensitiveAcronyms ) or \count( $this->caseInsensitiveAcronyms ) )
|
||||
{
|
||||
$breakPoints[] = '((?=<^|\b)(?:' . implode( '|', array_merge( array_map( function ( $value ) { return preg_quote( $value, '/' ); }, array_keys( $this->caseSensitiveAcronyms ) ), array_map( function ( $value ) { return preg_quote( $value, '/' ); }, array_keys( $this->caseInsensitiveAcronyms ) ) ) ) . ')(?=\b|$))';
|
||||
$breakPoints[] = '((?=<^|\b|\W)(?:' . implode( '|', array_merge( array_map( function ( $value ) { return preg_quote( $value, '/' ); }, array_keys( $this->caseSensitiveAcronyms ) ), array_map( function ( $value ) { return preg_quote( $value, '/' ); }, array_keys( $this->caseInsensitiveAcronyms ) ) ) ) . ')(?=\b|\W|$))';
|
||||
}
|
||||
|
||||
/* Loop through each section */
|
||||
@@ -1927,10 +1927,13 @@ class _Parser
|
||||
/* Or an attachment? */
|
||||
elseif ( $attachment = static::_getAttachment( $element->getAttribute($srcAttribute ), $element->hasAttribute('data-fileid') ? $element->getAttribute('data-fileid') : NULL ) )
|
||||
{
|
||||
$file = $this->_getFile( 'core_Attachment', $element->getAttribute( $srcAttribute ) );
|
||||
|
||||
$element->setAttribute( 'data-fileid', $attachment['attach_id'] );
|
||||
$element->setAttribute( 'src', str_replace( array( 'http:', 'https:' ), '', str_replace( static::$fileObjectClasses['core_Attachment']->baseUrl(), '{fileStore.core_Attachment}', $element->getAttribute( $srcAttribute ) ) ) );
|
||||
|
||||
if ( ! empty( $attachment['attach_labels'] ) and $labels = static::getAttachmentLabels( $attachment ) )
|
||||
|
||||
if ( ( !$element->hasAttribute('alt') or $element->getAttribute('alt') == $file->filename ) and ! empty( $attachment['attach_labels'] ) and $labels = static::getAttachmentLabels( $attachment ) )
|
||||
{
|
||||
if ( \count( $labels ) )
|
||||
{
|
||||
@@ -2285,12 +2288,6 @@ class _Parser
|
||||
{
|
||||
$rels = array();
|
||||
|
||||
/* norewrite */
|
||||
if ( \IPS\Settings::i()->viglink_norewrite and $this->member->inGroup( explode( ',', \IPS\Settings::i()->viglink_norewrite ) ) )
|
||||
{
|
||||
$rels[] = 'norewrite';
|
||||
}
|
||||
|
||||
/* We add external/nofollow rel attributes for non-internal non-local links */
|
||||
if ( !( $url instanceof \IPS\Http\Url\Internal ) )
|
||||
{
|
||||
|
||||
Reference in new issue
Block a user