Problem With Kb Plugin »  Show posts from    to     

Icy Phoenix


Old Support Topics - Problem With Kb Plugin



Nayuko [ Sat 17 Nov, 2012 16:51 ]
Post subject: 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&23" and when you click on it, produces the following error:

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')


mort [ Sat 17 Nov, 2012 23:30 ]
Post subject: Re: Problem With Kb Plugin
In a simple way,

It's the normal thing for & to be converted to & 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 anything&23 should be written as anything&23


Informpro [ Sun 18 Nov, 2012 13:51 ]
Post subject: 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 ]
Post subject: Re: Problem With Kb Plugin
i actualy told Nayuko on IP.es to try with BBcode [url] instaed of using html , just for test


Informpro [ Sun 18 Nov, 2012 14:26 ]
Post subject: 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: [Hide]
  1. if ($html_on) 
  2. $article_text = htmlspecialchars_decode($article_text); 
after
Code: [Hide]
  1. if (!empty($article_text)) 



El psy congroo.


Nayuko [ Sun 18 Nov, 2012 16:47 ]
Post subject: Re: Problem With Kb Plugin
Informpro wrote: [View Post]
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: [Hide]
  1. if ($html_on) 
  2. $article_text = htmlspecialchars_decode($article_text); 
after
Code: [Hide]
  1. if (!empty($article_text)) 



El psy congroo.


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 ]
Post subject: Re: [SOLVED] Problem With Kb Plugin
Thanks for the fix, I'll update GIT with this fix on next commit.




Powered by Icy Phoenix