Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

修改默认过滤方法使用内置的函数而非htmlentities以兼容PHP8.1 #16

Open
wants to merge 1 commit into
base: 2.0
Choose a base branch
from

Conversation

augushong
Copy link

默认的过滤方法为htmlentities,然而在PHP8.1中,这个函数的表现发生了变化,第一个参数只接受string,
需要在类库中内置一个自定义的函数,然后调用htmlentities.

if (!function_exists('tp_htmlentities')) {
    function tp_htmlentities($string)
    {
        if (is_null($string)) {
            $string = '';
        }

        return htmlentities($string);
    }
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant