Version 4.5.0
This commit is contained in:
1 parent
1a0c7fd3c2
commit
f79dcf067a
3791 files changed
+248032
-76372
No files matched your search
@@ -1,7 +1,7 @@
|
||||
//<?php
|
||||
|
||||
/* To prevent PHP errors (extending class does not exist) revealing path */
|
||||
if ( !defined( '\IPS\SUITE_UNIQUE_KEY' ) )
|
||||
if ( !\defined( '\IPS\SUITE_UNIQUE_KEY' ) )
|
||||
{
|
||||
exit;
|
||||
}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
//<?php
|
||||
|
||||
/* To prevent PHP errors (extending class does not exist) revealing path */
|
||||
if ( !defined( '\IPS\SUITE_UNIQUE_KEY' ) )
|
||||
if ( !\defined( '\IPS\SUITE_UNIQUE_KEY' ) )
|
||||
{
|
||||
exit;
|
||||
}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
//<?php
|
||||
|
||||
/* To prevent PHP errors (extending class does not exist) revealing path */
|
||||
if ( !defined( '\IPS\SUITE_UNIQUE_KEY' ) )
|
||||
if ( !\defined( '\IPS\SUITE_UNIQUE_KEY' ) )
|
||||
{
|
||||
exit;
|
||||
}
|
||||
@@ -43,7 +43,24 @@ class cms_hook_FriendlyUrl extends _HOOK_CLASS_
|
||||
/* Try to find a page */
|
||||
try
|
||||
{
|
||||
$page = \IPS\cms\Pages\Page::loadFromPath( $potentialFurl );
|
||||
list( $pagePath, $pageNumber ) = \IPS\cms\Pages\Page::getStrippedPagePath( $potentialFurl );
|
||||
try
|
||||
{
|
||||
$page = \IPS\cms\Pages\Page::loadFromPath( $pagePath );
|
||||
}
|
||||
catch( \Exception $e )
|
||||
{
|
||||
/* Try from furl */
|
||||
try
|
||||
{
|
||||
$page = \IPS\cms\Pages\Page::load( \IPS\Db::i()->select( 'store_current_id', 'cms_url_store', array( 'store_type=? and store_path=?', 'page', $pagePath ) )->first() );
|
||||
}
|
||||
catch( \UnderflowException $e )
|
||||
{
|
||||
throw new \OutOfRangeException;
|
||||
}
|
||||
}
|
||||
|
||||
return static::createFromComponents( $components[ static::COMPONENT_HOST ], $components[ static::COMPONENT_SCHEME ], $components[ static::COMPONENT_PATH ], $components[ static::COMPONENT_QUERY ], $components[ static::COMPONENT_PORT ], $components[ static::COMPONENT_USERNAME ], $components[ static::COMPONENT_PASSWORD ], $components[ static::COMPONENT_FRAGMENT ] )
|
||||
->setFriendlyUrlData( 'content_page_path', array( $potentialFurl ), array( 'path' => $potentialFurl ), $potentialFurl );
|
||||
}
|
||||
@@ -105,24 +122,11 @@ class cms_hook_FriendlyUrl extends _HOOK_CLASS_
|
||||
{
|
||||
if ( $seoTemplate === 'content_page_path' )
|
||||
{
|
||||
/* If we want to use a gateway script, adjust accordingly */
|
||||
if ( \IPS\Settings::i()->cms_use_different_gateway )
|
||||
{
|
||||
$baseUrl = static::baseUrl( $this->data[ static::COMPONENT_SCHEME ] );
|
||||
|
||||
if ( mb_substr( $this->url, 0, mb_strlen( $baseUrl ) ) === $baseUrl ) // Only if it isn't already, such as from |IPS\Request::i()->url()
|
||||
{
|
||||
$this->url = \IPS\Settings::i()->cms_root_page_url . mb_substr( $this->url, mb_strlen( $baseUrl ) );
|
||||
$this->data = static::componentsFromUrlString( $this->url );
|
||||
$this->queryString = $this->data['query'];
|
||||
$this->data['query'] = static::convertQueryAsArrayToString( $this->queryString );
|
||||
}
|
||||
}
|
||||
|
||||
/* Set basic properties */
|
||||
$this->seoTemplate = 'content_page_path';
|
||||
$this->seoTitles = is_string( $seoTitles ) ? array( $seoTitles ) : $seoTitles;
|
||||
$this->seoTitles = \is_string( $seoTitles ) ? array( $seoTitles ) : $seoTitles;
|
||||
$this->friendlyUrlComponent = $friendlyUrlComponent;
|
||||
$this->seoPagination = true;
|
||||
|
||||
/* Set hidden query string */
|
||||
$this->hiddenQueryString = array( 'app' => 'cms', 'module' => 'pages', 'controller' => 'page' ) + $matchedParams;
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
//<?php
|
||||
|
||||
/* To prevent PHP errors (extending class does not exist) revealing path */
|
||||
if ( !defined( '\IPS\SUITE_UNIQUE_KEY' ) )
|
||||
if ( !\defined( '\IPS\SUITE_UNIQUE_KEY' ) )
|
||||
{
|
||||
exit;
|
||||
}
|
||||
@@ -36,7 +36,7 @@ class cms_hook_InternalUrl extends _HOOK_CLASS_
|
||||
$paramsToSet[ $k ] = $v;
|
||||
}
|
||||
}
|
||||
if ( count( $paramsToSet ) )
|
||||
if ( \count( $paramsToSet ) )
|
||||
{
|
||||
$correctUrl = $correctUrl->setQueryString( $paramsToSet );
|
||||
}
|
||||
@@ -47,7 +47,7 @@ class cms_hook_InternalUrl extends _HOOK_CLASS_
|
||||
/* Couldn't find one? Don't accept responsibility */
|
||||
catch ( \OutOfRangeException $e ){}
|
||||
}
|
||||
|
||||
|
||||
/* Return */
|
||||
return $return;
|
||||
}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
//<?php
|
||||
|
||||
/* To prevent PHP errors (extending class does not exist) revealing path */
|
||||
if ( !defined( '\IPS\SUITE_UNIQUE_KEY' ) )
|
||||
if ( !\defined( '\IPS\SUITE_UNIQUE_KEY' ) )
|
||||
{
|
||||
exit;
|
||||
}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
//<?php
|
||||
|
||||
/* To prevent PHP errors (extending class does not exist) revealing path */
|
||||
if ( !defined( '\IPS\SUITE_UNIQUE_KEY' ) )
|
||||
if ( !\defined( '\IPS\SUITE_UNIQUE_KEY' ) )
|
||||
{
|
||||
exit;
|
||||
}
|
||||
@@ -71,7 +71,7 @@ class cms_hook_Output extends _HOOK_CLASS_
|
||||
\IPS\Member::loggedIn()->language()->parseOutputForDisplay( $message );
|
||||
|
||||
/* Log */
|
||||
$level = intval( \substr( $code, 0, 1 ) );
|
||||
$level = \intval( \substr( $code, 0, 1 ) );
|
||||
if( !\IPS\Session::i()->userAgent->spider )
|
||||
{
|
||||
if( $code and \IPS\Settings::i()->error_log_level and $level >= \IPS\Settings::i()->error_log_level )
|
||||
@@ -86,10 +86,7 @@ class cms_hook_Output extends _HOOK_CLASS_
|
||||
) );
|
||||
}
|
||||
|
||||
if( \IPS\Settings::i()->error_notify_level and $level >= \IPS\Settings::i()->error_notify_level )
|
||||
{
|
||||
\IPS\Email::buildFromTemplate( 'core', 'error_log', array( $code, $message ), \IPS\Email::TYPE_LIST )->send( \IPS\Settings::i()->email_in );
|
||||
}
|
||||
\IPS\core\AdminNotification::send( 'core', 'Error', NULL, TRUE, array( $code, $message ) );
|
||||
}
|
||||
|
||||
/* If this is an AJAX request, send a JSON response */
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
//<?php
|
||||
|
||||
/* To prevent PHP errors (extending class does not exist) revealing path */
|
||||
if ( !defined( '\IPS\SUITE_UNIQUE_KEY' ) )
|
||||
if ( !\defined( '\IPS\SUITE_UNIQUE_KEY' ) )
|
||||
{
|
||||
exit;
|
||||
}
|
||||
|
||||
@@ -1,13 +1,29 @@
|
||||
//<?php
|
||||
|
||||
/* To prevent PHP errors (extending class does not exist) revealing path */
|
||||
if ( !defined( '\IPS\SUITE_UNIQUE_KEY' ) )
|
||||
if ( !\defined( '\IPS\SUITE_UNIQUE_KEY' ) )
|
||||
{
|
||||
exit;
|
||||
}
|
||||
|
||||
class cms_hook_Post extends _HOOK_CLASS_
|
||||
{
|
||||
/**
|
||||
* Can edit?
|
||||
*
|
||||
* @param \IPS\Member|NULL $member The member to check for (NULL for currently logged in member)
|
||||
* @return bool
|
||||
*/
|
||||
public function canEdit( $member=NULL )
|
||||
{
|
||||
if ( $this->isFirst() AND \IPS\cms\Records::getLinkedRecord( $this->item() ) )
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
return parent::canEdit( $member );
|
||||
}
|
||||
|
||||
/**
|
||||
* Create comment
|
||||
*
|
||||
@@ -91,7 +107,7 @@ class cms_hook_Post extends _HOOK_CLASS_
|
||||
{
|
||||
try
|
||||
{
|
||||
if ( ! in_array( $category['category_database_id'], $synced ) )
|
||||
if ( ! \in_array( $category['category_database_id'], $synced ) )
|
||||
{
|
||||
$class = '\IPS\cms\Records' . $category['category_database_id'];
|
||||
$object = $class::load( $item->tid, 'record_topicid' );
|
||||
@@ -110,7 +126,7 @@ class cms_hook_Post extends _HOOK_CLASS_
|
||||
{
|
||||
try
|
||||
{
|
||||
if ( ! in_array( $database['database_id'], $synced ) )
|
||||
if ( ! \in_array( $database['database_id'], $synced ) )
|
||||
{
|
||||
$class = '\IPS\cms\Records' . $database['database_id'];
|
||||
$object = $class::load( $item->tid, 'record_topicid' );
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
//<?php
|
||||
|
||||
/* To prevent PHP errors (extending class does not exist) revealing path */
|
||||
if ( !defined( '\IPS\SUITE_UNIQUE_KEY' ) )
|
||||
if ( !\defined( '\IPS\SUITE_UNIQUE_KEY' ) )
|
||||
{
|
||||
exit;
|
||||
}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
//<?php
|
||||
|
||||
/* To prevent PHP errors (extending class does not exist) revealing path */
|
||||
if ( !defined( '\IPS\SUITE_UNIQUE_KEY' ) )
|
||||
if ( !\defined( '\IPS\SUITE_UNIQUE_KEY' ) )
|
||||
{
|
||||
exit;
|
||||
}
|
||||
@@ -25,7 +25,7 @@ class cms_hook_Topic extends _HOOK_CLASS_
|
||||
if ( ! $canView )
|
||||
{
|
||||
/* Check to see if it's attached to a database record and we are not a guest */
|
||||
if ( isset( \IPS\Request::i()->do ) and in_array( \IPS\Request::i()->do, $do ) and $record = \IPS\cms\Records::getLinkedRecord( $this ) and $member->member_id )
|
||||
if ( isset( \IPS\Request::i()->do ) and \in_array( \IPS\Request::i()->do, $do ) and $record = \IPS\cms\Records::getLinkedRecord( $this ) and $member->member_id )
|
||||
{
|
||||
return $record->canView();
|
||||
}
|
||||
@@ -34,6 +34,22 @@ class cms_hook_Topic extends _HOOK_CLASS_
|
||||
return $canView;
|
||||
}
|
||||
|
||||
/**
|
||||
* Can edit?
|
||||
*
|
||||
* @param \IPS\Member|NULL $member The member to check for (NULL for currently logged in member)
|
||||
* @return bool
|
||||
*/
|
||||
public function canEdit( $member=NULL )
|
||||
{
|
||||
if ( \IPS\cms\Records::getLinkedRecord( $this ) )
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
return parent::canEdit( $member );
|
||||
}
|
||||
|
||||
/**
|
||||
* Do Moderator Action
|
||||
*
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
//<?php
|
||||
|
||||
/* To prevent PHP errors (extending class does not exist) revealing path */
|
||||
if ( !defined( '\IPS\SUITE_UNIQUE_KEY' ) )
|
||||
if ( !\defined( '\IPS\SUITE_UNIQUE_KEY' ) )
|
||||
{
|
||||
exit;
|
||||
}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
//<?php
|
||||
|
||||
/* To prevent PHP errors (extending class does not exist) revealing path */
|
||||
if ( !defined( '\IPS\SUITE_UNIQUE_KEY' ) )
|
||||
if ( !\defined( '\IPS\SUITE_UNIQUE_KEY' ) )
|
||||
{
|
||||
exit;
|
||||
}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
//<?php
|
||||
|
||||
/* To prevent PHP errors (extending class does not exist) revealing path */
|
||||
if ( !defined( '\IPS\SUITE_UNIQUE_KEY' ) )
|
||||
if ( !\defined( '\IPS\SUITE_UNIQUE_KEY' ) )
|
||||
{
|
||||
exit;
|
||||
}
|
||||
@@ -26,7 +26,7 @@ class cms_hook_forums extends _HOOK_CLASS_
|
||||
|
||||
try
|
||||
{
|
||||
$node = call_user_func( "{$nodeClass}::load", \IPS\Request::i()->id );
|
||||
$node = $nodeClass::load( \IPS\Request::i()->id );
|
||||
}
|
||||
catch ( \OutOfRangeException $e )
|
||||
{
|
||||
@@ -41,7 +41,7 @@ class cms_hook_forums extends _HOOK_CLASS_
|
||||
\IPS\Output::i()->error( 'cms_forum_used', '1T371/1', 403, '' );
|
||||
}
|
||||
|
||||
return call_user_func_array( 'parent::delete', func_get_args() );
|
||||
return parent::delete();
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,7 +1,7 @@
|
||||
//<?php
|
||||
|
||||
/* To prevent PHP errors (extending class does not exist) revealing path */
|
||||
if ( !defined( '\IPS\SUITE_UNIQUE_KEY' ) )
|
||||
if ( !\defined( '\IPS\SUITE_UNIQUE_KEY' ) )
|
||||
{
|
||||
exit;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user