Version 5.0.13

This commit is contained in:
Neo committed 2025-12-19 19:04:57 -08:00
1 parent b89858b2ff
commit 5efe744c5f
1407 files changed
+69690 -30177

No files matched your search

@@ -13,6 +13,7 @@ namespace IPS\blog\extensions\core\EditorLocations;
/* To prevent PHP errors (extending class does not exist) revealing path */
use Exception;
use InvalidArgumentException;
use IPS\blog\Blog;
use IPS\blog\Entry\Comment;
@@ -27,6 +28,7 @@ use IPS\Text\Parser;
use LogicException;
use RuntimeException;
use function defined;
use function is_array;
if ( !defined( '\IPS\SUITE_UNIQUE_KEY' ) )
{
@@ -127,14 +129,20 @@ class Blogs extends EditorLocationsAbstract
*/
public function attachmentLookup( ?int $id1=null, ?int $id2=null, ?string $id3=null ): Model|Content|Url|Member|null
{
/* The attachment is attached to a comment */
if ( $id2 )
{
return Comment::load( $id2 );
try
{/* The attachment is attached to a comment */
if( $id2 )
{
return Comment::load( $id2 );
}
else
{
return Blog::load( $id1 );
}
}
else
catch( Exception $e )
{
return Blog::load( $id1 );
throw new LogicException( );
}
}
@@ -208,7 +216,7 @@ class Blogs extends EditorLocationsAbstract
}
catch( InvalidArgumentException $e )
{
if( $callback[1] == 'parseStatic' AND $e->getcode() == 103014 )
if( is_array( $callback ) and $callback[1] == 'parseStatic' AND $e->getcode() == 103014 )
{
$rebuilt = preg_replace( "#\[/?([^\]]+?)\]#", '', $word['word_custom'] );
}
@@ -13,6 +13,7 @@ namespace IPS\blog\extensions\core\EditorLocations;
/* To prevent PHP errors (extending class does not exist) revealing path */
use Exception;
use InvalidArgumentException;
use IPS\Content;
use IPS\Db;
@@ -24,6 +25,7 @@ use IPS\Node\Model;
use IPS\Text\Parser;
use LogicException;
use function defined;
use function is_array;
if ( !defined( '\IPS\SUITE_UNIQUE_KEY' ) )
{
@@ -78,7 +80,14 @@ class Categories extends EditorLocationsAbstract
switch ( $id3 )
{
case 'bcategory':
return Url::internal( "app=blog&module=blogs&controller=categories&do=form&id={$id1}", 'admin' );
try
{
return Url::internal( "app=blog&module=blogs&controller=categories&do=form&id={$id1}", 'admin' );
}
catch( Exception $e )
{
throw new LogicException;
}
}
return NULL;
@@ -142,7 +151,7 @@ class Categories extends EditorLocationsAbstract
}
catch( InvalidArgumentException $e )
{
if( $callback[1] == 'parseStatic' AND $e->getcode() == 103014 )
if( is_array( $callback ) and $callback[1] == 'parseStatic' AND $e->getcode() == 103014 )
{
$rebuilt = preg_replace( "#\[/?([^\]]+?)\]#", '', $word['word_custom'] );
}
@@ -13,6 +13,7 @@ namespace IPS\blog\extensions\core\EditorLocations;
/* To prevent PHP errors (extending class does not exist) revealing path */
use Exception;
use IPS\blog\Entry;
use IPS\Content;
use IPS\Extensions\EditorLocationsAbstract;
@@ -99,7 +100,14 @@ class Entries extends EditorLocationsAbstract
*/
public function attachmentLookup( ?int $id1=null, ?int $id2=null, ?string $id3=null ): Model|Content|Url|Member|null
{
return Entry::load( $id1 );
try
{
return Entry::load( $id1 );
}
catch( Exception $e )
{
throw new LogicException;
}
}
}