Version 4.2.0
This commit is contained in:
1 parent
0dc2aee5ed
commit
96997ddd8e
2074 files changed
+125454
-55780
No files matched your search
@@ -1,12 +1,11 @@
|
||||
<?php
|
||||
/**
|
||||
* @brief URL Exception
|
||||
* @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 12 May 2015
|
||||
* @version SVN_VERSION_NUMBER
|
||||
*/
|
||||
|
||||
namespace IPS\Http\Url;
|
||||
|
||||
@@ -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 */
|
||||
|
||||
@@ -1,12 +1,11 @@
|
||||
<?php
|
||||
/**
|
||||
* @brief Internal 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;
|
||||
@@ -174,7 +173,7 @@ class _Internal extends \IPS\Http\Url
|
||||
/* Check the currently logged in user can view it, as we don't want to reveal the correct
|
||||
URL to something the user has no permission to view */
|
||||
$canView = TRUE;
|
||||
if ( $contentObject instanceof \IPS\Content )
|
||||
if ( $contentObject instanceof \IPS\Content or $contentObject instanceof \IPS\Member\Club )
|
||||
{
|
||||
$canView = $contentObject->canView();
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user