From 94febec921499c56e78b664933b50dc2b03e62d6 Mon Sep 17 00:00:00 2001 From: vargenau Date: Tue, 2 Apr 2013 13:51:35 +0000 Subject: [PATCH] Use HTML 5 DOCTYPE; force CHARSET=utf-8 git-svn-id: svn://svn.code.sf.net/p/phpwiki/code/trunk@8739 96ab9672-09ca-45d6-a79d-3d69d39ca109 --- config/config-default.ini | 1 - config/config-dist.ini | 28 ---------------- configurator.php | 6 ---- lib/IniConfig.php | 34 +++----------------- lib/MailNotify.php | 2 +- lib/RssWriter.php | 4 --- lib/Template.php | 2 +- lib/WikiDB/backend/ADODB_mysql.php | 11 +------ lib/WikiDB/backend/PDO_mysql.php | 11 +------ lib/WikiDB/backend/PearDB_mysql.php | 11 +------ lib/WikiPlugin.php | 2 +- lib/WikiTheme.php | 1 - lib/WikiUser/LDAP.php | 1 - lib/WysiwygEdit/Wikiwyg.php | 12 ------- lib/XmlElement.php | 10 ++---- lib/XmlParser.php | 2 +- lib/config.php | 4 +-- lib/display.php | 17 ++-------- lib/editpage.php | 2 +- lib/loadsave.php | 17 ---------- lib/plugin/EditMetaData.php | 2 +- lib/plugin/ExternalSearch.php | 2 +- lib/plugin/GooglePlugin.php | 2 +- lib/plugin/LinkDatabase.php | 4 +-- lib/plugin/LinkSearch.php | 2 +- lib/plugin/PageDump.php | 7 +--- lib/plugin/RecentChanges.php | 5 +-- lib/plugin/RssFeed.php | 5 +-- lib/plugin/SemanticSearch.php | 4 +-- lib/plugin/SemanticSearchAdvanced.php | 2 +- lib/plugin/SpellCheck.php | 3 +- lib/plugin/SystemInfo.php | 2 +- lib/plugin/WikiForm.php | 2 +- lib/plugin/WikiFormRich.php | 2 +- lib/plugin/_WikiTranslation.php | 12 ------- lib/stdlib.php | 37 ---------------------- lib/upgrade.php | 6 ++-- lib/ziplib.php | 14 -------- pgsrc/Help%2FTextFormattingRules | 10 +----- tests/unit/test.php | 2 +- themes/Crao/templates/editpage.tmpl | 2 +- themes/Crao/templates/head.tmpl | 2 +- themes/Crao/templates/htmldump.tmpl | 7 ++-- themes/Portland/templates/editpage.tmpl | 2 +- themes/Sidebar/templates/frame-left.tmpl | 7 ++-- themes/Wordpress/templates/editpage.tmpl | 2 +- themes/Wordpress/templates/signin.tmpl | 2 +- themes/default/templates/addcomment.tmpl | 2 +- themes/default/templates/dialog.tmpl | 7 ++-- themes/default/templates/editpage.tmpl | 2 +- themes/default/templates/forumadd.tmpl | 2 +- themes/default/templates/login.tmpl | 2 +- themes/default/templates/redirect.tmpl | 2 +- themes/default/templates/wikiforum.tmpl | 2 +- themes/fusionforge/templates/editpage.tmpl | 2 +- themes/wikilens/templates/head.tmpl | 2 +- 56 files changed, 58 insertions(+), 292 deletions(-) diff --git a/config/config-default.ini b/config/config-default.ini index aad1fccff..c13b8e5ed 100644 --- a/config/config-default.ini +++ b/config/config-default.ini @@ -128,7 +128,6 @@ ALLOW_IMAP_LOGIN = false THEME = Sidebar ; DEFAULT_LANGUAGE = -CHARSET = utf-8 WIKI_PGSRC = pgsrc DEFAULT_WIKI_PGSRC = pgsrc ; untranslated pgsrc pages to always include diff --git a/config/config-dist.ini b/config/config-dist.ini index 339bb28e9..765d0acfc 100644 --- a/config/config-dist.ini +++ b/config/config-dist.ini @@ -904,33 +904,6 @@ THEME = Sidebar ; random heavy images: ;THEME = Hawaiian -; Select a valid charset name to be inserted into the xml/html pages, -; and to reference links to the stylesheets (css). For more info see: -; http://www.iana.org/assignments/character-sets. Note that PhpWiki -; has been extensively tested only with the latin1 (iso-8859-1) -; and utf-8 character sets. -; -; If you change the default with existing pages, -; PhpWiki may not work properly and will require modifications in all existing pages. -; You'll have to dump the old pages with the old charset -; and import it into the new one after having changed the charset. -; Currently we support utf-8 for all languages, euc-jp for ja -; and iso-8859-1 for all langs except ja and zh. Changing languages (UserPreferences) -; from one charset to another will not work! -; -; Character sets similar to iso-8859-1 may work with little or no -; modification depending on your setup. The database must also -; support the same charset, and of course the same is true for the -; web browser. euc-jp and utf-8 works ok, but only is mbstring is used. -CHARSET = utf-8 - -; Most exotic charsets are not supported by htmlspecialchars, which prints a warning: -; "charset `bla' not supported, assuming iso-8859-1" -; Even on simple 8bit charsets, where just <>& need to be replaced. -; See php-src:/ext/standard/html.c -; We can ignore these warnings then. -;IGNORE_CHARSET_NOT_SUPPORTED_WARNING = true - ; Select your language/locale - Default language is "" for auto-detection. ; Available languages: ; English "en" (English - HomePage) @@ -945,7 +918,6 @@ CHARSET = utf-8 ; ; If you set DEFAULT_LANGUAGE to the empty string, the users ; preferred language as determined by the browser setting will be used. -; Japanese and Chinese require CHARSET=utf-8 ;DEFAULT_LANGUAGE = en ; WIKI_PGSRC -- specifies the source for the initial page contents of diff --git a/configurator.php b/configurator.php index 46d42f551..00a9d9979 100644 --- a/configurator.php +++ b/configurator.php @@ -1333,12 +1333,6 @@ Or you may create your own, deriving from existing ones. THEME = blog (Kubrick) [experimental] "); -$properties["Character Set"] = - new _define_optional('CHARSET', 'utf-8'); - -$properties["Ignore Charset Not Supported Warning"] = - new _define_optional('IGNORE_CHARSET_NOT_SUPPORTED_WARNING'); - $properties["Language"] = new _define_selection_optional('DEFAULT_LANGUAGE', array('en' => "English", diff --git a/lib/IniConfig.php b/lib/IniConfig.php index 9fe1436e8..5a6bb0c5e 100644 --- a/lib/IniConfig.php +++ b/lib/IniConfig.php @@ -47,7 +47,7 @@ * (namespace pollution). (FusionForge, phpnuke, postnuke, phpBB2, carolina, ...) * Use one global $phpwiki object instead which holds the cfg vars, constants * and all other globals. - * (global $FieldSeparator, $charset, $WikiNameRegexp, $KeywordLinkRegexp; + * (global $FieldSeparator, $WikiNameRegexp, $KeywordLinkRegexp; * global $DisabledActions, $DBParams, $LANG, $AllActionPages) * * - Resurrect the larger "config object" code (in config/) so it'll aid the @@ -129,7 +129,6 @@ function IniConfig($file) if (!file_exists($file)) { // We need to DATA_PATH for configurator, or pass the posted values // somewhow to the script - $GLOBALS['charset'] = 'utf-8'; include_once(dirname(__FILE__) . "/install.php"); run_install("_part1"); if (!defined("_PHPWIKI_INSTALL_RUNNING")) @@ -147,7 +146,7 @@ function IniConfig($file) 'COOKIE_EXPIRATION_DAYS', 'COOKIE_DOMAIN', 'PASSWORD_LENGTH_MINIMUM', 'USER_AUTH_POLICY', 'GROUP_METHOD', - 'EDITING_POLICY', 'THEME', 'CHARSET', + 'EDITING_POLICY', 'THEME', 'WIKI_PGSRC', 'DEFAULT_WIKI_PGSRC', 'ALLOWED_PROTOCOLS', 'INLINE_IMAGES', 'SUBPAGE_SEPARATOR', /*'KEYWORDS',*/ // extra logic: @@ -572,7 +571,6 @@ function IniConfig($file) function _ignore_unknown_charset_warning(&$error) { - //htmlspecialchars(): charset `iso-8859-2' not supported, assuming iso-8859-1 if (preg_match('/^htmlspecialchars\(\): charset \`.+\' not supported, assuming iso-8859-1/', $error->errstr) ) { @@ -585,35 +583,13 @@ function _ignore_unknown_charset_warning(&$error) // moved from lib/config.php [1ms] function fixup_static_configs($file) { - global $FieldSeparator, $charset, $WikiNameRegexp, $AllActionPages; + global $FieldSeparator, $WikiNameRegexp, $AllActionPages; global $DBParams, $LANG, $ErrorManager; // init FileFinder to add proper include paths FindFile("lib/interwiki.map", true); - // "\x80"-"\x9f" (and "\x00" - "\x1f") are non-printing control - // chars in iso-8859-* - // $FieldSeparator = "\263"; // this is a superscript 3 in ISO-8859-1. // $FieldSeparator = "\xFF"; // this byte should never appear in utf-8 - // Get rid of constant. pref is dynamic and language specific - $charset = CHARSET; - // Disabled: Let the admin decide which charset. - //if (isset($LANG) and in_array($LANG,array('zh'))) - // $charset = 'utf-8'; - if (strtolower($charset) == 'utf-8') - $FieldSeparator = "\xFF"; - else - $FieldSeparator = "\x81"; - - // Some exotic charsets are not supported by htmlspecialchars, which just prints an E_WARNING. - // Even on simple 8bit charsets, where just <>& need to be replaced. For iso-8859-[2-4] e.g. - // See /ext/standard/html.c - // For performance reasons we require a magic constant to ignore this warning. - if (defined('IGNORE_CHARSET_NOT_SUPPORTED_WARNING') - and IGNORE_CHARSET_NOT_SUPPORTED_WARNING - ) { - $ErrorManager->pushErrorHandler - (new WikiFunctionCb('_ignore_unknown_charset_warning')); - } + $FieldSeparator = "\xFF"; // All pages containing plugins of the same name as the filename $ActionPages = explode(':', @@ -995,8 +971,6 @@ function fixup_dynamic_configs() } } // tell gettext not to use unicode. PHP >= 4.2.0. Thanks to Kai Krakow. - if (defined('CHARSET') and function_exists('bind_textdomain_codeset')) - @bind_textdomain_codeset("phpwiki", CHARSET); if ($LANG != 'en') textdomain("phpwiki"); if ($chback) { // change back diff --git a/lib/MailNotify.php b/lib/MailNotify.php index ba335593e..7b85245ff 100644 --- a/lib/MailNotify.php +++ b/lib/MailNotify.php @@ -203,7 +203,7 @@ class MailNotify $headers = "From: $from\r\n" . "Bcc: " . join(',', $emails) . "\r\n" . "MIME-Version: 1.0\r\n" . - "Content-Type: text/plain; charset=" . CHARSET . "; format=flowed\r\n" . + "Content-Type: text/plain; charset=UTF-8; format=flowed\r\n" . "Content-Transfer-Encoding: 8bit"; $ok = mail(($to = array_shift($emails)), diff --git a/lib/RssWriter.php b/lib/RssWriter.php index 7c5fdbbf2..018631183 100644 --- a/lib/RssWriter.php +++ b/lib/RssWriter.php @@ -3,10 +3,6 @@ * Code for creating RSS 1.0. */ -// Encoding for RSS output. -if (!defined('RSS_ENCODING')) - define('RSS_ENCODING', $GLOBALS['charset']); - /** * A class for writing RSS 1.0. * diff --git a/lib/Template.php b/lib/Template.php index feb4a94e0..c3d2e7633 100644 --- a/lib/Template.php +++ b/lib/Template.php @@ -145,7 +145,7 @@ class Template if (!isset($revision)) $revision = false; - global $WikiTheme, $charset; + global $WikiTheme; //$this->_dump_template(); $SEP = $WikiTheme->getButtonSeparator(); diff --git a/lib/WikiDB/backend/ADODB_mysql.php b/lib/WikiDB/backend/ADODB_mysql.php index da0e51c07..0ff8c3a8b 100644 --- a/lib/WikiDB/backend/ADODB_mysql.php +++ b/lib/WikiDB/backend/ADODB_mysql.php @@ -50,16 +50,7 @@ class WikiDB_backend_ADODB_mysql // esp. needed for utf databases if ($this->_serverinfo['version'] > 401.0) { - global $charset; - $aliases = array('iso-8859-1' => 'latin1', - 'utf-8' => 'utf8'); - //http://dev.mysql.com/doc/mysql/en/charset-connection.html - if (isset($aliases[strtolower($charset)])) { - // mysql needs special unusual names and doesn't resolve aliases - mysql_query("SET NAMES '" . $aliases[$charset] . "'"); - } else { - mysql_query("SET NAMES '$charset'"); - } + mysql_query("SET NAMES 'UTF-8'"); } } diff --git a/lib/WikiDB/backend/PDO_mysql.php b/lib/WikiDB/backend/PDO_mysql.php index 3cd8e7958..4461f8374 100644 --- a/lib/WikiDB/backend/PDO_mysql.php +++ b/lib/WikiDB/backend/PDO_mysql.php @@ -44,16 +44,7 @@ class WikiDB_backend_PDO_mysql } if ($this->_serverinfo['version'] > 401.0) { - global $charset; - $aliases = array('iso-8859-1' => 'latin1', - 'utf-8' => 'utf8'); - //http://dev.mysql.com/doc/mysql/en/charset-connection.html - if (isset($aliases[strtolower($charset)])) { - // mysql needs special unusual names and doesn't resolve aliases - mysql_query("SET NAMES '" . $aliases[$charset] . "'"); - } else { - mysql_query("SET NAMES '$charset'"); - } + mysql_query("SET NAMES 'UTF-8'"); } } diff --git a/lib/WikiDB/backend/PearDB_mysql.php b/lib/WikiDB/backend/PearDB_mysql.php index d14e7f3dc..5cb7ab528 100644 --- a/lib/WikiDB/backend/PearDB_mysql.php +++ b/lib/WikiDB/backend/PearDB_mysql.php @@ -29,16 +29,7 @@ class WikiDB_backend_PearDB_mysql } // esp. needed for utf databases if ($this->_serverinfo['version'] > 401.0) { - global $charset; - $aliases = array('iso-8859-1' => 'latin1', - 'utf-8' => 'utf8'); - //http://dev.mysql.com/doc/mysql/en/charset-connection.html - if (isset($aliases[strtolower($charset)])) { - // mysql needs special unusual names and doesn't resolve aliases - mysql_query("SET NAMES '" . $aliases[strtolower($charset)] . "'"); - } else { - mysql_query("SET NAMES '$charset'"); - } + mysql_query("SET NAMES 'UTF-8'"); } } } diff --git a/lib/WikiPlugin.php b/lib/WikiPlugin.php index 19106ae06..0d4dcaad5 100644 --- a/lib/WikiPlugin.php +++ b/lib/WikiPlugin.php @@ -292,7 +292,7 @@ class WikiPlugin $form = HTML::form(array('action' => WikiURL($args['targetpage']), 'method' => $args['method'], 'class' => $args['class'], - 'accept-charset' => $GLOBALS['charset'])); + 'accept-charset' => 'UTF-8')); if (!USE_PATH_INFO) { $pagename = $request->get('pagename'); $form->pushContent(HTML::input(array('type' => 'hidden', diff --git a/lib/WikiTheme.php b/lib/WikiTheme.php index f379ea69c..47e613d09 100644 --- a/lib/WikiTheme.php +++ b/lib/WikiTheme.php @@ -1137,7 +1137,6 @@ class WikiTheme return HTML(); $link = HTML::link(array('rel' => $is_alt ? 'alternate stylesheet' : 'stylesheet', 'type' => 'text/css', - 'charset' => $GLOBALS['charset'], 'href' => $this->_findData($css_file))); if ($is_alt) $link->setAttr('title', $title); diff --git a/lib/WikiUser/LDAP.php b/lib/WikiUser/LDAP.php index 18aa59bd5..de6d3bd1f 100644 --- a/lib/WikiUser/LDAP.php +++ b/lib/WikiUser/LDAP.php @@ -188,7 +188,6 @@ class _LDAPPassUser // On wrong password the ldap server will return: // "Unable to bind to server: Server is unwilling to perform" // The @ catches this error message. - // If CHARSET=utf-8 the form should have already converted it to utf-8. if ($r = @ldap_bind($ldap, $dn, $submitted_password)) { // ldap_bind will return TRUE if everything matches // Optionally get the mail from LDAP diff --git a/lib/WysiwygEdit/Wikiwyg.php b/lib/WysiwygEdit/Wikiwyg.php index 1e9fb7b08..0e95d77c3 100644 --- a/lib/WysiwygEdit/Wikiwyg.php +++ b/lib/WysiwygEdit/Wikiwyg.php @@ -164,24 +164,12 @@ class WikiToHtml function replace_inside_html() { - global $charset; - $this->clean_links(); $this->clean_plugin_name(); $this->replace_known_plugins(); $this->replace_unknown_plugins(); // $this->replace_tags(); $this->clean_plugin(); - - if ($charset != 'utf-8') { - if ($charset == 'iso-8959-1') { - $this->_html = utf8_decode($this->_html); - } else { - // check for iconv support - loadPhpExtension("iconv"); - $this->_html = iconv("UTF-8", $charset, $this->_html); - } - } $this->html_content = $this->_html; } diff --git a/lib/XmlElement.php b/lib/XmlElement.php index 3801d6a7e..00154f9e0 100644 --- a/lib/XmlElement.php +++ b/lib/XmlElement.php @@ -195,7 +195,7 @@ class XmlContent function _quote($string) { if (!$string) return $string; - return htmlspecialchars($string, ENT_COMPAT, $GLOBALS['charset']); + return htmlspecialchars($string, ENT_COMPAT, 'UTF-8'); } } @@ -570,13 +570,7 @@ class FormattedText function XmlContent_quote($string) { if (!$string) return $string; - if (isset($GLOBALS['charset']) - and (!defined('IGNORE_CHARSET_NOT_SUPPORTED_WARNING') or !IGNORE_CHARSET_NOT_SUPPORTED_WARNING) - ) { - return htmlspecialchars($string, ENT_COMPAT, $GLOBALS['charset']); - } else { - return htmlspecialchars($string); - } + return htmlspecialchars($string, ENT_COMPAT, 'UTF-8'); } function PrintXML($val /* , ... */) diff --git a/lib/XmlParser.php b/lib/XmlParser.php index 6bcbf8d54..3424bacea 100644 --- a/lib/XmlParser.php +++ b/lib/XmlParser.php @@ -59,7 +59,7 @@ class XmlParser else $this->_parser = xml_parser_create(); - xml_parser_set_option($this->_parser, XML_OPTION_TARGET_ENCODING, $GLOBALS['charset']); + xml_parser_set_option($this->_parser, XML_OPTION_TARGET_ENCODING, 'UTF-8'); //This unfortunately does not work //xml_set_object($this->_parser, &$this); diff --git a/lib/config.php b/lib/config.php index 6f707b4c7..898d32c75 100644 --- a/lib/config.php +++ b/lib/config.php @@ -216,7 +216,7 @@ function guessing_setlocale($category, $locale) if ($res = setlocale($category, $try)) return $res; // Try with charset appended... - $try = $try . '.' . $GLOBALS['charset']; + $try = $try . '.' . 'UTF-8'; if ($res = setlocale($category, $try)) return $res; foreach (array(".", '@', '_') as $sep) { @@ -287,7 +287,7 @@ function update_locale($loc) // FIXME: Not all environments may support en_US? We should probably // have a list of locales to try. if (setlocale(LC_CTYPE, 0) == 'C') { - $x = setlocale(LC_CTYPE, 'en_US.' . $GLOBALS['charset']); + $x = setlocale(LC_CTYPE, 'en_US.UTF-8'); } else { $x = setlocale(LC_CTYPE, $setlocale); } diff --git a/lib/display.php b/lib/display.php index e0bb9fe9f..be14f7da8 100644 --- a/lib/display.php +++ b/lib/display.php @@ -119,7 +119,7 @@ function actionPage(&$request, $action) )); $html = GeneratePageAsXML($template, $pagename, $revision /*, array('VALID_LINKS' => $args['VALID_LINKS'])*/); - header("Content-Type: application/xhtml+xml; charset=" . $GLOBALS['charset']); + header("Content-Type: application/xhtml+xml; charset=UTF-8"); echo $html; } else { $pagelist = null; @@ -237,9 +237,8 @@ function displayPage(&$request, $template = false) } $format = $request->getArg('format'); if ($format == 'xml') { // fast ajax: include page content asynchronously - global $charset; header("Content-Type: text/xml"); - echo "<", "?xml version=\"1.0\" encoding=\"$charset\"?", ">\n"; + echo "<", "?xml version=\"1.0\" encoding=\"UTF-8\"?", ">\n"; // DOCTYPE html needed to allow unencoded entities like   without !CDATA[] echo '', "\n"; @@ -309,18 +308,6 @@ function displayPage(&$request, $template = false) $request->appendValidators(array('pagerev' => $revision->getVersion(), '%mtime' => $revision->get('mtime'))); - /* - // FIXME: This is also in the template... - if ($request->getArg('action') != 'pdf' and !headers_sent()) { - // FIXME: enable MathML/SVG/... support - if (ENABLE_XHTML_XML - and (!isBrowserIE() - and strstr($request->get('HTTP_ACCEPT'),'application/xhtml+xml'))) - header("Content-Type: application/xhtml+xml; charset=" . $GLOBALS['charset']); - else - header("Content-Type: text/html; charset=" . $GLOBALS['charset']); - } - */ $toks['TITLE'] = $pagetitle; // tag $toks['HEADER'] = $pageheader; // h1 with backlink diff --git a/lib/editpage.php b/lib/editpage.php index 29a61cc91..36e444167 100644 --- a/lib/editpage.php +++ b/lib/editpage.php @@ -64,7 +64,7 @@ class PageEditor } } if (!headers_sent()) - header("Content-Type: text/html; charset=" . $GLOBALS['charset']); + header("Content-Type: text/html; charset=UTF-8"); } function editPage() diff --git a/lib/loadsave.php b/lib/loadsave.php index cf9114858..ebe2f5133 100644 --- a/lib/loadsave.php +++ b/lib/loadsave.php @@ -1237,13 +1237,6 @@ function ParseSerializedPage($text, $default_pagename, $user) break; } } - if (empty($pagehash['charset'])) - $pagehash['charset'] = 'utf-8'; - // compare to target charset - if (strtolower($pagehash['charset']) != strtolower($GLOBALS['charset'])) { - $pageinfo['content'] = charset_convert($params['charset'], $GLOBALS['charset'], $pageinfo['content']); - $pageinfo['pagename'] = charset_convert($params['charset'], $GLOBALS['charset'], $pageinfo['pagename']); - } return $pageinfo; } @@ -1282,9 +1275,6 @@ function LoadFile(&$request, $filename, $text = false, $mtime = false) if (!$mtime) $mtime = time(); // Last resort. - // DONE: check source - target charset for content and pagename - // but only for pgsrc'ed content, not from the browser. - $default_pagename = rawurldecode($basename); if (($parts = ParseMimeifiedPages($text))) { if (count($parts) > 1) @@ -1311,13 +1301,6 @@ function LoadFile(&$request, $filename, $text = false, $mtime = false) // plain old file $user = $request->getUser(); - $file_charset = 'utf-8'; - // compare to target charset - if ($file_charset != strtolower($GLOBALS['charset'])) { - $text = charset_convert($file_charset, $GLOBALS['charset'], $text); - $default_pagename = charset_convert($file_charset, $GLOBALS['charset'], $default_pagename); - } - // Assume plain text file. $pageinfo = array('pagename' => $default_pagename, 'pagedata' => array(), diff --git a/lib/plugin/EditMetaData.php b/lib/plugin/EditMetaData.php index 93a299c19..f2c11538d 100644 --- a/lib/plugin/EditMetaData.php +++ b/lib/plugin/EditMetaData.php @@ -146,7 +146,7 @@ class WikiPlugin_EditMetaData $button = Button('submit:metaedit', _("Submit"), false); $form = HTML::form(array('action' => $action, 'method' => 'post', - 'accept-charset' => $GLOBALS['charset']), + 'accept-charset' => 'UTF-8'), $hiddenfield, // edit existing fields $table, diff --git a/lib/plugin/ExternalSearch.php b/lib/plugin/ExternalSearch.php index 4ea1e2920..3c2ac8b49 100644 --- a/lib/plugin/ExternalSearch.php +++ b/lib/plugin/ExternalSearch.php @@ -108,7 +108,7 @@ class WikiPlugin_ExternalSearch $form = HTML::form(array('action' => $request->getPostURL(), 'method' => 'post', //'class' => 'class', //fixme - 'accept-charset' => $GLOBALS['charset']), + 'accept-charset' => 'UTF-8'), HiddenInputs(array('pagename' => $basepage))); $form->pushContent(HTML::input(array('type' => 'hidden', diff --git a/lib/plugin/GooglePlugin.php b/lib/plugin/GooglePlugin.php index a55114d40..99312090c 100644 --- a/lib/plugin/GooglePlugin.php +++ b/lib/plugin/GooglePlugin.php @@ -111,7 +111,7 @@ class WikiPlugin_GooglePlugin $form = HTML::form(array('action' => $request->getPostURL(), 'method' => 'post', //'class' => 'class', //fixme - 'accept-charset' => $GLOBALS['charset']), + 'accept-charset' => 'UTF-8'), HiddenInputs(array('pagename' => $basepage, 'mode' => $mode))); $form->pushContent(HTML::input(array('type' => 'text', diff --git a/lib/plugin/LinkDatabase.php b/lib/plugin/LinkDatabase.php index 57273c81d..01d5d3fe3 100644 --- a/lib/plugin/LinkDatabase.php +++ b/lib/plugin/LinkDatabase.php @@ -142,14 +142,14 @@ class WikiPlugin_LinkDatabase } elseif ($args['format'] == 'xml') { // For hypergraph.jar. Best dump it to a local sitemap.xml periodically - global $WikiTheme, $charset; + global $WikiTheme; $currpage = $request->getArg('pagename'); $request->discardOutput(); $request->buffer_output(false); if (!headers_sent()) header("Content-Type: text/xml"); $request->checkValidators(); - echo "<?xml version=\"1.0\" encoding=\"$charset\"?>"; + echo "<?xml version=\"1.0\" encoding=\"UTF-8\"?>"; // As applet it prefers only "GraphXML.dtd", but then we must copy it to the webroot. $dtd = $WikiTheme->_findData("GraphXML.dtd"); echo "<!DOCTYPE GraphXML SYSTEM \"$dtd\">\n"; diff --git a/lib/plugin/LinkSearch.php b/lib/plugin/LinkSearch.php index a1e893c1b..bb2fbd887 100644 --- a/lib/plugin/LinkSearch.php +++ b/lib/plugin/LinkSearch.php @@ -116,7 +116,7 @@ function dirsign_switch() { $instructions = _("Search in pages for links with the matching name."); $form = HTML::form(array('action' => $action, 'method' => 'GET', - 'accept-charset' => $GLOBALS['charset']), + 'accept-charset' => 'UTF-8'), $dirsign_switch, $hiddenfield, $instructions, HTML::br(), diff --git a/lib/plugin/PageDump.php b/lib/plugin/PageDump.php index 1c8a49529..ec5cd86fc 100644 --- a/lib/plugin/PageDump.php +++ b/lib/plugin/PageDump.php @@ -123,16 +123,11 @@ class WikiPlugin_PageDump $filename = FilenameForPage($page); Header("Content-disposition: attachment; filename=\"" . $filename . "\""); - // Read charset from generated page itself. - // Inconsequential at the moment, since loadsave.php - // always generates headers. - $charset = $p->get('charset'); - if (!$charset) $charset = $GLOBALS['charset']; // We generate 3 Content-Type headers! first in loadsave, // then here and the mimified string $mailified also has it! // This one is correct and overwrites the others. Header("Content-Type: application/octet-stream; name=\"" - . $filename . "\"; charset=\"" . $charset + . $filename . "\"; charset=\"" . 'UTF-8' . "\""); $request->checkValidators(); // let $request provide last modified & etag diff --git a/lib/plugin/RecentChanges.php b/lib/plugin/RecentChanges.php index 1aae37ea5..8e354ebec 100644 --- a/lib/plugin/RecentChanges.php +++ b/lib/plugin/RecentChanges.php @@ -733,7 +733,7 @@ class _RecentChanges_SideBarFormatter global $request; $request->discardOutput(); - printf("<?xml version=\"1.0\" encoding=\"%s\"?>\n", $GLOBALS['charset']); + printf("<?xml version=\"1.0\" encoding=\"%s\"?>\n", 'UTF-8'); printf('<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"'); printf(' "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">'); printf('<html xmlns="http://www.w3.org/1999/xhtml">'); @@ -860,7 +860,6 @@ class _RecentChanges_RssFormatter global $request; $request->discardOutput(); $rss->finish(); - //header("Content-Type: application/rss+xml; charset=" . $GLOBALS['charset']); printf("\n<!-- Generated by PhpWiki-%s -->\n", PHPWIKI_VERSION); // Flush errors in comment, otherwise it's invalid XML. @@ -980,7 +979,6 @@ class _RecentChanges_Rss2Formatter global $request; $request->discardOutput(); $rss->finish(); - //header("Content-Type: application/rss+xml; charset=" . $GLOBALS['charset']); printf("\n<!-- Generated by PhpWiki-%s -->\n", PHPWIKI_VERSION); // Flush errors in comment, otherwise it's invalid XML. global $ErrorManager; @@ -1060,7 +1058,6 @@ class _RecentChanges_AtomFormatter $request->discardOutput(); $rss->finish(); - //header("Content-Type: application/atom; charset=" . $GLOBALS['charset']); printf("\n<!-- Generated by PhpWiki-%s -->\n", PHPWIKI_VERSION); // Flush errors in comment, otherwise it's invalid XML. global $ErrorManager; diff --git a/lib/plugin/RssFeed.php b/lib/plugin/RssFeed.php index a025aa7f6..371a5e708 100644 --- a/lib/plugin/RssFeed.php +++ b/lib/plugin/RssFeed.php @@ -54,10 +54,7 @@ class WikiPlugin_RssFeed { extract($this->getArgs($argstr, $request)); - if (defined('CHARSET')) - $rss_parser = new RSSParser(CHARSET); - else - $rss_parser = new RSSParser(); + $rss_parser = new RSSParser(); if (!empty($url)) $rss_parser->parse_url($url, $debug); diff --git a/lib/plugin/SemanticSearch.php b/lib/plugin/SemanticSearch.php index 9a9109a78..c71fb1111 100644 --- a/lib/plugin/SemanticSearch.php +++ b/lib/plugin/SemanticSearch.php @@ -142,7 +142,7 @@ class WikiPlugin_SemanticSearch $instructions = _("Search in pages for a relation with that value (a pagename)."); $form1 = HTML::form(array('action' => $action, 'method' => 'post', - 'accept-charset' => $GLOBALS['charset']), + 'accept-charset' => 'UTF-8'), $reldef, $hiddenfield, HiddenInputs(array('attribute' => '')), $instructions, HTML::br(), @@ -225,7 +225,7 @@ class WikiPlugin_SemanticSearch (HTML(" ", new Button(_("Advanced..."), _("SemanticSearchAdvanced")))); $form2 = HTML::form(array('action' => $action, 'method' => 'post', - 'accept-charset' => $GLOBALS['charset']), + 'accept-charset' => 'UTF-8'), $attdef, $hiddenfield, HiddenInputs(array('relation' => '')), $instructions, HTML::br(), diff --git a/lib/plugin/SemanticSearchAdvanced.php b/lib/plugin/SemanticSearchAdvanced.php index 14b4bb8d2..0f5719900 100644 --- a/lib/plugin/SemanticSearchAdvanced.php +++ b/lib/plugin/SemanticSearchAdvanced.php @@ -114,7 +114,7 @@ class WikiPlugin_SemanticSearchAdvanced $instructions = _("Search in all specified pages for the expression."); $form = HTML::form(array('action' => $action, 'method' => 'post', - 'accept-charset' => $GLOBALS['charset']), + 'accept-charset' => 'UTF-8'), $reldef, $hiddenfield, HiddenInputs(array('attribute' => '')), $instructions, HTML::br(), diff --git a/lib/plugin/SpellCheck.php b/lib/plugin/SpellCheck.php index 784edd2a3..260c83e73 100644 --- a/lib/plugin/SpellCheck.php +++ b/lib/plugin/SpellCheck.php @@ -87,12 +87,11 @@ class WikiPlugin_SpellCheck function pspell_check($text, $lang = false) { - global $charset; if ($lang) $lang = $GLOBALS['LANG']; $words = preg_split('/[\W]+?/', $text); $misspelled = $return = array(); - $pspell_config = pspell_config_create($lang, "", "", $charset, + $pspell_config = pspell_config_create($lang, "", "", 'UTF-8', PSPELL_NORMAL | PSPELL_RUN_TOGETHER); //pspell_config_runtogether($pspell_config, true); if (PSPELL_PWL) diff --git a/lib/plugin/SystemInfo.php b/lib/plugin/SystemInfo.php index 90b1f75aa..d2c33b26a 100644 --- a/lib/plugin/SystemInfo.php +++ b/lib/plugin/SystemInfo.php @@ -30,7 +30,7 @@ * * Provide access to phpwiki's lower level system information. * - * version, charset, pagestats, SERVER_NAME, database, discspace, + * version, pagestats, SERVER_NAME, database, discspace, * cachestats, userstats, linkstats, accessstats, hitstats, * revisionstats, interwikilinks, imageextensions, wikiwordregexp, * availableplugins, downloadurl or any other predefined CONSTANT diff --git a/lib/plugin/WikiForm.php b/lib/plugin/WikiForm.php index 764887084..2da5ff880 100644 --- a/lib/plugin/WikiForm.php +++ b/lib/plugin/WikiForm.php @@ -54,7 +54,7 @@ class WikiPlugin_WikiForm $form = HTML::form(array('action' => $request->getPostURL(), 'method' => 'post', 'class' => 'wikiadmin', - 'accept-charset' => $GLOBALS['charset']), + 'accept-charset' => 'UTF-8'), HiddenInputs(array('action' => $action, 'overwrite' => $overwrite, 'pagename' => $basepage))); diff --git a/lib/plugin/WikiFormRich.php b/lib/plugin/WikiFormRich.php index 216478487..31be47026 100644 --- a/lib/plugin/WikiFormRich.php +++ b/lib/plugin/WikiFormRich.php @@ -181,7 +181,7 @@ class WikiPlugin_WikiFormRich $form = HTML::form(array('action' => $request->getPostURL(), 'method' => strtolower($method), 'class' => 'wikiformrich', - 'accept-charset' => $GLOBALS['charset']), + 'accept-charset' => 'UTF-8'), HiddenInputs(array('action' => $action))); $nbsp = HTML::Raw(' '); $already_submit = 0; diff --git a/lib/plugin/_WikiTranslation.php b/lib/plugin/_WikiTranslation.php index e1a02e063..8ba805022 100644 --- a/lib/plugin/_WikiTranslation.php +++ b/lib/plugin/_WikiTranslation.php @@ -266,18 +266,6 @@ class WikiPlugin__WikiTranslation } else { $languages = array($languages); } - if (in_array('zh', $languages) or in_array('ja', $languages)) { - - // If the current charset != utf-8 the text will not be displayed correctly. - // But here we cannot change the header anymore. So we can decide to ignore them, - // or display them with all the errors. - //FIXME: do iconv the ob - if ($GLOBALS['charset'] != 'utf-8' and !defined('NEED_ICONV_TO')) { - define('NEED_ICONV_TO', 'utf-8'); - //either the extension or external - //$GLOBALS['charset'] = 'utf-8'; - } - } $to_lang = $languages[0]; if (!empty($string) and count($languages) == 1) { return $this->translate($string, $to_lang, $from_lang); diff --git a/lib/stdlib.php b/lib/stdlib.php index 4b5baeed5..518f6517b 100644 --- a/lib/stdlib.php +++ b/lib/stdlib.php @@ -2086,46 +2086,9 @@ function isUtf8String($s) */ function fixTitleEncoding($s) { - global $charset; - - $s = trim($s); - // print a warning? - if (empty($s)) return $s; - - $ishigh = preg_match('/[\x80-\xff]/', $s); - /* - $isutf = ($ishigh ? preg_match( '/^([\x00-\x7f]|[\xc0-\xdf][\x80-\xbf]|' . - '[\xe0-\xef][\x80-\xbf]{2}|[\xf0-\xf7][\x80-\xbf]{3})+$/', $s ) : true ); - */ - $isutf = ($ishigh ? isUtf8String($s) : true); - $locharset = strtolower($charset); - - if ($locharset != "utf-8" and $ishigh and $isutf) - $s = charset_convert('UTF-8', $locharset, $s); - if ($locharset == "utf-8" and $ishigh and !$isutf) - return utf8_encode($s); - - // Other languages can safely leave this function, or replace - // it with one to detect and convert another legacy encoding. return $s; } -/** - * MySQL fulltext index doesn't grok utf-8, so we - * need to fold cases and convert to hex. - * src: languages/Language.php:stripForSearch() from mediawiki - */ -/* -function stripForSearch( $string ) { - global $wikiLowerChars; - // '/(?:[a-z]|\xc3[\x9f-\xbf]|\xc4[\x81\x83\x85\x87])/' => "a-z\xdf-\xf6\xf8-\xff" - return preg_replace( - "/([\\xc0-\\xff][\\x80-\\xbf]*)/e", - "'U8' . bin2hex( strtr( \"\$1\", \$wikiLowerChars ) )", - $string ); -} -*/ - /** * Workaround for allow_url_fopen, to get the content of an external URI. * It returns the contents in one slurp. Parsers might want to check for allow_url_fopen diff --git a/lib/upgrade.php b/lib/upgrade.php index ed10dddc7..19923b6dc 100644 --- a/lib/upgrade.php +++ b/lib/upgrade.php @@ -608,9 +608,7 @@ CREATE TABLE $log_tbl ( ) { echo _("OK"), "<br />\n"; } else { - //SET CHARACTER SET latin1 - $charset = CHARSET; - if ($charset == 'iso-8859-1') $charset = 'latin1'; + $charset = 'UTF-8'; $this->dbi->genericSqlQuery("ALTER TABLE $page_tbl CHANGE pagename " . "pagename VARCHAR(100) " . "CHARACTER SET '$charset' COLLATE '$charset" . "_bin' NOT NULL"); @@ -772,7 +770,7 @@ CREATE TABLE $log_tbl ( // And on Windows: SELECT FROM mysql, possibly: UPDATE mysql. $form = HTML::form(array("method" => "post", "action" => $this->request->getPostURL(), - "accept-charset" => $GLOBALS['charset']), + "accept-charset" => 'UTF-8'), HTML::p(_("Upgrade requires database privileges to CREATE and ALTER the phpwiki database."), HTML::br(), _("And on Windows at least the privilege to SELECT FROM mysql, and possibly UPDATE mysql")), diff --git a/lib/ziplib.php b/lib/ziplib.php index e76969a25..376771200 100644 --- a/lib/ziplib.php +++ b/lib/ziplib.php @@ -627,8 +627,6 @@ function MimeifyPageRevision(&$page, &$revision) //TODO: convert to multiple lines? acl-view => groups,...; acl-edit => groups,... } - $params['charset'] = $GLOBALS['charset']; - // Non-US-ASCII is not allowed in Mime headers (at least not without // special handling) --- so we urlencode all parameter values. foreach ($params as $key => $val) @@ -880,18 +878,6 @@ function ParseMimeifiedPages($data) else if ($encoding && $encoding != 'binary') ExitWiki(sprintf("Unknown %s", 'encoding type: $encoding')); - if (empty($params['charset'])) - $params['charset'] = 'utf-8'; - - // compare to target charset - if (strtolower($params['charset']) != strtolower($GLOBALS['charset'])) { - $data = charset_convert($params['charset'], $GLOBALS['charset'], $data); - //$page['pagename'] = charset_convert($params['charset'], $GLOBALS['charset'], $page['pagename']); - if (isset($versiondata['summary'])) - $versiondata['summary'] = charset_convert($params['charset'], $GLOBALS['charset'], $versiondata['summary']); - - } - $data .= GenerateFootnotesFromRefs($params); $page['content'] = preg_replace('/[ \t\r]*\n/', "\n", chop($data)); diff --git a/pgsrc/Help%2FTextFormattingRules b/pgsrc/Help%2FTextFormattingRules index 93644c427..e9178e1a4 100644 --- a/pgsrc/Help%2FTextFormattingRules +++ b/pgsrc/Help%2FTextFormattingRules @@ -1,4 +1,4 @@ -Date: Wed, 19 Dec 2012 13:19:04 +0000 +Date: Tue, 2 Apr 2013 15:43:51 +0000 Mime-Version: 1.0 (Produced by PhpWiki 1.4.0) Content-Type: application/x-phpwiki; pagename=Help%2FTextFormattingRules; @@ -147,14 +147,6 @@ The tilde '~~' is the //Escape Character//: All special non-whitespace HTML characters are displayed as-is. Exceptions below. -Special non-ASCII or non-latin characters are printed as-is only if supported -by the native wiki CHARSET. Add such characters on a non-supported CHARSET with the [[Help:RawHtmlPlugin]] if it is enabled by the Admin and e.g. the ##&#num;## syntax. - -E.g. These Japanese chars 'から 新規ページ' -on this <<SystemInfo CHARSET>> wiki. - -And with the plugin: <<RawHtml から 新規ページ>> - == Paragraphs == * Don't indent paragraphs diff --git a/tests/unit/test.php b/tests/unit/test.php index be616879d..3bc025445 100644 --- a/tests/unit/test.php +++ b/tests/unit/test.php @@ -358,7 +358,7 @@ function updateLevelEdit(formObj) { $form->pushContent(HTML::td($option)); $table = HTML::form(array('action' => $_SERVER['PHP_SELF'], 'method' => 'GET', - 'accept-charset' => $GLOBALS['charset']), + 'accept-charset' => 'UTF-8'), $js, HTML::table(HTML::tr(array('valign'=>'top'), $form)), HTML::input(array('type' => 'submit')), diff --git a/themes/Crao/templates/editpage.tmpl b/themes/Crao/templates/editpage.tmpl index bd6465482..a55a247a7 100644 --- a/themes/Crao/templates/editpage.tmpl +++ b/themes/Crao/templates/editpage.tmpl @@ -25,7 +25,7 @@ */ ?> <form method="post" id="editpage" name="editpage" action="<?php echo $request->getPostURL() ?>" - accept-charset="<?php echo CHARSET?>"> + accept-charset="UTF-8"> <?php if (!empty($_GET['start_debug'])) echo '<input type="hidden" name="start_debug" value="1" >'; ?> <?php /* To clear beyond a larger logo, such as in the Hawaiian theme */ ?> <br class="clear-floats" /> diff --git a/themes/Crao/templates/head.tmpl b/themes/Crao/templates/head.tmpl index 2b2803350..3ee8b0a52 100644 --- a/themes/Crao/templates/head.tmpl +++ b/themes/Crao/templates/head.tmpl @@ -1,5 +1,5 @@ <head> -<meta http-equiv="Content-Type" content="text/html; charset=<?php echo CHARSET?>" /> +<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> <?php $ROBOTS_CONTENT = isset($ROBOTS_META) ? $ROBOTS_META : "noindex,nofollow"; ?> <meta name="robots" content="<?php echo $ROBOTS_CONTENT ?>" /> <?php if (!empty($PAGE_DESCRIPTION)) { ?> diff --git a/themes/Crao/templates/htmldump.tmpl b/themes/Crao/templates/htmldump.tmpl index 57afe13a9..77d5da132 100644 --- a/themes/Crao/templates/htmldump.tmpl +++ b/themes/Crao/templates/htmldump.tmpl @@ -3,13 +3,10 @@ * This template is used only for html file dumps, and is responsible * mainly for the outer level <html> stuff and the and <head>. */ -printf("<?xml version=\"1.0\" encoding=\"%s\"?>\n", CHARSET); ?> -<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" - "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> -<html xmlns="http://www.w3.org/1999/xhtml"> +<!DOCTYPE> <head> -<meta http-equiv="Content-Type" content="text/html; charset=<?php echo CHARSET?>" /> +<meta charset="UTF-8" /> <link rel="home" title="<?php echo HOME_PAGE?>" href="<?php echo WikiURL(HOME_PAGE)?>" /> <link rel="help" title="<?php echo _("HowToUseWiki")?>" href="<?php echo WikiURL(_("HowToUseWiki"))?>" /> <link rel="copyright" title="<?php echo COPYRIGHTPAGE_TITLE?>" href="<?php echo COPYRIGHTPAGE_URL?>" /> diff --git a/themes/Portland/templates/editpage.tmpl b/themes/Portland/templates/editpage.tmpl index 074a71e69..74c8f3292 100644 --- a/themes/Portland/templates/editpage.tmpl +++ b/themes/Portland/templates/editpage.tmpl @@ -9,7 +9,7 @@ <form method="post" name="editpage" action="<?php echo $request->getPostURL() ?>" - accept-charset="<?php echo CHARSET?>"> + accept-charset="UTF-8"> <table class="toolbar" width="100%" cellpadding="0" cellspacing="0" border="0"> <tr align="bottom"> diff --git a/themes/Sidebar/templates/frame-left.tmpl b/themes/Sidebar/templates/frame-left.tmpl index 46a7fee12..dea01d8a8 100644 --- a/themes/Sidebar/templates/frame-left.tmpl +++ b/themes/Sidebar/templates/frame-left.tmpl @@ -2,11 +2,10 @@ /* * This template is responsible mainly for the outer level <html> stuff. */ -printf("<?xml version=\"1.0\" encoding=\"%s\"?>\n", CHARSET); ?> -<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" - "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> -<html xmlns="http://www.w3.org/1999/xhtml"> +<!DOCTYPE> +<head> +<meta charset="UTF-8" /> <?php echo Template('head') ?> <body> <div class="toolbar"><?php echo Template('navbar') ?></div> diff --git a/themes/Wordpress/templates/editpage.tmpl b/themes/Wordpress/templates/editpage.tmpl index 7f874a18c..e1cbf87c4 100644 --- a/themes/Wordpress/templates/editpage.tmpl +++ b/themes/Wordpress/templates/editpage.tmpl @@ -11,7 +11,7 @@ <div class="wikitext" id="editform"> <form method="post" name="editpage" id="editpage" action="<?php echo $request->getPostURL() ?>" - accept-charset="<?php echo CHARSET?>"> + accept-charset="UTF-8"> <?php if (!empty($_GET['start_debug'])) echo '<input type="hidden" name="start_debug" value="1" >'; ?> <table class="toolbar" width="100%" cellpadding="0" cellspacing="0" border="0"> diff --git a/themes/Wordpress/templates/signin.tmpl b/themes/Wordpress/templates/signin.tmpl index 240108989..3a7ba2425 100644 --- a/themes/Wordpress/templates/signin.tmpl +++ b/themes/Wordpress/templates/signin.tmpl @@ -8,7 +8,7 @@ else ?> <?php if (empty($NOFORM)) { ?> <li> - <form method="post" action="<?php echo $request->getPostURL()?>" accept-charset="<?php echo CHARSET?>" name="<?php echo $FORMNAME?>"> + <form method="post" action="<?php echo $request->getPostURL()?>" accept-charset="UTF-8" name="<?php echo $FORMNAME?>"> <?php echo HiddenInputs($request->getArgs(), false, array('auth')) ?> <?php } ?> <?php diff --git a/themes/default/templates/addcomment.tmpl b/themes/default/templates/addcomment.tmpl index c472adcd3..253d1dec2 100644 --- a/themes/default/templates/addcomment.tmpl +++ b/themes/default/templates/addcomment.tmpl @@ -4,7 +4,7 @@ <div class="wikicomment wikicomment-form"> <?php if (!$WikiTheme->DUMP_MODE) { ?> <form action="<?php echo $request->getPostURL()?>" method="post" class="wikiaction" - accept-charset="<?php echo CHARSET?>"> + accept-charset="UTF-8"> <input type="hidden" name="comment[pagename]" value="<?php echo $PAGENAME?>" /> <?php echo HiddenInputs($request->getArgs()) ?> <table class="wikicomment-form"> diff --git a/themes/default/templates/dialog.tmpl b/themes/default/templates/dialog.tmpl index 6a7481981..30e84386b 100644 --- a/themes/default/templates/dialog.tmpl +++ b/themes/default/templates/dialog.tmpl @@ -2,13 +2,10 @@ /* * A "popup" dialog. (Though it does not pop up yet.) */ -printf("<?xml version=\"1.0\" encoding=\"%s\"?>\n", CHARSET); ?> -<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" - "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> -<html xmlns="http://www.w3.org/1999/xhtml"> +<!DOCTYPE html> <head> -<meta http-equiv="Content-Type" content="text/html; charset=<?php echo CHARSET?>" /> +<meta charset="UTF-8" /> <meta name="robots" content="noindex, nofollow" /> <meta name="generator" content="phpWiki" /> <meta name="PHPWIKI_VERSION" content="<?php echo PHPWIKI_VERSION?>" /> diff --git a/themes/default/templates/editpage.tmpl b/themes/default/templates/editpage.tmpl index bf9f52b7b..a98ee955b 100644 --- a/themes/default/templates/editpage.tmpl +++ b/themes/default/templates/editpage.tmpl @@ -27,7 +27,7 @@ */ ?> <form method="post" id="editpage" name="editpage" action="<?php echo $request->getPostURL() ?>" - accept-charset="<?php echo CHARSET?>"> + accept-charset="UTF-8"> <?php if (!empty($_GET['start_debug'])) echo '<input type="hidden" name="start_debug" value="1" >'; ?> <?php /* To clear beyond a larger logo, such as in the Hawaiian theme */ ?> <br class="clear-floats" /> diff --git a/themes/default/templates/forumadd.tmpl b/themes/default/templates/forumadd.tmpl index 5d4a62810..d4468e5dd 100644 --- a/themes/default/templates/forumadd.tmpl +++ b/themes/default/templates/forumadd.tmpl @@ -3,7 +3,7 @@ ?> <div class="wikiforum wikiforum-reply"> <form action="<?php echo $request->getPostURL()?>" method="post" class="wikiaction" - accept-charset="<?php echo CHARSET?>"> + accept-charset="UTF-8"> <input type="hidden" name="forum[pagename]" value="<?php echo $PAGENAME?>" /> <?php echo HiddenInputs($request->getArgs()) ?> <table class="wikiforum-reply"> diff --git a/themes/default/templates/login.tmpl b/themes/default/templates/login.tmpl index 8ba3eb621..cf16d9acd 100644 --- a/themes/default/templates/login.tmpl +++ b/themes/default/templates/login.tmpl @@ -60,7 +60,7 @@ if (ALLOW_BOGO_LOGIN && $require_level <= WIKIAUTH_BOGO) { if (empty($pass_required)) ?> <p><?php echo _("New users may use an empty password.") ?></p> <?php } ?> -<form method="post" action="<?php echo $request->getPostURL() ?>" accept-charset="<?php echo CHARSET?>" name="login"> +<form method="post" action="<?php echo $request->getPostURL() ?>" accept-charset="UTF-8" name="login"> <table> <tr> <td> diff --git a/themes/default/templates/redirect.tmpl b/themes/default/templates/redirect.tmpl index df409f3a6..b491cc5f5 100644 --- a/themes/default/templates/redirect.tmpl +++ b/themes/default/templates/redirect.tmpl @@ -7,7 +7,7 @@ echo "<","?xml version=\"1.0\" encoding=\"", $charset, "\"?", ">\n"; "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> -<meta http-equiv="Content-Type" content="text/html; charset=<?php echo CHARSET?>" /> +<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> <meta name="robots" content="noindex, nofollow" /> <meta name="generator" content="PhpWiki" /> <meta name="PHPWIKI_VERSION" content="<?php echo PHPWIKI_VERSION?>" /> diff --git a/themes/default/templates/wikiforum.tmpl b/themes/default/templates/wikiforum.tmpl index a74e8c6d2..c4764af9d 100644 --- a/themes/default/templates/wikiforum.tmpl +++ b/themes/default/templates/wikiforum.tmpl @@ -12,7 +12,7 @@ $CDATE = $WikiTheme->formatDateTime($FORUM_CTIME); ?> <div class="wikiforum wikiforum-form"> <form action="<?php echo $request->getPostURL()?>" method="post" class="wikiaction" - accept-charset="<?php echo CHARSET?>"> + accept-charset="UTF-8"> <input type="hidden" name="forum[title]" value="<?php echo $FORUM_PARENT ?>" /> <?php echo HiddenInputs($request->getArgs()) ?> <table class="wikiforum wikiforum-list"> diff --git a/themes/fusionforge/templates/editpage.tmpl b/themes/fusionforge/templates/editpage.tmpl index 169e3f248..e30712b5c 100644 --- a/themes/fusionforge/templates/editpage.tmpl +++ b/themes/fusionforge/templates/editpage.tmpl @@ -60,7 +60,7 @@ <form method="post" id="editpage" name="editpage" action="<?php echo $request->getPostURL() ?>" - accept-charset="<?php echo CHARSET?>"> + accept-charset="UTF-8"> <?php if (!empty($_GET['start_debug'])) echo '<input type="hidden" name="start_debug" value="1" >'; ?> <?php /* To clear beyond a larger logo, such as in the Hawaiian theme */ ?> <br class="clear-floats" /> diff --git a/themes/wikilens/templates/head.tmpl b/themes/wikilens/templates/head.tmpl index 77dd5ac0a..ff05ba32b 100644 --- a/themes/wikilens/templates/head.tmpl +++ b/themes/wikilens/templates/head.tmpl @@ -1,5 +1,5 @@ <head> -<meta http-equiv="Content-Type" content="text/html; charset=<?php echo CHARSET?>" /> +<meta charset="UTF-8" /> <?php $ROBOTS_CONTENT = isset($ROBOTS_META) ? $ROBOTS_META : "noindex,nofollow"; ?> <meta name="robots" content="<?php echo $ROBOTS_CONTENT ?>" /> <?php if (!empty($PAGE_DESCRIPTION)) { ?> -- 2.45.0