Version 4.7.6

This commit is contained in:
Neo committed 2025-12-19 16:05:19 -08:00
1 parent 8ba7d43898
commit 7b7404e741
1085 files changed
+30590 -7837

No files matched your search

+27 -1
View File
@@ -6,7 +6,9 @@
* @package Invision Community
* @subpackage Calendar
* @since 18 Dec 2013
* @version
* @version
* @todo support for google maps as well as mapbox
* @todo Only request location info when search box is focused.
*/
namespace IPS\calendar;
@@ -203,4 +205,28 @@ class _Application extends \IPS\Application
]
],parent::getWebhooks());
}
/**
* Perform some legacy URL parameter conversions
*
* @return void
*/
public function convertLegacyParameters()
{
$url = \IPS\Request::i()->url();
$baseUrl = parse_url( \IPS\Settings::i()->base_url );
/* We want to match /calendar/ if IC is not installed inside a directory, or if it is, the /path/calendar/ exactly */
$strToCheck = ( ! empty( trim( $baseUrl['path'], '/' ) ) ) ? '/' . trim( $baseUrl['path'], '/' ) . '/calendar/' : '/calendar/';
// once we use php8, we can use str_starts_with, right now here's the hacky way with substr
if( \mb_substr($url->data[ \IPS\Http\Url::COMPONENT_PATH ], 0, \mb_strlen($strToCheck)) === $strToCheck )
{
$newPath = str_replace( '/calendar/', '/events/', $url->data[ \IPS\Http\Url::COMPONENT_PATH ] );
$url = $url->setPath( $newPath );
\IPS\Output::i()->redirect( $url, NULL, 301 );
}
}
}