PHP Warning: ltrim() Problem in WordPress (formatting.php) related to WooCommerc
-
Hi,
I am writing this in shell;
sudo tail -100 /var/log/apache2/error.log
And, I saw this;
……
[Sun Feb 14 09:42:06.873076 2021] [php7:warn] [pid 1968] [client 82.222.237.83:36955] PHP Warning: ltrim() expects parameter 1 to be string, object given in /var/www/html/wp-includes/formatting.php on line 4314
[Sun Feb 14 09:42:06.873149 2021] [php7:warn] [pid 1968] [client 82.222.237.83:36955] PHP Warning: ltrim() expects parameter 1 to be string, object given in /var/www/html/wp-includes/formatting.php on line 4314
…
I’m going to the relevant code. –> /var/www/html/wp-includes/formatting.php on line 4314;
function esc_url( $url, $protocols = null, $_context = 'display' ) { $original_url = $url; if ( '' === $url ) { return $url; } $url = str_replace( ' ', '%20', ltrim( $url ) ); $url = preg_replace( '|[^a-z0-9-~+_.?#=!&;,/:%@$\|*\'()\[\]\\x80-\\xff]|i', '', $url ); if ( '' === $url ) { return $url; } if ( 0 !== stripos( $url, 'mailto:' ) ) { $strip = array( '%0d', '%0a', '%0D', '%0A' ); $url = _deep_replace( $strip, $url ); } $url = str_replace( ';//', '://', $url );
on line 4314;
$url = str_replace( ' ', '%20', ltrim( $url ) );
AND,
I’ve made all the plugins passive. The error is gone. I’ve opened the plugins in turn. I get this error when I open the Woocommerce plugin.
I did not understand. My error page is full of this. I could not figure out despite my research. Can you help me?
Note: Ubuntu 20.04, WordPress, Digitalocean
Healthy days, Best regards.
The page I need help with: [log in to see the link]
- The topic ‘PHP Warning: ltrim() Problem in WordPress (formatting.php) related to WooCommerc’ is closed to new replies.