Arrow Home arrow Forums
larger font smaller font default font Fixed screen resolution Auto adjust screen size

Joomlapolis Forums  


html tags are always stripped in input fields
Date: 2008/09/26 19:36 By: Marblex Status: User  
Karma: 0  
Fresh Joomlapolitan

Posts: 2
graphgraph
After installing I immediately went to check out the Editor Text Area. To see what it could do.

I was surprised to see that it didn't store any HTML at all.
Switching editors and changing the filter settings didn't help either.

I finally traced it down to comprofiler.class.php line 5095
As you can see in the code below. the "if class_exists" appears to fail, defaulting back to a strip_tags instruction.

This is because the class JInputFilter does not exist.
What does exist is JFilterInput
I changed that, and now it works fine.

Code:

  function clean$filter$source$type='string' ) {     if ( class_exists"JInputFilter" ) ) {         $result $filter->clean$source$type );     } elseif ( class_exists"InputFilter" ) ) {         // Handle the type constraint         switch (strtoupper($type))         {             case 'INT' :             case 'INTEGER' :                 // Only use the first integer value                 preg_match('/-?[0-9]+/'$source$matches);                 $result = @ (int) $matches[0];                 break;             case 'FLOAT' :             case 'DOUBLE' :                 // Only use the first floating point value                 preg_match('/-?[0-9]+(\.[0-9]+)?/'$source$matches);                 $result = @ (float) $matches[0];                 break;             case 'BOOL' :             case 'BOOLEAN' :                 $result = (bool) $source;                 break;             case 'WORD' :                 $result = (string) preg_replace'#\W#'''$source );                 break;             default :                 $result $this->_process$filter$source );                 break;         }     } else {         $result strip_tags$source );    // sorry, but old mambo versions are unsafe     }     return $result; }



Installed Joomla version 1.5.4
Installed CB 1.1

Also..
When I was google searching for part of your code I came across 2 sets of Joomla API documentation, that contradict each other at exactly this point.

So. Do not go here:
http://docs.huihoo.com/api/joomla/1.5/Joomla-Framework/Filter/JInputFilter.html
But go here:
http://api.joomla.org/Joomla-Framework/Filter/JFilterInput.html

I'm thinking it's a Chinese conspiracy
Click here to see the profile of this user The administrator has disabled public write access.

Re:html tags are always stripped in input fields
Date: 2008/09/26 20:56 By: beat Status: Admin  
Karma: 238  
Admin

Posts: 3995
graphgraph
Thanks for sharing the solution for CB 1.1.

This and many other API changes of Joomla 1.5 are already fixed in CB 1.2 RC 2.
Beat - Developer on Community Builder core Team
- If you like CB and this forum, you will love Nick's CB 1.1 reference manual ! : Click here to Get it now
- Would like to help us move faster ? Get it, and/or help us spend more time coding by helping others in this forum, many thanks
Click here to see the profile of this user The administrator has disabled public write access.

Documentation

Documentation Subscription Service
(updated for CB 1.2 RC2)

What?

Why?

Where?

Just click here for answers!

Click here for a yearly subscription: subscribe now

Download Latest Release

The latest stable Community Builder Release is version 1.1 for Joomla 1.0 and Mambo.
You need to be a registered member of Joomlapolis to download.

The latest release candidate of Community Builder is version 1.2 RC3, native for Joomla 1.0, 1.5 and Mambo.
It is available as "thank you" to all CB documentation subscribers at this time.

CB Login