fredgolm1 / php-censure

Automatically exported from code.google.com/p/php-censure
0 stars 0 forks source link

Избавится от ReflectionTypeHint! #5

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
Эта глючная библиотека совершенно 
безполезна и только мешает:
$mat = Text_Censure::parse($text,
            $delta = 3,
            $continue = "\xe2\x80\xa6",
            $is_html = false);

Выдаёт:

PHP Error [512]
Argument 2 passed to Text_Censure::parse() must be an string, integer given, 
called in Z:\home\xu.su.loc\www\send.php on line 32 
and defined in Z:\home\xu.su.loc\www\lib\censure\Text\Censure.php on line 52 
(Z:\home\xu.su.loc\www\lib\censure\ReflectionTypeHint.php:107)
#0 Z:\home\xu.su.loc\www\lib\censure\Text\Censure.php(60): isValid()

Original issue reported on code.google.com by an...@elfet.ru on 12 Feb 2012 at 6:15

GoogleCodeExporter commented 9 years ago
Определите типы напрямую. Вставьте после 
"function parse(
        $s,
        $delta = 3,
        $continue = "o",
        $is_html = true,
        $replace = 'OOO',
        $charset = 'UTF-8')
    {
" следующий код:
$s = (string) $s;
$delta = (string) $delta;
$continue = (string) $continue;
$is_html = (bool) $is_html; 

в файле Censure.php

Original comment by qazomardok@gmail.com on 7 Jan 2015 at 2:31