typecho/typecho · error · IXR\Exception

33

33

Error message

这个目标地址不存在

What it means

Error "这个目标地址不存在" thrown in typecho/typecho.

Source

Thrown at var/Widget/XmlRpc.php:1687

    public function pingbackPing(string $source, string $target): int
    {
        /** 检查目标地址是否正确*/
        $pathInfo = Common::url(substr($target, strlen($this->options->index)), '/');
        $post = Router::match($pathInfo);

        /** 检查源地址是否合法 */
        $params = parse_url($source);
        if (false === $params || !in_array($params['scheme'], ['http', 'https'])) {
            throw new Exception(_t('源地址服务器错误'), 16);
        }

        if (!Common::checkSafeHost($params['host'])) {
            throw new Exception(_t('源地址服务器错误'), 16);
        }

        /** 这样可以得到cid或者slug*/
        if (!($post instanceof Archive) || !$post->have() || !$post->is('single')) {
            throw new Exception(_t('这个目标地址不存在'), 33);
        }

        if ($post) {
            /** 检查是否可以ping*/
            if ($post->allowPing) {

                /** 现在可以ping了,但是还得检查下这个pingback是否已经存在了*/
                $pingNum = $this->db->fetchObject($this->db->select(['COUNT(coid)' => 'num'])
                    ->from('table.comments')
                    ->where(
                        'table.comments.cid = ? AND table.comments.url = ? AND table.comments.type <> ?',
                        $post->cid,
                        $source,
                        'comment'
                    ))->num;

                if ($pingNum <= 0) {
                    try {

View on GitHub (pinned to 56f4c6f339)

When it happens

Trigger: Thrown at var/Widget/XmlRpc.php:1687 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of typecho/typecho@56f4c6f339 (2026-08-21). Data as JSON: /api/errors/60769f68b23ef9f7. Report an issue: GitHub.