SOLVED Problem With Kb Plugin


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

Profile PM  
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

Profile PM  
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

Profile PM  
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

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: [Download] [Hide]
  1. if ($html_on) 
  2. $article_text = htmlspecialchars_decode($article_text); 
after
Code: [Download] [Hide]
  1. if (!empty($article_text)) 



El psy congroo.

Profile PM  
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: [Download] [Hide]
  1. if ($html_on) 
  2. $article_text = htmlspecialchars_decode($article_text); 
after
Code: [Download] [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!"

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


Page 1 of 1


  
You cannot post new topics
You cannot reply to topics
You cannot edit your posts
You cannot delete your posts
You cannot vote in polls
You cannot attach files
You can download files
You cannot post calendar events

   

This is a "Lo-Fi" version of our main content. To view the full version with more information, formatting and images, please click here.

Powered by Icy Phoenix based on phpBB
Generation Time: 1.1145s (PHP: 2% SQL: 98%)
SQL queries: 10 - Debug Off - GZIP Enabled