Решение для компонента sh404sef (практически любых версий)
Откройте файл
\administrator\components\com_sh404sef\sh404sef.class.php
И замените функции
shSortURL() и
shGETGarbageCollect() на соответствующие варианты ниже
- function shSortURL($string)
- {
- // URL must be like : index.php?param2=xxx&option=com_ccccc¶m1=zzz
- if ((substr($string, 0, 10) !== 'index.php?')) {
- return $string;
- }
- // URL returned will be ! index.php?option=com_ccccc¶m1=zzz¶m2=xxx
- $ret = '';
- $st = str_replace('&', '&', $string);
- $st = str_replace('index.php', '', $st);
- $st = str_replace('?', '', $st);
- parse_str($st, $shTmpVars);
- $shVars = shUrlEncodeDeep($shTmpVars);
- if (count($shVars) > 0) {
- ksort($shVars); // sort URL array
- $shNewString = '';
- $ret = 'index.php?';
- foreach ($shVars as $key => $value) {
- if (strtolower($key) != 'option') {
- // option is always first parameter
- if (is_array($value)) {
- foreach ($value as $k => $v) {
- // hack start
- if (is_array($v)) {
- foreach ($v as $innerKey => $innerValue) {
- if (is_array($innerValue)) {
- foreach ($innerValue as $innerKey2 => $innerValue2) {
- $shNewString .= '&' . $key . '[' . $k . '][' . $innerKey . '][' . $innerKey2 . ']=' . $innerValue2;
- }
- } else {
- $shNewString .= '&' . $key . '[' . $k . '][' . $innerKey . ']=' . $innerValue;
- }
- }
-
- } else {
- $shNewString .= '&' . $key . '[' . $k . ']=' . $v;
- }
- // hack end
-
- // original code
- // $shNewString .= '&' . $key . '[' . $k . ']=' . $v;
- }
- } else {
- $shNewString .= '&' . $key . '=' . $value;
- }
- } else {
- $ret .= $key . '=' . $value;
- }
- }
- $ret .= $ret == 'index.php?' ? JString::ltrim($shNewString, '&') : $shNewString;
- }
-
- return $ret;
- }
- function shGETGarbageCollect()
- {
- // V 1.2.4.m moved to main component from plugins
- // builds up a string using all remaining GET parameters, to be appended to the URL without any sef transformation
- // those variables passed litterally must be removed from $string as well, so that they are not stored in DB
- global $shGETVars;
- $sefConfig = Sh404sefFactory::getConfig();
- if (!$sefConfig->shAppendRemainingGETVars || empty($shGETVars)) return '';
- $ret = '';
- ksort($shGETVars);
- foreach ($shGETVars as $param => $value) {
- if (is_array($value)) {
- foreach ($value as $k => $v) {
- // hack start
- if (is_array($v)) {
- foreach ($v as $innerKey => $innerValue) {
-
- if (is_array($innerValue)) {
- foreach ($innerValue as $innerKey2 => $innerValue2) {
- $ret .= '&' . $param . '[' . $k . '][' . $innerKey . '][' . $innerKey2 . ']=' . $innerValue2;
- }
- } else {
- $ret .= '&' . $param . '[' . $k . '][' . $innerKey . ']=' . $innerValue;
- }
-
- }
-
- } else {
- $ret .= '&' . $param . '[' . $k . ']=' . $v;
- }
- // hack end
-
- // original code
- // $ret .= '&' . $param . '[' . $k . ']=' . $v;
- }
- } else {
- $ret .= '&' . $param . '=' . $value;
- }
-
- }
- return $ret;
- }
Если вы используете "функции безопасности" в компонентеТа же самая проблема, компонент игнорирует вложенные параметры.
В итоге появляются глупые ошибки вида "Notice / Array to string conversion" (камень в огород sh404sef)
Откройте файл \components\com_sh404sef\shSec.php
найди функцию shDoSecurityChecks()
и добавьте код в месте, указанном на скриншоте

- // hack start
- if (is_array($value)) {
- continue;
- }
- // hack end