to better switch method as an example on how to do.

But, as we have some more plugins out there, the old method has moved into our smarty BC
This commit is contained in:
Ian 2013-01-24 15:45:20 +01:00
parent fb19176b71
commit f7a6281292

View file

@ -193,7 +193,7 @@ class serendipity_event_autotitle extends serendipity_event
if (!is_object($serendipity['smarty'])) {
serendipity_smarty_init();
}
if (method_exists($serendipity['smarty'], 'get_template_vars')) {
if( !defined('Smarty::SMARTY_VERSION') ) {
//handle with Smarty version 2
$own_charset = $serendipity['smarty']->get_template_vars('head_charset');
} else {
@ -253,8 +253,7 @@ class serendipity_event_autotitle extends serendipity_event
}
function getCharset($page) {
preg_match( '@<meta\s+http-equiv="Content-Type"\s+content="([\w/]+)(;\s+charset=([^\s"]+))?@i',
$page, $matches );
preg_match( '@<meta\s+http-equiv="Content-Type"\s+content="([\w/]+)(;\s+charset=([^\s"]+))?@i', $page, $matches );
if (isset($matches[3])) {
return $matches[3];
} else {