印刷
カテゴリ: サーバ運用メモ
参照数: 235

CMS(Joomla)を管理画面からアップデートを実施するとアップデート完了後に、Fatal error: Call to undefined function iconv()エラーが表示される。

 


 

環境
FreeBSD 12.2-RELEASE r366954 GENERIC amd64 
Apacheバージョン:Apache/2.4.46 (FreeBSD)
5.5.5-10.5.8-MariaDB
PHP7.4.13
Joomla! 3.9.28 Stable


 

下記、ファイルを修正で解決!

# vi /usr/local/www/apache24/data/joomla/administrator/components/com_finder/helpers/indexer/parser/html.php

 

下記の  $input = iconv('utf-8', 'utf-8//IGNORE', $input);    を#で、コメントする

<?php
/**
 * @package     Joomla.Administrator
 * @subpackage  com_finder
 *
 * @copyright   Copyright (C) 2005 - 2020 Open Source Matters, Inc. All rights reserved.
 * @license     GNU General Public License version 2 or later; see LICENSE.txt
 */

defined('_JEXEC') or die;

JLoader::register('FinderIndexerParser', dirname(__DIR__) . '/parser.php');

/**
 * HTML Parser class for the Finder indexer package.
 *
 * @since  2.5
 */
class FinderIndexerParserHtml extends FinderIndexerParser
{
        /**
         * Method to parse input and extract the plain text. Because this method is
         * called from both inside and outside the indexer, it needs to be able to
         * batch out its parsing functionality to deal with the inefficiencies of
         * regular expressions. We will parse recursively in 2KB chunks.
         *
         * @param   string  $input  The input to parse.
         *
         * @return  string  The plain text input.
         *
         * @since   2.5
         */
        public function parse($input)
        {
                // Strip invalid UTF-8 characters.
              # $input = iconv('utf-8', 'utf-8//IGNORE', $input);

                // Remove anything between <head> and </head> tags.  Do this first
                // because there might be <script> or <style> tags nested inside.
                $input = $this->removeBlocks($input, '<head>', '</head>');

                // Convert <style> and <noscript> tags to <script> tags
                // so we can remove them efficiently.
                $search = array(
                        '<style', '</style',
                        '<noscript', '</noscript',
                );
                $replace = array(
                        '<script', '</script',
                        '<script', '</script',
                );
                $input = str_replace($search, $replace, $input);

                // Strip all script blocks.
                $input = $this->removeBlocks($input, '<script', '</script>');

                // Decode HTML entities.
                $input = html_entity_decode($input, ENT_QUOTES, 'UTF-8');

                // Convert entities equivalent to spaces to actual spaces.
                $input = str_replace(array('&nbsp;', '&#160;'), ' ', $input);

                // Add a space before both the OPEN and CLOSE tags of BLOCK and LINE BREAKING elements,
                // e.g. 'all<h1><em>m</em>obile  List</h1>' will become 'all mobile  List'
                $input = preg_replace('/(<|<\/)(' .
                        'address|article|aside|blockquote|br|canvas|dd|div|dl|dt|' .
                        'fieldset|figcaption|figure|footer|form|h1|h2|h3|h4|h5|h6|header|hgroup|hr|li|' .
                        'main|nav|noscript|ol|output|p|pre|section|table|tfoot|ul|video' .
                        ')\b/i', ' $1$2', $input
                );

                // Strip HTML tags.
                $input = strip_tags($input);

                return parent::parse($input);
        }

以下、省略

 

以上