Version 4.5.0

This commit is contained in:
Neo committed 2025-12-19 05:51:58 -08:00
1 parent 1a0c7fd3c2
commit f79dcf067a
3791 files changed
+248032 -76372

No files matched your search

+21 -4
View File
@@ -11,7 +11,7 @@
namespace IPS\Output\Plugin;
/* To prevent PHP errors (extending class does not exist) revealing path */
if ( !defined( '\IPS\SUITE_UNIQUE_KEY' ) )
if ( !\defined( '\IPS\SUITE_UNIQUE_KEY' ) )
{
header( ( isset( $_SERVER['SERVER_PROTOCOL'] ) ? $_SERVER['SERVER_PROTOCOL'] : 'HTTP/1.0' ) . ' 403 Forbidden' );
exit;
@@ -43,7 +43,7 @@ class _Url
$csrf = ' . "&csrfKey=" . \IPS\Session::i()->csrfKey';
}
$location = ( in_array( 'base', array_keys( $options ) ) ) ? '"' . $options['base'] . '"' : 'null';
$location = ( \in_array( 'base', array_keys( $options ) ) ) ? '"' . $options['base'] . '"' : 'null';
if ( !isset( $options['seoTemplate'] ) )
{
@@ -70,11 +70,28 @@ class _Url
$fragment = "->setFragment(\"{$options['fragment']}\")";
}
$ref = '';
if ( isset( $options['ref'] ) )
{
/* Is this a variable or other dynamic thing? */
if ( \in_array( \substr( $options['ref'], 0, 1 ), array( '(', '$', '\\' ) ) )
{
$ref = "->addRef(";
$ref .= $options['ref'];
$ref .= ")";
}
else
{
/* It's not - just a normal string */
$ref = "->addRef(\"{$options['ref']}\")";
}
}
$_data = mb_substr( $data, 0, 1 ) == '$' ? $data : "\"$data\"";
if ( isset( $options['plain'] ) )
{
$url = "\IPS\Http\Url::internal( {$_data}{$csrf}, {$location}, \"{$options['seoTemplate']}\", {$options['seoTitles']}, {$options['protocol']} )".$fragment;
$url = "\IPS\Http\Url::internal( {$_data}{$csrf}, {$location}, \"{$options['seoTemplate']}\", {$options['seoTitles']}, {$options['protocol']} )".$fragment.$ref;
}
elseif ( isset( $options['ips'] ) )
{
@@ -82,7 +99,7 @@ class _Url
}
else
{
$url = "str_replace( '&', '&', \IPS\Http\Url::internal( {$_data}{$csrf}, {$location}, \"{$options['seoTemplate']}\", {$options['seoTitles']}, {$options['protocol']} ){$fragment} )";
$url = "htmlspecialchars( \IPS\Http\Url::internal( {$_data}{$csrf}, {$location}, \"{$options['seoTemplate']}\", {$options['seoTitles']}, {$options['protocol']} ){$fragment}{$ref}, ENT_QUOTES | ENT_DISALLOWED, 'UTF-8', TRUE )";
}
if( isset( $options['noprotocol'] ) AND $options['noprotocol'] )