https://www.icyphoenix.com/viewtopic.php?f=35&t=8810
-----------------------------------
Nayuko
Sat 17 Nov, 2012 16:51

Problem With Kb Plugin
-----------------------------------
Hello everybody,

I have a problem with the kb plugin that happens when I create/edit an article. The problem is that if the article includes an url with a weird character (it seems that happens only with the "&" character) automatically puts at its side its html code. For example, if my url is "anything&23", appears as "anything&amp;23" and when you click on it, produces the following error:

[cell class=spoiler]SQL ERROR [ mysql4 ]

You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 2 [1064]

SQL

SELECT * FROM ip_kb_categories WHERE category_id =

BACKTRACE

FILE: includes/DB/mysql.php
LINE: 295
CALL: sql_db->sql_error()

FILE: plugins/kb/includes/functions_kb.php
LINE: 157
CALL: sql_db->sql_query()

FILE: plugins/kb/includes/kb_article.php
LINE: 193
CALL: get_kb_nav()

FILE: kb.php
LINE: 61
CALL: include('plugins/kb/includes/kb_article.php')[/cell]


-----------------------------------
mort
Sat 17 Nov, 2012 23:30

Re: Problem With Kb Plugin
-----------------------------------
In a simple way,

It's the normal thing for & to be converted to &amp; on $_POST providing it's told to do it - And then on $_GET it converts it back to &.

The variables that handle the posting and getting - need to be cleaned and I don't know where is what with the KB mod, so you'll have to wait for someone else that does. ;)

And in reality, this [b]anything&23[/b] should be written as anything[b]&amp;[/b]23


-----------------------------------
Informpro
Sun 18 Nov, 2012 13:51

Re: Problem With Kb Plugin
-----------------------------------
Oh, a Steins; Gate fan.

For your problem, I think it needs to get urlencode()d instead of html escaped.
I'll look into it later


-----------------------------------
spydie
Sun 18 Nov, 2012 14:21

Re: Problem With Kb Plugin
-----------------------------------
i actualy told Nayuko on IP.es to try with BBcode  instaed of using html , just for test


-----------------------------------
Informpro
Sun 18 Nov, 2012 14:26

Re: Problem With Kb Plugin
-----------------------------------
Ah okay, I misread this, thought it was happening with the article URL.
Anyway there's a problem with html escaping.

EDIT : Please try this

I also added, in includes/kb_post.php[code]
		if ($html_on)
		{
			$article_text = htmlspecialchars_decode($article_text);
		}[/code]after[code]if (!empty($article_text))[/code]


El psy congroo.


-----------------------------------
Nayuko
Sun 18 Nov, 2012 16:47

Re: Problem With Kb Plugin
-----------------------------------
[quote user="Informpro" post="57500"]Ah okay, I misread this, thought it was happening with the article URL.
Anyway there's a problem with html escaping.

EDIT : Please try this

I also added, in includes/kb_post.php[code]
		if ($html_on)
		{
			$article_text = htmlspecialchars_decode($article_text);
		}[/code]after[code]if (!empty($article_text))[/code]


El psy congroo.[/quote]

Thanks, it works!

wooo! you like Steins;Gate too!! It's a great anime, and Okabe is so cool! xD 

"she is so prety, but is a man!"


-----------------------------------
Mighty Gorgon
Sat 24 Nov, 2012 11:57

Re: [SOLVED] Problem With Kb Plugin
-----------------------------------
Thanks for the fix, I'll update GIT with this fix on next commit.


