CMS MADE SIMPLE FORGE

CMS Made Simple Core

 

[#12660] output filter not working as expected - not sure if a bug or if I missed something

avatar
Created By: Volker Braun (braegler)
Date Submitted: Tue Oct 31 15:10:46 -0400 2023

Assigned To:
Version: 2.2.18
CMSMS Version: 2.2.18
Severity: Minor
Resolution: None
State: Open
Summary:
output filter not working as expected - not sure if a bug or if I missed something
Detailed Description:
Hi, 
first I have to say thank you for this great application.

I tried to install an output filter to cache remote images locally by adding a
proxy to the src.


Unfortunately I had to change the file
lib/classes/internal/class.Smarty_CMS.php
to get it running

I had to change
                case 'output':
                    $output[] = $parts[1];
                    break;

to

                case 'outputfilter':
                    $output[] = $parts[1];
                    break;

and name the filename (outputfilter.xyz.php) and function
(smarty_outputfilter_xyz) accordingly to make it work

I wasn't able to get it running with "output.xyz.php" and smarty_output_xyz or
smarty_outputfilter_xyz as function name at all.
Either the filter isn't loaded or raises the following error:
PHP Fatal error:  Uncaught  --> Smarty: Unable to auto load output-filter plugin
'Smarty_outputfilter_cacheme

After changing the name convention to the smarty default outputfilter I was able
to bring it to live.





History

Comments
avatar
Date: 2023-11-01 03:38
Posted By: Volker Braun (braegler)

Sorry, set the wrong version. 
      
avatar
Date: 2023-11-01 07:34
Posted By: tom (tomphantoo)

Smarty documentation includes an example as follows:
/*
 * Smarty plugin
 * -------------------------------------------------------------
 * File:     outputfilter.protect_email.php
 * Type:     outputfilter
 * Name:     protect_email
....
function smarty_outputfilter_protect_email( ....

Smarty itself includes a plugin outputfilter.trimwhitespace.php but no plugin
like output*.php without 'filter' in the name.

It seems to me that changing from case 'output': to case 'outputfilter': for
matching plugin names is an appropriate bugfix.
      
Updates

Updated: 2023-11-01 03:38
version_id: 31015 => 31828
resolution_id: => 5
cmsms_version_id: 31015 => 31828