Open mateuszfigas opened 1 year ago
I seem to have a solution to this problem. The errors are gone, but it would be useful if someone else verified the operation of this code.
In _inc/plugins/googleseo/plugin.php Change this:
if($mybb->config['database']['encoding'] != 'utf8mb4')
{
$warning[] = $lang->sprintf($lang->googleseo_plugin_warn_encoding,
$mybb->config['database']['encoding']);
}
For:
if (isset($mybb->config['database']) && is_array($mybb->config['database']) &&
isset($mybb->config['database']['encoding']) && $mybb->config['database']['encoding'] != 'utf8mb4')
{
$warning[] = $lang->sprintf($lang->googleseo_plugin_warn_encoding, $mybb->config['database']['encoding']);
}
And change this:
if($settings['google_seo_redirect'])
{
$success[] = $lang->googleseo_plugin_redirect;
if(!$settings['google_seo_url'])
{
$warning[] = $lang->googleseo_plugin_redirect_warn_url;
}
$current_url = google_seo_redirect_current_url();
$pos = my_strpos($current_url, "/{$config['admin_dir']}/index.php");
if($pos)
{
$current_url = my_substr($current_url, 0, $pos);
}
if(!$settings['bburl'] || $settings['bburl'] != $current_url)
{
$warning[] = $lang->sprintf($lang->googleseo_plugin_redirect_warn_bburl,
htmlspecialchars($settings['bburl'], ENT_COMPAT, "UTF-8"),
htmlspecialchars($current_url), ENT_COMPAT, "UTF-8");
}
}
else
{
$error[] = $lang->googleseo_plugin_redirect;
}
For this:
if(isset($settings['google_seo_redirect']) && is_array($settings['google_seo_redirect']))
{
if($settings['google_seo_redirect'])
{
$success[] = $lang->googleseo_plugin_redirect;
if(isset($settings['google_seo_url']) && !$settings['google_seo_url'])
{
$warning[] = $lang->googleseo_plugin_redirect_warn_url;
}
$current_url = google_seo_redirect_current_url();
$pos = my_strpos($current_url, "/{$config['admin_dir']}/index.php");
if($pos !== false)
{
$current_url = my_substr($current_url, 0, $pos);
}
if(isset($settings['bburl']) && (!$settings['bburl'] || $settings['bburl'] != $current_url))
{
$warning[] = $lang->sprintf($lang->googleseo_plugin_redirect_warn_bburl,
htmlspecialchars($settings['bburl'], ENT_COMPAT, "UTF-8"),
htmlspecialchars($current_url), ENT_COMPAT, "UTF-8");
}
}
else
{
$error[] = $lang->googleseo_plugin_redirect;
}
}
I have some issues with this plugin and can't find resulution for this
Warning [2] Illegal string offset 'database' - Line: 110 - File: inc/plugins/google_seo/plugin.php PHP 5.6.40 (Linux)
Warning [2] Illegal string offset 'encoding' - Line: 110 - File: inc/plugins/google_seo/plugin.php PHP 5.6.40 (Linux)
Warning [2] Illegal string offset 'database' - Line: 113 - File: inc/plugins/google_seo/plugin.php PHP 5.6.40 (Linux)
Warning [2] Illegal string offset 'encoding' - Line: 113 - File: inc/plugins/google_seo/plugin.php PHP 5.6.40 (Linux)
Warning [2] Illegal string offset 'admin_dir' - Line: 153 - File: inc/plugins/google_seo/plugin.php PHP 5.6.40 (Linux)