Please login or register.

Login with username, password and session length
Advanced search  

Author Topic: Approval of comments doesn't work  (Read 416 times)

hy

  • Newbie
  • *
  • Karma: 1
  • Posts: 30
  • just hackin'
Approval of comments doesn't work
« on: March 04, 2012, 12:20:56 PM »

If you set comments to being approved by the admin - the admin can not approve them.
This is due to the fact that the field 'approved' in the database is a varchar(5) [which is stupid IMHO] and the internal value of the php-script for approval is boolean (TRUE,FALSE).
Logged
Salu2 ***hy

hy

  • Newbie
  • *
  • Karma: 1
  • Posts: 30
  • just hackin'
Re: Approval of comments doesn't work
« Reply #1 on: March 04, 2012, 03:41:37 PM »

Well the prolem seems not to be connected to the Value of approved but the nonexisting sanitizing of database inputs.
[like: mysql_real_escape_string]
Logged
Salu2 ***hy

mosh

  • Hero Member
  • *****
  • Karma: 77
  • Posts: 510
  • Awesome day :)
    • cms-zen
Re: Approval of comments doesn't work
« Reply #2 on: March 04, 2012, 09:07:14 PM »

hey hy,
there is no problem for me to approve comments while logged in as admin.

hy

  • Newbie
  • *
  • Karma: 1
  • Posts: 30
  • just hackin'
Re: Approval of comments doesn't work
« Reply #3 on: March 04, 2012, 09:45:39 PM »

type a comment that's mixing apostrophes - like that:

Simon says: 'you'd better watch out!'
Logged
Salu2 ***hy

mosh

  • Hero Member
  • *****
  • Karma: 77
  • Posts: 510
  • Awesome day :)
    • cms-zen
Re: Approval of comments doesn't work
« Reply #4 on: March 05, 2012, 06:55:28 AM »

function clean deal with this,
you should have turn on magic quotes gpc in php settings for the server.
« Last Edit: March 05, 2012, 07:00:48 AM by mosh »
Logged

hy

  • Newbie
  • *
  • Karma: 1
  • Posts: 30
  • just hackin'
Re: Approval of comments doesn't work
« Reply #5 on: March 05, 2012, 10:34:25 AM »

Thanks for pointing me to that func(). I already implemented my own function but I will stick to using clean() in order to be able to keep track of my changes.

BTW, I love the photos on your site. What a pity that comments are disabled.
Logged
Salu2 ***hy

mosh

  • Hero Member
  • *****
  • Karma: 77
  • Posts: 510
  • Awesome day :)
    • cms-zen
Re: Approval of comments doesn't work
« Reply #6 on: March 06, 2012, 08:07:55 AM »

thank you,
comments will be back soon, with some new photos.

awesome day