Tried to update our website from Joomla 2.5.9 to 2.5.22 and it broke the site, giving me the error:
Fatal error: Cannot redeclare word_count() (previously declared in domain/templates/rt_momentum/overrides/mod_rokgallery/templates/slideshow/default.php:9) domain/templates/rt_momentum/overrides/mod_rokgallery/templates/slideshow/default.php on line 24
The code it refers to is this block (running from line 9-24):
function word_count($str, $asArray = 0){
$count = preg_match_all("/\d{1,}|\p{L}[\p{L}\p{Mn}\p{Pd}'\x{2019}]*/u", $str, $matches);
if ($asArray == 2){
$positions = array();
$cursor = 0;
foreach($matches[0] as $value){
$positions[$cursor] = $value;
$cursor += strlen($value) + 1;
}
return $positions;
} else {
return $count;
}
}
Site support have tried to help, but referred me here.
Any help greatly appreciated!
Scott