php-censure icon indicating copy to clipboard operation
php-censure copied to clipboard

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

Open GoogleCodeExporter opened this issue 9 years ago • 1 comments

Эта глючная библиотека совершенно 
безполезна и только мешает:
$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 [email protected] on 12 Feb 2012 at 6:15

GoogleCodeExporter avatar Nov 18 '15 14:11 GoogleCodeExporter

Определите типы напрямую. Вставьте после 
"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 [email protected] on 7 Jan 2015 at 2:31

GoogleCodeExporter avatar Nov 18 '15 14:11 GoogleCodeExporter