Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
505 views
in Technique[技术] by (71.8m points)

PHP Warning: preg_match() expects parameter 2 to be string, array given in wp-includes/class-simplepie.php on line 2620

The server keeps returning these errors:

[Mon Jan 25 13:38:14.133045 2021] [php7:warn] [pid 18879] [client 13.66.139.39:26051] PHP Warning: preg_match() expects parameter 2 to be string, array given in /wp-includes/class-simplepie.php on line 2620

if (isset($this->data['headers']['link']) && preg_match('/<([^>]+)>; rel='.preg_quote($rel).'/', $this->data['headers']['link'], $match))
        {   
            return array($match[1]);
        }
        else if (isset($this->data['links'][$rel]))
        {
            return $this->data['links'][$rel];
        }
        return null;
    }

Can someone please explain how to fix this? The $this->data['headers']['link'] is causing the error since it's not a string and giving the preg_match an array instead.

question from:https://stackoverflow.com/questions/65892267/php-warning-preg-match-expects-parameter-2-to-be-string-array-given-in-wp-in

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)
Waitting for answers

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...