caparuni Posted April 16, 2009 Share Posted April 16, 2009 saat kita saat kita input/import data kadang muncul error yang ga tawu alasannya... nah hal yang peling pertama harus di lakukan adalah... coba periksa mungkin ada kata yang di blacklist ama ps... bisa di liat .../classes/Db.php (line 49) private static $_blacklist = 'UNION|LOAD_FILE|OUTFILE|DUMPFILE|ESCAPED|TERMINATED|CASCADE|INFILE|X509|TRIGGER|REVOKE'; ini bakalan di cek dlm mode regex yah, jd kata tersebut dan berbagai varian/kombinasi nya, misalnya union, reunion, dsbgw abisin waktu ampir seminggu untuk cari tawu kenapa data import gw ga bisa2.... Link to comment Share on other sites More sharing options...
Ardian Yuli Setyanto Posted April 16, 2009 Share Posted April 16, 2009 Thanks atas banyak tips nya bro, maksud nya jangan sampai di product kita ada kata begituan atau code tersebut yg kita edit?Maaf aku belum pernah tukaran data pakai BO, biasanya pakai pma. Link to comment Share on other sites More sharing options...
caparuni Posted April 16, 2009 Author Share Posted April 16, 2009 jgn sampe di produk kita ada kata2 dlm blacklist... di field mana pun, mulai dr name, desc, meta, cms... smua pokoknya, cobain deh... yah kalo make pma ga ngaruh. nah kalo gw blom dpt jawaban knp ada blacklist ini & blom cobain kalo kata2 tsb diganti, kalo dah tawu nanti gw share deh. Link to comment Share on other sites More sharing options...
Ardian Yuli Setyanto Posted April 16, 2009 Share Posted April 16, 2009 Itu karena kata kata tadi merupakan reserved wordnya sql, jadi itu buat ngatasi biar ga syntax error. Tapi seharusnya di quote saja ga perlu di black list. Hanya analisa. Link to comment Share on other sites More sharing options...
caparuni Posted April 16, 2009 Author Share Posted April 16, 2009 yoi... maka na gw modif Db.php nyadari : public static function blacklist(&$query) { return eregi(self::$_blacklist, $query) ? true : false; } ke : public static function blacklist(&$query) { eregi_replace( "(self::$_blacklist)", "`\\1`", $query); return; } :: cmiiw :: Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now