Version 4.3.0
This commit is contained in:
1 parent
96997ddd8e
commit
fe1acf984a
1349 files changed
+116159
-67711
No files matched your search
@@ -0,0 +1,33 @@
|
||||
//<?php
|
||||
|
||||
/* To prevent PHP errors (extending class does not exist) revealing path */
|
||||
if ( !defined( '\IPS\SUITE_UNIQUE_KEY' ) )
|
||||
{
|
||||
exit;
|
||||
}
|
||||
|
||||
class cms_hook_Parser extends _HOOK_CLASS_
|
||||
{
|
||||
/**
|
||||
* Get URL bases (whout schema) that we'll allow iframes from
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
protected static function allowedIFrameBases()
|
||||
{
|
||||
$return = parent::allowedIFrameBases();
|
||||
|
||||
/* If the CMS root URL is not inside the IPS4 directory, then embeds will fails as the src will not be allowed */
|
||||
if ( \IPS\Settings::i()->cms_root_page_url )
|
||||
{
|
||||
$pages = iterator_to_array( \IPS\Db::i()->select( 'database_page_id', 'cms_databases', array( 'database_page_id > 0' ) ) );
|
||||
|
||||
foreach ( new \IPS\Patterns\ActiveRecordIterator( \IPS\Db::i()->select( '*', 'cms_pages', array( \IPS\Db::i()->in( 'page_id', $pages ) ) ), 'IPS\cms\Pages\Page' ) as $page )
|
||||
{
|
||||
$return[] = str_replace( array( 'http://', 'https://' ), '', $page->url() );
|
||||
}
|
||||
}
|
||||
|
||||
return $return;
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user