Version 4.1.19

This commit is contained in:
Neo committed 2025-12-19 05:38:56 -08:00
1 parent 28bd025b35
commit 2bd5025018
2674 files changed
+233518 -77766

No files matched your search

+17 -10
View File
@@ -2,9 +2,9 @@
/**
* @brief Magic Template Class for IN_DEV mode
* @author <a href='http://www.invisionpower.com'>Invision Power Services, Inc.</a>
* @copyright (c) 2001 - SVN_YYYY Invision Power Services, Inc.
* @copyright (c) 2001 - 2016 Invision Power Services, Inc.
* @license http://www.invisionpower.com/legal/standards/
* @package IPS Social Suite
* @package IPS Community Suite
* @since 18 Feb 2013
* @version SVN_VERSION_NUMBER
*/
@@ -82,24 +82,31 @@ class _Template extends \IPS\Theme\Template
$file = $this->sourceFolder . $bit . '.phtml';
}
/* Get the content */
/* Get the content or return an BadMethodCallException if the template doesn't exist */
if ( $file === NULL or !file_exists( $file ) )
{
throw new \BadMethodCallException( 'NO_TEMPLATE_FILE - ' . $file );
if ( !$file AND $this->sourceFolder === \IPS\ROOT_PATH . '/plugins' )
{
throw new \BadMethodCallException( 'NO_PLUGIN_TEMPLATE_FILE - ' . $bit );
}
else
{
throw new \BadMethodCallException( 'NO_TEMPLATE_FILE - ' . $file );
}
}
$output = file_get_contents( $file );
/* Parse the header tag */
if ( !preg_match( '/^<ips:template parameters="(.+?)?" \/>(\r\n?|(\r\n?|\n))/', $output, $matches ) )
if ( !preg_match( '/^<ips:template parameters="(.+?)?"(\s+)?\/>(\r\n?|(\r\n?|\n))/', $output, $matches ) )
{
throw new \BadMethodCallException( 'NO_HEADER - ' . $file );
}
/* Strip it */
$output = preg_replace( '/^<ips:template parameters="(.+?)?" \/>(\r\n?|\n)/', '', $output );
if ( \IPS\DEV_DEBUG_TEMPLATES )
$output = preg_replace( '/^<ips:template parameters="(.+?)?"(\s+)?\/>(\r\n?|\n)/', '', $output );
if ( \IPS\DEBUG_TEMPLATES and ! \IPS\Request::i()->isAjax() )
{
$output = "<!-- " . $functionName . " -->" . $output;
}
@@ -125,7 +132,7 @@ class _Template extends \IPS\Theme\Template
$allowedScriptBlocks = array(
'globalTemplate', 'blankTemplate', 'loginTemplate', 'includeJS', 'dashboard',
'onlineUsers', 'registrations', 'viglink', 'linkedin', 'reddit', 'poll',
'giftvoucherPrint', 'packingLabel', 'packingSheet'
'giftvoucherPrint', 'packingLabel', 'packingSheet', 'streamWrapper', 'embedExternal'
);
/* Check we're not being naughty */
@@ -137,7 +144,7 @@ class _Template extends \IPS\Theme\Template
{
// trigger_error( "There is a style block in {$functionName}. Please move all styling into CSS files.", E_USER_ERROR );
}
if( preg_match( "/<.+?\son(blur|change|click|contextmenu|copy|cut|dblclick|error|focus|focusin|focusout|hashchange|keydown|keypress|keyup|load|mousedown|mouseenter|mouseleave|mousemove|mouseout|mouseover|mouseup|mousewheel|paste|reset|resize|scroll|select|submit|textinput|unload|wheel)=['\"].+?>/i", $output ) )
if( preg_match( '/<[^>]+?\son(blur|change|click|contextmenu|copy|cut|dblclick|error|focus|focusin|focusout|hashchange|keydown|keypress|keyup|load|mousedown|mouseenter|mouseleave|mousemove|mouseout|mouseover|mouseup|mousewheel|paste|reset|resize|scroll|select|submit|textinput|unload|wheel)=[\'\"].+?>/i', $output ) )
{
trigger_error( "There is a inline JavaScript {$functionName}. Please move all JavaScript into JS files.", E_USER_ERROR );
}