Приветствую! Посмотрел в логе есть несколько ошибок, помогите исправить пожалуйста, спасибо!
error.log
[Sun Jan 27 08:42:09.476142 2019] [fcgid:warn] [pid 28535] mod_fcgid: stderr: PHP Notice: Only variables should be passed by reference in /var/www/mysite/data/www/mysite.io/core/Classes/Lang.php on line 90
[Sun Jan 27 08:42:09.476145 2019] [fcgid:warn] [pid 28535] mod_fcgid: stderr: PHP Notice: Undefined offset: 1 in /var/www/mysite/data/www/mysite.io/core/Classes/Router.php on line 97
[Sun Jan 27 08:42:18.984905 2019] [fcgid:warn] [pid 28533] mod_fcgid: stderr: PHP Notice: Undefined offset: 1 in /var/www/mysite/data/www/mysite.io/core/Classes/Router.php on line 29, referer: mysite.io/en/
[Sun Jan 27 08:42:18.984922 2019] [fcgid:warn] [pid 28533] mod_fcgid: stderr: PHP Notice: Undefined offset: 1 in /var/www/mysite/data/www/mysite.io/core/Classes/Router.php on line 97, referer: mysite.io/en/
[Sun Jan 27 08:42:26.384808 2019] [fcgid:warn] [pid 28531] mod_fcgid: stderr: PHP Notice: Undefined offset: 1 in /var/www/mysite/data/www/mysite.io/core/Classes/Router.php on line 29, referer: mysite.io/ru/
[Sun Jan 27 08:42:26.384831 2019] [fcgid:warn] [pid 28531] mod_fcgid: stderr: PHP Notice: Undefined offset: 1 in /var/www/mysite/data/www/mysite.io/core/Classes/Router.php on line 97, referer: mysite.io/ru/
Файл Router.php
protected function prepare()
{
$url = trim($this->server->get(static::SERVER_KEY), '/');
@list($root, $query) = explode('?', $url);
list($lang, $requestUrl) = explode('/', $root, 2); //line 29
if($this->server->is('POST')) {
$requestUrl = $lang;
} else {
if(in_array($lang, [Lang::LANG_RU, Lang::LANG_EN]) && $lang == config('language.default')) {
header('Location: /' . $requestUrl);
die;
}
if(
!in_array($lang, [Lang::LANG_RU, Lang::LANG_EN])
) {
$requestUrl = $url;
$lang = config('language.default');
}
if(
in_array($lang, [Lang::LANG_RU, Lang::LANG_EN])
&& $lang != lang()->lang()
) {
lang()->setLanguage($lang);
if($lang == config('language.default')) {
header('Location: /' . $requestUrl);
} else {
header('Location: /' . lang()->lang() . '/' . $requestUrl);
}
die;
}
}
$this->url = $requestUrl;
$this->full_url = $url;
$this->query = $query;
$this->params = $this->parseQuery($query);
$this->arguments = $this->parseArguments($url);
}
protected function parseArguments($url)
{
$segments = explode('/', $url);
$data = [];
foreach ($segments as $segment) {
if(in_array($segment, [Lang::LANG_RU, Lang::LANG_EN])) { //line 97
continue;
}
$data[] = $segment;
}
return $data;
}
Файл Lang.php
protected function parseFromRaw($raw)
{
$lang = array_shift(explode(',', $raw)); //line 90
return in_array($lang, array_keys($this->getLanguagesList()))
? $lang
: $this->defaultLanguage();
}