Version 4.2.0

This commit is contained in:
Neo committed 2025-12-19 05:44:59 -08:00
1 parent 0dc2aee5ed
commit 96997ddd8e
2074 files changed
+125454 -55780

No files matched your search

+24 -8
View File
@@ -1,12 +1,11 @@
<?php
/**
* @brief Friendly URL
* @author <a href='http://www.invisionpower.com'>Invision Power Services, Inc.</a>
* @copyright (c) 2001 - 2016 Invision Power Services, Inc.
* @license http://www.invisionpower.com/legal/standards/
* @package IPS Community Suite
* @author <a href='https://www.invisioncommunity.com'>Invision Power Services, Inc.</a>
* @copyright (c) Invision Power Services, Inc.
* @license https://www.invisioncommunity.com/legal/standards/
* @package Invision Community
* @since 11 May 2015
* @version SVN_VERSION_NUMBER
*/
namespace IPS\Http\Url;
@@ -252,7 +251,19 @@ class _Friendly extends \IPS\Http\Url\Internal
}
}
}
/* And it also used to do index.php?/topic/123-example/?p=456 - with the double ? */
foreach ( $correctUrl->queryString as $k => $v )
{
if ( preg_match( '/^\/' . preg_quote( $correctUrl->friendlyUrlComponent, '/' ) . '\/\?(.+)$/', $k, $matches ) )
{
$correctUrl = $correctUrl->setQueryString( array(
$matches[0] => NULL,
$matches[1] => $v
) );
}
}
if ( (string) $correctUrl->normaliseForEqualityCheck() !== (string) $this->normaliseForEqualityCheck() )
{
return $correctUrl;
@@ -502,7 +513,7 @@ class _Friendly extends \IPS\Http\Url\Internal
$definitions = array();
foreach ( $data['pages'] as $k => $page )
{
$definitions[ $k ] = static::buildFurlDefinition( $page['friendly'], $page['real'], $topLevel, $app->default, isset( $page['alias'] ) ? $page['alias'] : NULL, FALSE, isset( $page['verify'] ) ? $page['verify'] : NULL );
$definitions[ $k ] = static::buildFurlDefinition( $page['friendly'], $page['real'], $topLevel, $app->default, isset( $page['alias'] ) ? $page['alias'] : NULL, FALSE, isset( $page['verify'] ) ? $page['verify'] : NULL, isset( $page['seoTitles'] ) ? $page['seoTitles'] : NULL );
}
/* Add it in */
@@ -527,9 +538,10 @@ class _Friendly extends \IPS\Http\Url\Internal
* @param NULL|string $alias Friendly URL alias
* @param bool $custom Flag to indicate if this is a custom FURL definition
* @param string $verify The name of a class that contains a loadFromUrl() and an url() method for verifying the friendly URL is correct
* @param array $seoTitles The class, query param and property to load from to rebuild seo titles
* @return array
*/
public static function buildFurlDefinition( $friendly, $real, $appTopLevel = NULL, $appIsDefault = FALSE, $alias = NULL, $custom = FALSE, $verify = NULL )
public static function buildFurlDefinition( $friendly, $real, $appTopLevel = NULL, $appIsDefault = FALSE, $alias = NULL, $custom = FALSE, $verify = NULL, $seoTitles = NULL )
{
/* Init */
$return = array(
@@ -544,6 +556,10 @@ class _Friendly extends \IPS\Http\Url\Internal
{
$return['custom'] = TRUE;
}
if ( $seoTitles )
{
$return['seoTitles'] = $seoTitles;
}
/* If it has a top-level (e.g. "/forums") we need to store the definition either with that if it's the default app, or
without it if it isn't, so that if the default app changes we can redirect accordingly */