PHP Warning: strpos(): Empty needle

Posted in: Newsmag
Post count: 7

Hello,

I keep getting tons of error of PHP Warning: strpos(): Empty needle in /home/saklikum/public_html/wp-includes/plugin.php on line 649.

How can i fix? I give the code below. 649th line is if ( strpos( $file, $realdir ) === 0 )

——-
function plugin_basename( $file ) {
global $wp_plugin_paths;

// $wp_plugin_paths contains normalized paths.
$file = wp_normalize_path( $file );

arsort( $wp_plugin_paths );
foreach ( $wp_plugin_paths as $dir => $realdir ) {
if ( strpos( $file, $realdir ) === 0 ) {
$file = $dir . substr( $file, strlen( $realdir ) );
}
}

$plugin_dir = wp_normalize_path( WP_PLUGIN_DIR );
$mu_plugin_dir = wp_normalize_path( WPMU_PLUGIN_DIR );

$file = preg_replace(‘#^’ . preg_quote($plugin_dir, ‘#’) . ‘/|^’ . preg_quote($mu_plugin_dir, ‘#’) . ‘/#’,”,$file); // get relative path from plugins dir
$file = trim($file, ‘/’);
return $file;
}

Post count: 23312

Hello Gaehr,

Sorry for this but please notice that we do not have any bad reports in this regard until now. I have made some tests on my site with a fresh install and I did not get any type of error regarding this. The theme should work as expected. First of all, ensure that you are using a right PHP version which is tested with the theme, recommended is to use 7.1, ensure that you are using the latest theme version, if you are using some untested plugins, remove all of them and leave just only the plugins that come bundled with the theme core file, clear all of caches and check the results.

Thanks for your understanding!

Viewing 2 posts - 1 through 2 (of 2 total)
The forum ‘Newsmag’ is closed to new topics and replies.