Recent Topics

1 Oct 08, 2011 16:41    

My b2evolution Version: 4.0.5

Hello!

I have just upgraded an old version of b2evo to 4.0.5.

I have uploaded picture and inserted it into the post using Add/Link files dialog.

When I try to save the file I get the following error:

Illegal content found: blacklisted word «a href=».
Invalid content.

The content of the post is as follows:

<div class="image_block"><a href="/blogs/media/blogs/testing/pyatak_av.jpg?mtime=1318028884"><img src="/blogs/media/blogs/testing/pyatak_av.jpg?mtime=1318028884" alt="" width="108" height="108" /></a></div>

I have tried different user settings for:

XHTML validation
XHTML validation on XML-RPC calls

nothing helps.

Does anyone have any idea what the problem could be? Why validation of default entered html code fails?

2 Oct 08, 2011 23:45

Welcome to the forum!

blacklisted word

Go to Tools > Antispam and search for blacklisted "a href=" in the list. Uncheck/allow the word and you should be ok.

3 Oct 08, 2011 23:58

sam2kb,

thank you! that did the trick, but only for a href of course.

Now I receive validation error like this:

Tag <div> is not allowed within tag <p>
(Note: To get rid of the above validation warnings, you can deactivate unwanted validation rules in your Group settings.)
Invalid content.

Should I set basic validation instead of strict in the group settings to overcome this?

4 Oct 09, 2011 00:02

Well... <div> is really not allowed inside <p> tag. Try to clean up the code first.

Alternatively you can switch to "Basic validation"

5 Oct 09, 2011 00:19

sam2kb,

thanks for the helpful anwer. the interesting thing is that the problematic html code is not being written by me, its b2evo add/link image dialog doing that. so I expect that all users of the blog will have this problem and it will be quite hard to explain them :)

strange that right after I insert the image into an empty post, I switch to html code view and see the following:

<p>
<div class="image_block"><a href="/blogs/media/blogs/testing/pyatak_av.jpg?mtime=1318028884"><img src="/blogs/media/blogs/testing/pyatak_av.jpg?mtime=1318028884" alt="" width="108" height="108" /></a></div>
</p>

and if now I try to save the post, validation fails.

after that I switch back to wysiwyg and then again back to html code view and see this:

<p> </p>
<div class="image_block"><a href="/blogs/media/blogs/testing/pyatak_av.jpg?mtime=1318028884"><img src="/blogs/media/blogs/testing/pyatak_av.jpg?mtime=1318028884" alt="" width="108" height="108" /></a></div>
<p> </p>

so the validation passes after this.

is that happening only with my installation of blog or is familiar to someone?

6 Oct 09, 2011 00:27

That's TinyMCE's bug. It creates <p> tags when you click enter. There's a workaround though. You can select "div" in the left most field in editor menu.

TODO: create a setting to choose default formatting tag.

Moved to "Feature requests"

7 Oct 09, 2011 00:28

sam2kb, now it is clear. thanks a lot!


Form is loading...