// needed if we include globalfunctions from install.php\r
global $nucleus, $CONF, $DIR_LIBS, $DIR_LANG, $manager, $member;\r
\r
-$nucleus['version'] = 'v3.40RC';\r
+$nucleus['version'] = 'v3.5SVN';\r
$nucleus['codename'] = '';\r
\r
checkVars(array('nucleus', 'CONF', 'DIR_LIBS', 'MYSQL_HOST', 'MYSQL_USER', 'MYSQL_PASSWORD', 'MYSQL_DATABASE', 'DIR_LANG', 'DIR_PLUGINS', 'HTTP_GET_VARS', 'HTTP_POST_VARS', 'HTTP_COOKIE_VARS', 'HTTP_ENV_VARS', 'HTTP_SESSION_VARS', 'HTTP_POST_FILES', 'HTTP_SERVER_VARS', 'GLOBALS', 'argv', 'argc', '_GET', '_POST', '_COOKIE', '_ENV', '_SESSION', '_SERVER', '_FILES'));\r
more of the installation files (install.php, install.sql, upgrades/\r
directory) are still on the server.\r
*/\r
+\r
$CONF['alertOnHeadersSent'] = 1;\r
$CONF['alertOnSecurityRisk'] = 1;\r
-$CONF['ItemURL'] = $CONF['Self'];\r
+/*$CONF['ItemURL'] = $CONF['Self'];\r
$CONF['ArchiveURL'] = $CONF['Self'];\r
$CONF['ArchiveListURL'] = $CONF['Self'];\r
$CONF['MemberURL'] = $CONF['Self'];\r
// this avoids urls like index.php/item/13/index.php/item/15\r
if (!isset($CONF['URLMode']) || (($CONF['URLMode'] == 'pathinfo') && (substr($CONF['Self'], strlen($CONF['Self']) - 4) == '.php'))) {\r
$CONF['URLMode'] = 'normal';\r
-}\r
+}*/\r
\r
if (getNucleusPatchLevel() > 0) {\r
$nucleus['version'] .= '/' . getNucleusPatchLevel();\r
$startpos = intRequestVar('startpos');\r
$errormessage = '';\r
$error = '';\r
+$special = requestVar('special');\r
$virtualpath = ((getVar('virtualpath') != null) ? getVar('virtualpath') : serverVar('PATH_INFO'));\r
\r
if (!headers_sent() ) {\r
include($DIR_LIBS . 'MANAGER.php');\r
include($DIR_LIBS . 'PLUGIN.php');\r
\r
-$manager =& MANAGER::instance();\r
+$manager = MANAGER::instance();\r
\r
// make sure there's no unnecessary escaping:\r
set_magic_quotes_runtime(0);\r
$CONF['Self'] = substr($CONF['Self'], 0, strlen($CONF['Self']) -1);\r
}\r
\r
- $CONF['ItemURL'] = $CONF['Self'];\r
+/* $CONF['ItemURL'] = $CONF['Self'];\r
$CONF['ArchiveURL'] = $CONF['Self'];\r
$CONF['ArchiveListURL'] = $CONF['Self'];\r
$CONF['MemberURL'] = $CONF['Self'];\r
$CONF['SearchURL'] = $CONF['Self'];\r
$CONF['BlogURL'] = $CONF['Self'];\r
- $CONF['CategoryURL'] = $CONF['Self'];\r
+ $CONF['CategoryURL'] = $CONF['Self'];*/\r
+}\r
+\r
+$CONF['ItemURL'] = $CONF['Self'];\r
+$CONF['ArchiveURL'] = $CONF['Self'];\r
+$CONF['ArchiveListURL'] = $CONF['Self'];\r
+$CONF['MemberURL'] = $CONF['Self'];\r
+$CONF['SearchURL'] = $CONF['Self'];\r
+$CONF['BlogURL'] = $CONF['Self'];\r
+$CONF['CategoryURL'] = $CONF['Self'];\r
+\r
+// switch URLMode back to normal when $CONF['Self'] ends in .php\r
+// this avoids urls like index.php/item/13/index.php/item/15\r
+if (!isset($CONF['URLMode']) || (($CONF['URLMode'] == 'pathinfo') && (substr($CONF['Self'], strlen($CONF['Self']) - 4) == '.php'))) {\r
+ $CONF['URLMode'] = 'normal';\r
}\r
\r
// automatically use simpler toolbar for mozilla\r
$action = $nextaction;\r
}\r
\r
- $manager->notify('LoginSuccess', array('member' => &$member) );\r
+ $manager->notify('LoginSuccess', array('member' => &$member, 'username' => $login) );\r
$errormessage = '';\r
ACTIONLOG::add(INFO, "Login successful for $login (sharedpc=$shared)");\r
} else {\r
\r
// check if valid charset\r
if (!encoding_check(false, false, _CHARSET)) {\r
- foreach(array($_REQUEST, $_SERVER) as $input) {\r
+ foreach(array($_GET, $_POST) as $input) {\r
array_walk($input, 'encoding_check');\r
}\r
}\r
if (!defined('_ARCHIVETYPE_MONTH') ) {\r
define('_ARCHIVETYPE_DAY', 'day');\r
define('_ARCHIVETYPE_MONTH', 'month');\r
+ define('_ARCHIVETYPE_YEAR', 'year');\r
}\r
\r
// decode path_info\r
$CONF['CategoryKey'] = 'category';\r
}\r
\r
- if ($CONF['SpecialskinKey'] == '') {\r
+ if (!isset($CONF['SpecialskinKey']) || $CONF['SpecialskinKey'] == '') {\r
$CONF['SpecialskinKey'] = 'special';\r
}\r
\r
* returns the currently used version (100 = 1.00, 101 = 1.01, etc...)\r
*/\r
function getNucleusVersion() {\r
- return 340;\r
+ return 341;\r
}\r
\r
/**\r
}\r
\r
/**\r
+ * returns the latest version available for download from nucleuscms.org \r
+ * or false if unable to attain data\r
+ * format will be major.minor/patachlevel\r
+ * e.g. 3.41 or 3.41/02\r
+ */\r
+function getLatestVersion() {\r
+ if (!function_exists('curl_init')) return false;\r
+ $crl = curl_init();\r
+ $timeout = 5;\r
+ curl_setopt ($crl, CURLOPT_URL,'http://nucleuscms.org/version_check.php');\r
+ curl_setopt ($crl, CURLOPT_RETURNTRANSFER, 1);\r
+ curl_setopt ($crl, CURLOPT_CONNECTTIMEOUT, $timeout);\r
+ $ret = curl_exec($crl);\r
+ curl_close($crl);\r
+ return $ret;\r
+\r
+}\r
+\r
+/**\r
* Connects to mysql server\r
*/\r
function sql_connect() {\r
$MYSQL_CONN = @mysql_connect($MYSQL_HOST, $MYSQL_USER, $MYSQL_PASSWORD) or startUpError('<p>Could not connect to MySQL database.</p>', 'Connect Error');\r
mysql_select_db($MYSQL_DATABASE) or startUpError('<p>Could not select database: ' . mysql_error() . '</p>', 'Connect Error');\r
\r
+/*/ <add for garble measure>\r
+ $resource = sql_query("show variables LIKE 'character_set_database'");\r
+ $fetchDat = mysql_fetch_assoc($resource);\r
+ $charset = $fetchDat['Value'];\r
+ $mySqlVer = implode('.', array_map('intval', explode('.', mysql_get_server_info($MYSQL_CONN))));\r
+ if ($mySqlVer >= '5.0.7' && phpversion() >= '5.2.3') {\r
+ mysql_set_charset($charset);\r
+ } elseif ($mySqlVer >= '4.1.0') {\r
+ sql_query("SET NAMES " . $charset);\r
+ }\r
+// </add for garble measure>*/\r
+\r
return $MYSQL_CONN;\r
}\r
\r
\r
// check if valid charset\r
if (!encoding_check(false,false,$charset)) {\r
- foreach(array($_REQUEST, $_SERVER) as $input) {\r
+ foreach(array($_GET, $_POST) as $input) {\r
array_walk($input, 'encoding_check');\r
}\r
}\r
// get rid of quotes\r
$query = preg_replace('/\'|"/', '', $query);\r
\r
- if (!query) {\r
+ if (!$query) {\r
return array();\r
}\r
\r
for ($i = 0; $i < count($aHighlight); $i++) {\r
$aHighlight[$i] = trim($aHighlight[$i]);\r
\r
- if (strlen($aHighlight[$i]) < 3) {\r
- unset($aHighlight[$i]);\r
- }\r
+// if (strlen($aHighlight[$i]) < 3) {\r
+// unset($aHighlight[$i]);\r
+// }\r
}\r
\r
if (count($aHighlight) == 1) {\r
function selector() {\r
global $itemid, $blogid, $memberid, $query, $amount, $archivelist, $maxresults;\r
global $archive, $skinid, $blog, $memberinfo, $CONF, $member;\r
- global $imagepopup, $catid;\r
+ global $imagepopup, $catid, $special;\r
global $manager;\r
\r
$actionNames = array('addcomment', 'sendmessage', 'createaccount', 'forgotpassword', 'votepositive', 'votenegative', 'plugin');\r
// try to get line number/filename (extra headers_sent params only exists in PHP 4.3+)\r
if (function_exists('version_compare') && version_compare('4.3.0', phpversion(), '<=') ) {\r
headers_sent($hsFile, $hsLine);\r
- $extraInfo = ' in <code>' . $hsFile . '</code> line <code>' . $hsLine . '</code>';\r
+ $extraInfo = sprintf(_GFUNCTIONS_HEADERSALREADYSENT_FILE,$hsFile,$hsLine);\r
} else {\r
$extraInfo = '';\r
}\r
\r
startUpError(\r
- '<p>The page headers have already been sent out' . $extraInfo . '. This could cause Nucleus not to work in the expected way.</p><p>Usually, this is caused by spaces or newlines at the end of the <code>config.php</code> file, at the end of the language file or at the end of a plugin file. Please check this and try again.</p><p>If you don\'t want to see this error message again, without solving the problem, set <code>$CONF[\'alertOnHeadersSent\']</code> in <code>globalfunctions.php</code> to <code>0</code></p>',\r
- 'Page headers already sent'\r
+ sprintf(_GFUNCTIONS_HEADERSALREADYSENT_TXT,$extraInfo),\r
+ _GFUNCTIONS_HEADERSALREADYSENT_TITLE\r
);\r
exit;\r
}\r
\r
// get next and prev month links ...\r
global $archivenext, $archiveprev, $archivetype, $archivenextexists, $archiveprevexists;\r
- \r
+\r
// sql queries for the timestamp of the first and the last published item\r
$query = "SELECT UNIX_TIMESTAMP(itime) as result FROM ".sql_table('item')." WHERE idraft=0 AND iblog=".(int)($blogid ? $blogid : $CONF['DefaultBlog'])." ORDER BY itime ASC";\r
$first_timestamp=quickQuery ($query);\r
if ($d != 0) {\r
$archivetype = _ARCHIVETYPE_DAY;\r
$t = mktime(0, 0, 0, $m, $d, $y);\r
- // one day has 24 * 60 * 60 = 86400 seconds \r
+ // one day has 24 * 60 * 60 = 86400 seconds\r
$archiveprev = strftime('%Y-%m-%d', $t - 86400 );\r
- // check for published items \r
+ // check for published items\r
if ($t > $first_timestamp) {\r
$archiveprevexists = true;\r
}\r
else {\r
$archiveprevexists = false;\r
}\r
- \r
+\r
// one day later\r
- $t += 86400; \r
+ $t += 86400;\r
$archivenext = strftime('%Y-%m-%d', $t);\r
if ($t < $last_timestamp) {\r
$archivenextexists = true;\r
else {\r
$archivenextexists = false;\r
}\r
- \r
+\r
+ } elseif ($m == 0) {\r
+ $archivetype = _ARCHIVETYPE_YEAR;\r
+ $t = mktime(0, 0, 0, 12, 31, $y - 1);\r
+ // one day before is in the previous year\r
+ $archiveprev = strftime('%Y', $t);\r
+ if ($t > $first_timestamp) {\r
+ $archiveprevexists = true;\r
+ }\r
+ else {\r
+ $archiveprevexists = false;\r
+ }\r
+\r
+ // timestamp for the next year\r
+ $t = mktime(0, 0, 0, 1, 1, $y + 1);\r
+ $archivenext = strftime('%Y', $t);\r
+ if ($t < $last_timestamp) {\r
+ $archivenextexists = true;\r
+ }\r
+ else {\r
+ $archivenextexists = false;\r
+ }\r
} else {\r
$archivetype = _ARCHIVETYPE_MONTH;\r
$t = mktime(0, 0, 0, $m, 1, $y);\r
else {\r
$archiveprevexists = false;\r
}\r
- \r
- // timestamp for the next month \r
+\r
+ // timestamp for the next month\r
$t = mktime(0, 0, 0, $m+1, 1, $y);\r
$archivenext = strftime('%Y-%m', $t);\r
if ($t < $last_timestamp) {\r
if(preg_match("/^(\xA1{2}|\xe3\x80{2}|\x20)+$/", $query)){\r
$type = 'index';\r
}\r
- $order = (_CHARSET == 'EUC-JP') ? 'EUC-JP, UTF-8,' : 'UTF-8, EUC-JP,';\r
- $query = mb_convert_encoding($query, _CHARSET, $order . ' JIS, SJIS, ASCII');\r
+// $order = (_CHARSET == 'EUC-JP') ? 'EUC-JP, UTF-8,' : 'UTF-8, EUC-JP,';\r
+// $query = mb_convert_encoding($query, _CHARSET, $order . ' JIS, SJIS, ASCII');\r
+ switch(strtolower(_CHARSET)){\r
+ case 'utf-8':\r
+ $order = 'ASCII, UTF-8, EUC-JP, JIS, SJIS, EUC-CN, ISO-8859-1';\r
+ break;\r
+ case 'gb2312':\r
+ $order = 'ASCII, EUC-CN, EUC-JP, UTF-8, JIS, SJIS, ISO-8859-1';\r
+ break;\r
+ case 'shift_jis':\r
+ // Note that shift_jis is only supported for output.\r
+ // Using shift_jis in DB is prohibited.\r
+ $order = 'ASCII, SJIS, EUC-JP, UTF-8, JIS, EUC-CN, ISO-8859-1';\r
+ break;\r
+ default:\r
+ // euc-jp,iso-8859-x,windows-125x\r
+ $order = 'ASCII, EUC-JP, UTF-8, JIS, SJIS, EUC-CN, ISO-8859-1';\r
+ break;\r
+ }\r
+ $query = mb_convert_encoding($query, _CHARSET, $order);\r
if (is_numeric($blogid)) {\r
$blogid = intVal($blogid);\r
} else {\r
$type = 'index';\r
}\r
\r
+ // any type of skin with catid\r
+ if ($catid && !$blogid) {\r
+ $blogid = getBlogIDFromCatID($catid);\r
+ }\r
+\r
// decide which blog should be displayed\r
if (!$blogid) {\r
$blogid = $CONF['DefaultBlog'];\r
\r
// set catid if necessary\r
if ($catid) {\r
- $blog->setSelectedCategory($catid);\r
+ // check if the category is valid\r
+ if (!$blog->isValidCategory($catid)) {\r
+ doError(_ERROR_NOSUCHCATEGORY);\r
+ } else {\r
+ $blog->setSelectedCategory($catid);\r
+ }\r
}\r
\r
// decide which skin should be used\r
$skinid = $blog->getDefaultSkin();\r
}\r
\r
- $special = requestVar('special');\r
+ //$special = requestVar('special'); //get at top of file as global\r
if (!empty($special) && isValidShortName($special)) {\r
$type = strtolower($special);\r
}\r
\r
}\r
\r
+ $skinid = $skin->id;\r
$errormessage = $msg;\r
$skin->parse('error');\r
exit;\r
$text = strtr($text, $trans);\r
\r
// 2. the actual shortening\r
- if (strlen($text) > $maxlength)\r
- $text = mb_strimwidth($text, 0, $maxlength, $toadd, _CHARSET);\r
+ if (strlen($text) > $maxlength) {\r
+// $text = substr($text, 0, $maxlength - strlen($toadd) ) . $toadd;\r
+ $text = mb_strimwidth($text, 0, $maxlength, $toadd, _CHARSET); // for Japanese\r
+ }\r
return $text;\r
}\r
\r
PARSER::setProperty('IncludePrefix', $includePrefix);\r
\r
if (!file_exists($filename) ) {\r
- doError('A file is missing');\r
+ doError(_GFUNCTIONS_PARSEFILE_FILEMISSING);\r
}\r
\r
$fsize = filesize($filename);\r
}\r
\r
function helpHtml($id) {\r
- return helplink($id) . '<img src="documentation/icon-help.gif" width="15" height="15" alt="' . _HELP_TT . '" /></a>';\r
+ global $CONF;\r
+ return helplink($id) . '<img src="' . $CONF['AdminURL'] . 'documentation/icon-help.gif" width="15" height="15" alt="' . _HELP_TT . '" title="' . _HELP_TT . '" /></a>';\r
}\r
\r
function helplink($id) {\r
- return '<a href="documentation/help.html#'. $id . '" onclick="if (event && event.preventDefault) event.preventDefault(); return help(this.href);">';\r
+ global $CONF;\r
+ return '<a href="' . $CONF['AdminURL'] . 'documentation/help.html#'. $id . '" onclick="if (event && event.preventDefault) event.preventDefault(); return help(this.href);">';\r
}\r
\r
function getMailFooter() {\r
}\r
\r
\r
-/** \r
+/**\r
* Sanitize parameters such as $_GET and $_SERVER['REQUEST_URI'] etc.\r
- * to avoid XSS \r
+ * to avoid XSS\r
*/\r
function sanitizeParams()\r
{\r
global $HTTP_SERVER_VARS;\r
- \r
+\r
$array = array();\r
$str = '';\r
$frontParam = '';\r
- \r
+\r
// REQUEST_URI of $HTTP_SERVER_VARS\r
$str =& $HTTP_SERVER_VARS["REQUEST_URI"];\r
serverStringToArray($str, $array, $frontParam);\r
sanitizeArray($array);\r
arrayToServerString($array, $frontParam, $str);\r
- \r
+\r
// QUERY_STRING of $HTTP_SERVER_VARS\r
$str =& $HTTP_SERVER_VARS["QUERY_STRING"];\r
serverStringToArray($str, $array, $frontParam);\r
sanitizeArray($array);\r
arrayToServerString($array, $frontParam, $str);\r
- \r
+\r
if (phpversion() >= '4.1.0') {\r
// REQUEST_URI of $_SERVER\r
$str =& $_SERVER["REQUEST_URI"];\r
serverStringToArray($str, $array, $frontParam);\r
sanitizeArray($array);\r
arrayToServerString($array, $frontParam, $str);\r
- \r
+\r
// QUERY_STRING of $_SERVER\r
$str =& $_SERVER["QUERY_STRING"];\r
serverStringToArray($str, $array, $frontParam);\r
sanitizeArray($array);\r
arrayToServerString($array, $frontParam, $str);\r
}\r
- \r
+\r
// $_GET\r
convArrayForSanitizing($_GET, $array);\r
sanitizeArray($array);\r
revertArrayForSanitizing($array, $_GET);\r
- \r
+\r
// $_REQUEST (only GET param)\r
convArrayForSanitizing($_REQUEST, $array);\r
sanitizeArray($array);\r
revertArrayForSanitizing($array, $_REQUEST);\r
}\r
\r
-/** \r
+/**\r
* Check ticket when not checked in plugin's admin page\r
* to avoid CSRF.\r
* Also avoid the access to plugin/index.php by guest user.\r
*/\r
function ticketForPlugin(){\r
global $CONF,$DIR_PLUGINS,$member,$ticketforplugin;\r
- \r
+\r
/* initialize */\r
$ticketforplugin=array();\r
$ticketforplugin['ticket']=false;\r
- \r
+\r
/* Check if using plugin's php file. */\r
if ($p_translated=serverVar('PATH_TRANSLATED')) {\r
if (!file_exists($p_translated)) $p_translated='';\r
$p_translated=str_replace('\\','/',$p_translated);\r
$d_plugins=str_replace('\\','/',$DIR_PLUGINS);\r
if (strpos($p_translated,$d_plugins)!==0) return;// This isn't plugin php file.\r
- \r
+\r
/* Solve the plugin php file or admin directory */\r
$phppath=substr($p_translated,strlen($d_plugins));\r
$phppath=preg_replace('!^/!','',$phppath);// Remove the first "/" if exists.\r
$path=preg_replace('/^NP_(.*)\.php$/','$1',$phppath); // Remove the first "NP_" and the last ".php" if exists.\r
$path=preg_replace('!^([^/]*)/(.*)$!','$1',$path); // Remove the "/" and beyond.\r
- \r
+\r
/* Solve the plugin name. */\r
$plugins=array();\r
$query='SELECT pfile FROM '.sql_table('plugin');\r
header("HTTP/1.0 404 Not Found");\r
exit('');\r
}\r
- \r
+\r
/* Return if not index.php */\r
if ( $phppath!=strtolower($plugin_name).'/'\r
&& $phppath!=strtolower($plugin_name).'/index.php' ) return;\r
- \r
+\r
/* Exit if not logged in. */\r
- if ( !$member->isLoggedIn() ) exit("You aren't logged in.");\r
- \r
+ if ( !$member->isLoggedIn() ) exit(_GFUNCTIONS_YOU_AERNT_LOGGEDIN);\r
+\r
global $manager,$DIR_LIBS,$DIR_LANG,$HTTP_GET_VARS,$HTTP_POST_VARS;\r
- \r
+\r
/* Check if this feature is needed (ie, if "$manager->checkTicket()" is not included in the script). */\r
if (!($p_translated=serverVar('PATH_TRANSLATED'))) $p_translated=serverVar('SCRIPT_FILENAME');\r
if ($file=@file($p_translated)) {\r
$prevline=$line;\r
}\r
}\r
- \r
+\r
/* Show a form if not valid ticket */\r
if ( ( strstr(serverVar('REQUEST_URI'),'?') || serverVar('QUERY_STRING')\r
|| strtoupper(serverVar('REQUEST_METHOD'))=='POST' )\r
$oPluginAdmin = new PluginAdmin($plugin_name);\r
$oPluginAdmin->start();\r
echo '<p>' . _ERROR_BADTICKET . "</p>\n";\r
- \r
+\r
/* Show the form to confirm action */\r
// PHP 4.0.x support\r
$get= (isset($_GET)) ? $_GET : $HTTP_GET_VARS;\r
echo '<input type="submit" value="'._YES.'" /> ';\r
echo '<input type="button" value="'._NO.'" onclick="history.back(); return false;" />';\r
echo "</form>\n";\r
- \r
+\r
$oPluginAdmin->end();\r
exit;\r
}\r
- \r
+\r
/* Create new ticket */\r
$ticket=$manager->addTicketToUrl('');\r
$ticketforplugin['ticket']=substr($ticket,strpos($ticket,'ticket=')+7);\r
}\r
}\r
\r
-/** \r
+/**\r
* Convert the server string such as $_SERVER['REQUEST_URI']\r
* to arry like arry['blogid']=1 and array['page']=2 etc.\r
*/\r
$args = $str;\r
$frontParam = "";\r
}\r
- \r
+\r
// If there is no args like blogid=1&page=2, return\r
if (!strstr($str, "=") && !strlen($frontParam)) {\r
$frontParam = $str;\r
$array = explode("&", $args);\r
}\r
\r
-/** \r
+/**\r
* Convert array like array['blogid'] to server string\r
* such as $_SERVER['REQUEST_URI']\r
*/\r
}\r
}\r
\r
-/** \r
+/**\r
* Sanitize array parameters.\r
* This function checks both key and value.\r
* - check key if it inclues " (double quote), remove from array\r
* - check value if it includes \ (escape sequece), remove remaining string\r
*/\r
function sanitizeArray(&$array)\r
-{ \r
+{\r
$excludeListForSanitization = array('query');\r
// $excludeListForSanitization = array();\r
\r
$val = stripslashes($val);\r
}\r
$val = addslashes($val);\r
- \r
+\r
// if $key is included in exclude list, skip this param\r
if (!in_array($key, $excludeListForSanitization)) {\r
- \r
+\r
// check value\r
- @list($val, $tmp) = explode('\\', $val);\r
- \r
+ if (strpos($val, '\\')) {\r
+ list($val, $tmp) = explode('\\', $val);\r
+ }\r
+\r
// remove control code etc.\r
$val = strtr($val, "\0\r\n<>'\"", " ");\r
- \r
+\r
// check key\r
if (preg_match('/\"/i', $key)) {\r
unset($array[$k]);\r
continue;\r
}\r
- \r
+\r
// set sanitized info\r
$array[$k] = sprintf("%s=%s", $key, $val);\r
}\r
$string = entity::named_to_numeric($string);\r
$string = entity::normalize_numeric($string);\r
\r
- if (_CHARSET == 'UTF-8') {\r
+ if (strtoupper(_CHARSET) == 'UTF-8') {\r
$string = entity::numeric_to_utf8($string);\r
}\r
\r
$string = entity::named_to_numeric($string);\r
$string = entity::normalize_numeric($string);\r
\r
- if (_CHARSET == 'UTF-8') {\r
+ if (strtoupper(_CHARSET) == 'UTF-8') {\r
$string = entity::numeric_to_utf8($string);\r
}\r
\r
* @todo document this\r
*/\r
function encode_desc(&$data)\r
- { //_$to_entities = get_html_translation_table(HTML_ENTITIES);\r
- $to_entities = get_html_translation_table(HTML_SPECIALCHARS);\r
- $from_entities = array_flip($to_entities);\r
- $data = str_replace('<br />', '\n', $data); //hack\r
- $data = strtr($data,$from_entities);\r
- $data = strtr($data,$to_entities);\r
- $data = str_replace('\n', '<br />', $data); //hack\r
- return $data;\r
- }\r
- \r
+{\r
+// _$to_entities = get_html_translation_table(HTML_ENTITIES);\r
+ $to_entities = get_html_translation_table(HTML_SPECIALCHARS); // for Japanese\r
+ $from_entities = array_flip($to_entities);\r
+ $data = str_replace('<br />', '\n', $data); //hack\r
+ $data = strtr($data,$from_entities);\r
+ $data = strtr($data,$to_entities);\r
+ $data = str_replace('\n', '<br />', $data); //hack\r
+ return $data;\r
+}\r
+\r
/**\r
* Returns the Javascript code for a bookmarklet that works on most modern browsers\r
*\r
return $obj->count;\r
}\r
\r
+function selectSpecialSkinType($id) {\r
+ global $special;\r
+ $special = strtolower($id);\r
+}\r
+\r
?>
\ No newline at end of file