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

@@ -11,7 +11,7 @@
namespace IPS\core\modules\front\promote;
/* 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;
@@ -29,8 +29,6 @@ class _promote extends \IPS\Dispatcher\Controller
*/
protected function edit()
{
\IPS\Session::i()->csrfCheck();
try
{
$promote = \IPS\core\Promote::load( \IPS\Request::i()->promote_id );
@@ -121,7 +119,7 @@ class _promote extends \IPS\Dispatcher\Controller
{
foreach( $image as $extension => $path )
{
if ( \IPS\Request::i()->attach_files and in_array( $path, array_keys( \IPS\Request::i()->attach_files ) ) )
if ( \IPS\Request::i()->attach_files and \in_array( $path, array_keys( \IPS\Request::i()->attach_files ) ) )
{
$saveImages[] = array( $extension => $path );
}
@@ -130,7 +128,7 @@ class _promote extends \IPS\Dispatcher\Controller
}
$media = array();
if ( is_array( $values['promote_media'] ) )
if ( \is_array( $values['promote_media'] ) )
{
foreach( $values['promote_media'] as $key => $file )
{
@@ -310,7 +308,7 @@ class _promote extends \IPS\Dispatcher\Controller
{
/* Nope... */
$class = \IPS\Request::i()->class;
$id = intval( \IPS\Request::i()->id );
$id = \intval( \IPS\Request::i()->id );
/* Do we have an existing promotion waiting to be sent? */
$existing = \IPS\core\Promote::loadByClassAndId( $class, $id );
@@ -329,6 +327,12 @@ class _promote extends \IPS\Dispatcher\Controller
{
\IPS\Output::i()->error( 'page_not_found', '2C356/6', 404, '' );
}
/* Check that the object can be promoted */
if( !$object->canPromoteToSocialMedia() )
{
\IPS\Output::i()->error( 'page_not_found', '2C405/1', 403, 'promote_cant_promote_admin' );
}
/* Do we have viewing perms? */
if ( ! \IPS\core\Promote::objectCanView( $object ) )
@@ -515,7 +519,7 @@ class _promote extends \IPS\Dispatcher\Controller
}
$media = array();
if ( is_array( $values['promote_media'] ) )
if ( \is_array( $values['promote_media'] ) )
{
foreach( $values['promote_media'] as $key => $file )
{
@@ -552,7 +556,7 @@ class _promote extends \IPS\Dispatcher\Controller
{
foreach( $image as $extension => $path )
{
if ( \IPS\Request::i()->attach_files and in_array( $path, array_keys( \IPS\Request::i()->attach_files ) ) )
if ( \IPS\Request::i()->attach_files and \in_array( $path, array_keys( \IPS\Request::i()->attach_files ) ) )
{
$saveImages[] = array( $extension => $path );
}
@@ -568,7 +572,7 @@ class _promote extends \IPS\Dispatcher\Controller
$promote->added_by = \IPS\Member::loggedIn()->member_id;
}
$promote->internal = ( in_array( 'internal', $shareTo ) ? 1 : 0 );
$promote->internal = ( \in_array( 'internal', $shareTo ) ? 1 : 0 );
$promote->text = $text;
$promote->short_link = $shortLink ?: $normalLink;
$promote->images = $saveImages;
@@ -595,7 +599,7 @@ class _promote extends \IPS\Dispatcher\Controller
}
else
{
$output = \IPS\Theme::i()->getTemplate( 'promote' )->promoteDialog( \IPS\Member::loggedIn()->language()->addToStack('promote_social_title'), $form->customTemplate( array( call_user_func_array( array( \IPS\Theme::i(), 'getTemplate' ), array( 'promote', 'core' ) ), 'promoteDialogTemplate' ), $existing, $object ) );
$output = \IPS\Theme::i()->getTemplate( 'promote' )->promoteDialog( \IPS\Member::loggedIn()->language()->addToStack('promote_social_title'), $form->customTemplate( array( \IPS\Theme::i()->getTemplate( 'promote', 'core' ), 'promoteDialogTemplate' ), $existing, $object ) );
}