Добрый вечер.
Перестал работать код плагина вордпресс.
В debian 7 раньше работал в php5.
В ubuntu не работал ни когда ни php5 ни php7.
Понял что зависит от настроек php.
Подскажите что делать.
/* Обработка категорий */
$content = loadFilePart($f, '</categories>', $xmlFileFullPath);
$ps = mb_strpos($content, '<categories>', 0, 'utf-8');
$pe = mb_strpos($content, '</categories>', 0, 'utf-8');
if ($ps && $pe) {
$contentCats = mb_substr($content, $ps + mb_strlen('<categories>', 'utf-8'), $pe - $ps - mb_strlen('<categories>', 'utf-8'), 'utf-8');
$content = mb_substr($content, $pe + mb_strlen('</categories>', 'utf-8'), mb_strlen($content, 'utf-8'), 'utf-8');
$cats = array();
while (true) {
$ps = mb_strpos($contentCats, '<category', 0, 'utf-8');
$pe = mb_strpos($contentCats, '</category>', 0, 'utf-8');
if ($ps !== false && $pe !== false) {
$category = mb_substr($contentCats, $ps + mb_strlen('<category', 'utf-8'), $pe - $ps - mb_strlen('<category', 'utf-8'), 'utf-8');
$contentCats = mb_substr($contentCats, $pe + mb_strlen('</category>', 'utf-8'), mb_strlen($contentCats, 'utf-8'), 'utf-8');
$matches = array();
preg_match('/ id="(\d+)"/', $category, $matches);
$id = $matches[1];
$ps = mb_strpos($category, '>', 0, 'utf-8');
$title = mb_substr($category, $ps + 1, mb_strlen($category, 'utf-8'), 'utf-8');
$title = str_replace('<![CDATA[', '', $title);
$title = str_replace(']]>', '', $title);
$cat = array(
'id' => $id,
'title' => $title
);
if (preg_match('/parentId="(\d+)"/', $category, $matches)) {
$parentId = $matches[1];
$cat['parent_id'] = $parentId;
}
$cats[] = $cat;
} else break;
}
foreach ($cats as $item)
{
$item['title'] = mysqli_real_escape_string($item['title']);
importTerm($item);
}
}