Update to the tags mod search and the default search function for sNews

Comments (2)

In having a discussion about the tags mod with Vic today, I discovered that when we return the tag requested, it could possibly contain malformed HTML, if a user has input it, i.e. http://www.mdj.us/tag/<table/. This could break the page layout, but only for the person inputting the bogus tag, this is not a security issue, the tag query and search itself is still sanitized via the clean and cleanXSS functions.

As I took this bit of code directly from the default snews search function, this exists in all default snews installs search function as well.

To test your site, simply perform a search for <table, if it breaks your page layout, you may want to fix it.

To update this on the tags mod, simply change the two instances of the following within the function tagsearch;

stripslashes($tags_query)

to

stripslashes(entity($tags_query))

I have updated this on the tutorial. Now to fix the default sNews install search, find the function search and change;

stripslashes($search_query)

to

stripslashes(entity($search_query))

That should do it, thanks for the head's up Vic!

bookmark / share this: Bookmark and Share
rated 5/5 (2 votes)


2 comments

Add a new comment »

Sven - Philippe Sven - Philippe said:
Apr 23rd, 2009 at 11:28 am

I just received your email, Matt! What a service!
Functions have been updated and, Vic was right.
So thanks to him and thanks to you too.
I really appreciate your kind help.


Yohanes Budi Lelono Yohanes Budi Lelono said:
Apr 26th, 2009 at 6:10 am

Thanks for the theme. Quite struggle finding the right theme for my blog.

Hoping that U will stay for sNews.. :)

-Low Man-



Write a comment

* = required field

:

:

:

:

You may insert urls in plain text, urls will be automatically linkified for trusted users and on seasoned posts only. All first comments are moderated, so use your email if you want to be remembered.


Back to top