| Server IP : 195.130.67.5 / Your IP : 216.73.217.154 Web Server : Microsoft-IIS/10.0 System : Windows NT WEBSERVER1 10.0 build 17763 (Windows Server 2016) i586 User : IUSR ( 0) PHP Version : 7.4.19 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : OFF | Perl : OFF | Python : OFF | Sudo : OFF | Pkexec : OFF Directory : /Old Sites/eadsa/plugins/content/ |
Upload File : |
<?
/**
* Insert HTML editor button plugin for Joomla! file
*
* @package Insert HTML editor button plugin for Joomla!
* @author Francisco Rey Barcelo <mail@phoenixbits.com>
* @GNU General Public License
*/
// no direct access
defined('_JEXEC') or die('Restricted access');
// register the handler
$mainframe->registerEvent( 'onPrepareContent', 'plgInsertHTMLEditorButton' );
function plgInsertHTMLEditorButton( &$row, &$params, $page )
{
global $mainframe;
$pattern = '/\{HTML\}(.*?)\{\/HTML\}/i'; // match {HTML}...{/HTML} case no sensitive, execute php in string replace
// Security
$acl =& JFactory::getACL();
if( $acl->getAroGroup($row->created_by)->id >= 23 || $acl->getAroGroup($row->modified_by)->id >= 23 )
$row->text = preg_replace_callback( $pattern, 'IHEBP_decodehtmlspecialchars', $row->text );
}
function IHEBP_decodehtmlspecialchars( $match )
{
$match[1] = str_ireplace( "<br />", "\n", $match[1] );
$match[1] = str_replace( array("<",">"), array("<",">"), $match[1] );
$match[1] = str_replace( array("{apos}","{quot}","{amp}"), array("'","\"","&"), $match[1] );
return $match[1];
}