⚠ In case you've missed it, we have migrated to our new website, with a brand new forum. For more details about the migration you can read our blog post for website migration. This is an archived forum. ⚠

  •     

profile picture

Strange html field behavior



ghenesis
  • profile picture
  • Member

Posted 21 November 2011 - 17:39 PM

Hello,

I've recently started using grocery_CRUD, great lib. Recently I'm developing a project with grocery_CRUD v1.1.4 and the newest CI 2.1. Today I've found out, that something odd is going on while adding/updating html code. Basically TinyMCE is aligning an <img> tag for example using inline code, such as

style="float:left;"

so we receive html in this kind:

<img style="float: right;" [...]

but after update/add action it is shredded a bit and appears to be

<img right;"


Looks like the fragment

style="float:

is just cut out for some reason. Same happens to other html tags, like:

<p justify;">


I've tried to trace, where this could happen, but no luck yet. I've checked if this is happening before sending POST, but in the POST data it appears ok, so there's something going on deeper. It's a quite big issue, so please, help with this one.

Greetings,

ghenesis

web-johnny
  • profile picture
  • Administrator
  • 1,166 posts

Posted 24 November 2011 - 08:47 AM

[quote name='ghenesis' timestamp='1321897188' post='50']
Hello,

I've recently started using grocery_CRUD, great lib. Recently I'm developing a project with grocery_CRUD v1.1.4 and the newest CI 2.1. Today I've found out, that something odd is going on while adding/updating html code. Basically TinyMCE is aligning an <img> tag for example using inline code, such as

style="float:left;"

so we receive html in this kind:

<img style="float: right;" [...]

but after update/add action it is shredded a bit and appears to be

<img right;"


Looks like the fragment

style="float:

is just cut out for some reason. Same happens to other html tags, like:

<p justify;">


I've tried to trace, where this could happen, but no luck yet. I've checked if this is happening before sending POST, but in the POST data it appears ok, so there's something going on deeper. It's a quite big issue, so please, help with this one.

Greetings,

ghenesis
[/quote]


I've tried this one, but works fine for me . Can you please send me an example of the text that you want to save? I need the whole html text. I did many tests and everything works fine. It's a really strange bug.

ghenesis
  • profile picture
  • Member

Posted 24 November 2011 - 19:13 PM

Thanks for anwering my post.

This is the raw input in POST data:
<p>Some regular text</p>
<p><img style="float: right;" src="../../../resource/upload/media/tedt/Screen Shot 2011-10-20 at 21.26.01 .png" alt="" width="366" height="228" /></p>
<p>Some regular text, formatted by <strong>TinyMCE</strong></p>

This is what above becames in database:

<p>Some regular text</p>
<p><img right;" src="../../../resource/upload/media/tedt/Screen Shot 2011-10-20 at 21.26.01 .png" alt="" width="366" height="228" /></p>
<p>Some regular text, formatted by <strong>TinyMCE</strong></p>

Maybe it depends somehow on config of CI? I'm trying to figure it out, but still no luck...

It seems, that the string >>style="float:<< is just cutted out for some reason. The same happens when anything looking like this appear in the input.

Regards,

ghenesis

ghenesis
  • profile picture
  • Member

Posted 24 November 2011 - 19:44 PM

Hello again,

I've been on this subject for a little while and now I've got a clue, what's going on. The problem is this main config line:

$config['global_xss_filtering'] = TRUE;
While global_xss_filtering is set to FALSE this is working fing, probably the xss filtering routines cuts out this certain pattern...

Regards,

ghenesis

web-johnny
  • profile picture
  • Administrator
  • 1,166 posts

Posted 24 November 2011 - 22:13 PM

[quote name='ghenesis' timestamp='1322163875' post='58']
Hello again,

I've been on this subject for a little while and now I've got a clue, what's going on. The problem is this main config line:

$config['global_xss_filtering'] = TRUE;
While global_xss_filtering is set to FALSE this is working fing, probably the xss filtering routines cuts out this certain pattern...

Regards,

ghenesis
[/quote]

This was exactly what I found . Since Codeigniter JUST have the change log of CI 2.1 version, I didn't really know the changes. I'm glad that you find it. Actually there is no reason to use global_xss_filtering in the config. It is really useless for me, wherever you need it you can add it to your code.

ghenesis
  • profile picture
  • Member

Posted 24 November 2011 - 22:22 PM

[quote name='web-johnny' timestamp='1322172836' post='59']

This was exactly what I found . Since Codeigniter JUST have the change log of CI 2.1 version, I didn't really know the changes. I'm glad that you find it. Actually there is no reason to use global_xss_filtering in the config. It is really useless for me, wherever you need it you can add it to your code.
[/quote]

Right, but in some cases it may be usefull. Anyway, it's a relief to know what was the issue. I've got another idea/question. Do you consider making various language files for UI messages? I may help with polish language translation.

Regards