tslocum / kusaba

This project is discontinued. Use TinyIB: https://gitlab.com/tslocum/TinyIB
0 stars 1 forks source link

after trying to by pass mb #3

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
i tried to bypass MB by doing this

Open up lib/gettext/gettext.inc.php

Replace

/**
 * Convert the given string to the encoding set by bind_textdomain_codeset.
 */
function _encode($text) {
    $source_encoding = mb_detect_encoding($text);
    $target_encoding = _get_codeset();
    if ($source_encoding != $target_encoding) {
        return mb_convert_encoding($text, $target_encoding, $source_encoding);
    }
    else {
        return $text;
    }
}

With

/**
 * Convert the given string to the encoding set by bind_textdomain_codeset.
 */
function _encode($text) {
    return $text;
}

after I did, i receive the following errors.

this appears in the main menu
(mysql): SELECT * FROM `events` WHERE `at` <= 1188775507
Error (0):

(mysql): SELECT `id` FROM `boards` LIMIT 1
Error (0):

(mysql): SELECT * FROM `sections` ORDER BY `order` ASC
Error (0):

(mysql): SELECT `name`, `desc`, `locked`, `trial`, `popular` FROM `boards`
WHERE `section` = 1 ORDER BY `order` ASC
Error (0):

(mysql): SELECT `name`, `desc`, `locked`, `trial`, `popular` FROM `boards`
WHERE `section` = 2 ORDER BY `order` ASC
Error (0):

(mysql): SELECT `name`, `desc`, `locked`, `trial`, `popular` FROM `boards`
WHERE `section` = 3 ORDER BY `order` ASC
Error (0):

(mysql): SELECT `id` FROM `boards` LIMIT 1
Error (0):

(mysql): SELECT * FROM `sections` ORDER BY `order` ASC
Error (0):

(mysql): SELECT `name`, `desc`, `locked`, `trial`, `popular` FROM `boards`
WHERE `section` = 1 ORDER BY `order` ASC
Error (0):

(mysql): SELECT `name`, `desc`, `locked`, `trial`, `popular` FROM `boards`
WHERE `section` = 2 ORDER BY `order` ASC
Error (0):

(mysql): SELECT `name`, `desc`, `locked`, `trial`, `popular` FROM `boards`
WHERE `section` = 3 ORDER BY `order` ASC
Error (0): 

this appears in at the head of the front page
(mysql): SELECT * FROM `events` WHERE `at` <= 1188775507
Error (0): 

(mysql): SELECT * FROM `news` ORDER BY `postedat` DESC
Error (0): 

and this appears in the watched thread box
(mysql): SELECT * FROM `events` WHERE `at` <= 1188775673
Error (0):

(mysql): SELECT `threadid` , `lastsawreplyid` FROM `watchedthreads` WHERE
`ip` = '76.102.41.9' AND `board` = 'b' ORDER BY `lastsawreplyid` DESC
Error (0):
None.

and this appears when trying to upload a file
(mysql): SELECT * FROM `events` WHERE `at` <= 1188775715
Error (0):

(mysql): SELECT `name` FROM `boards` WHERE `name` = 'b'
Error (0):

(mysql): SELECT * FROM `boards` WHERE `name` = 'b' LIMIT 1
Error (0):

(mysql): SELECT `maximagesize` FROM `boards` WHERE `name` = 'b' LIMIT 1
Error (0):

(mysql): SELECT filetypes.filetype FROM boards, filetypes, board_filetypes
WHERE boards.id = '4' AND board_filetypes.boardid = boards.id AND
board_filetypes.typeid = filetypes.id ORDER BY filetypes.filetype ASC;
Error (0):

(mysql): SELECT COUNT(DISTINCT `ipmd5`) FROM `posts_b` WHERE `IS_DELETED` = 0
Error (0):

(mysql): DELETE FROM `banlist` WHERE `until` != 0 AND `until` < 1188775715
Error (0):

(mysql): SELECT * FROM `banlist` WHERE `type` = '0' AND ( `ipmd5` =
'b630581e9e797a9286081100e130e7aa' OR `ipmd5` =
'd41d8cd98f00b204e9800998ecf8427e' ) LIMIT 1
Error (0):

(mysql): SELECT * FROM `banlist` WHERE `type` = '1'
Error (0):

(mysql): START TRANSACTION
Error (0):

(mysql): SELECT `postedat` FROM `posts_b` WHERE `parentid` != 0 AND `ipmd5`
= 'b630581e9e797a9286081100e130e7aa' ORDER BY `postedat` DESC LIMIT 1
Error (0):

(mysql): SELECT `postedat` FROM `posts_b` WHERE `parentid` = 0 AND `ipmd5`
= 'b630581e9e797a9286081100e130e7aa' ORDER BY `postedat` DESC LIMIT 1
Error (0):

(mysql): SELECT `bantime` , `description` FROM `bannedhashes` WHERE `md5` =
'390480aa5243dc13a3525607c53562c9' LIMIT 1
Error (0):

(mysql): SELECT * FROM `wordfilter`
Error (0):

Fatal error: Call to undefined function: mb_convert_encoding() in
/home/content/a/n/i/aniblock/html/inc/functions.php on line 1224

Original issue reported on code.google.com by Sventhek...@gmail.com on 2 Sep 2007 at 11:28

GoogleCodeExporter commented 9 years ago
Error (0) means no error.

Find in functions.php
    function ords_to_unistr($ords, $encoding = 'UTF-8'){

Replace with
    function ords_to_unistr($ords, $encoding = 'UTF-8'){
    if (!function_exists('mb_convert_encoding')) {
        return false;
    }

Original comment by tslocum on 3 Sep 2007 at 6:27

GoogleCodeExporter commented 9 years ago
Also find
    function unistr_to_ords($str, $encoding = 'UTF-8'){

Replace with
    function unistr_to_ords($str, $encoding = 'UTF-8'){
    if (!function_exists('mb_convert_encoding')) {
        return false;
    }

Original comment by tslocum on 3 Sep 2007 at 6:32

GoogleCodeExporter commented 9 years ago
works perfectly, thanks.

Original comment by Sventhek...@gmail.com on 3 Sep 2007 at 9:53