some updates. Also adjusted the utf tools and normalizer more to our coding guidelines.

git-svn-id: file:///svn/phpbb/trunk@6312 89ea8834-ac86-4346-8a33-228a782c2dd0
This commit is contained in:
Meik Sievertsen 2006-08-22 21:26:06 +00:00
parent b0afc8e632
commit 1d42d1b981
30 changed files with 1545 additions and 1875 deletions

View file

@ -177,8 +177,8 @@
</dl>
<!-- BEGIN data -->
<dl>
<dt><label for="store">{data.NAME}:</label><br /><span>{data.EXPLAIN}</span></dt>
<dd><input type="text" id="{data.DATA}" name="{data.DATA}" value="{data.DEFAULT}" checked="checked" /></dd>
<dt><label for="{data.DATA}">{data.NAME}:</label><br /><span>{data.EXPLAIN}</span></dt>
<dd><input type="text" id="{data.DATA}" name="{data.DATA}" value="{data.DEFAULT}" /></dd>
</dl>
<!-- END data -->
</fieldset>

View file

@ -34,6 +34,8 @@ Text_Diff-0.2.1 http://pear.php.net/package/Text_Diff
GPL licenced:
phpMyAdmin © 2001,2003 phpMyAdmin Devel team, http://www.phpmyadmin.net/
Jabber class © 2003 Carlo Zottmann, http://phpjabber.g-blog.net
Chora: Copyright 2000-2006, The Horde Project. http://horde.org/chora/
Horde Project: Copyright 2000-2006, The Horde Project. http://horde.org/
PHP License, version 3.0:
Pear © 2001-2004 PHP Group, http://pear.php.net

View file

@ -175,6 +175,32 @@ class acm
}
}
/**
* Purge cache data
*/
function purge()
{
// Purge sql data
$dir = opendir($this->cache_dir);
while (($entry = readdir($dir)) !== false)
{
if (strpos($entry, 'sql_') !== 0 && strpos($entry, 'data_') !== 0 && strpos($entry, 'ctpl_') !== 0 && strpos($entry, 'tpl_') !== 0)
{
continue;
}
@unlink($this->cache_dir . $entry);
}
@closedir($dir);
unset($this->vars);
unset($this->var_expires);
unset($this->sql_rowset);
unset($this->sql_row_pointer);
$this->is_modified = false;
}
/**
* Destroy cache data
*/

View file

@ -838,7 +838,7 @@ class acp_language
$compress->close();
$compress->download('lang_' . $row['lang_iso']);
@unlink($phpbb_root_path . 'store/lang_' . $row['lang_iso'] . '.' . $use_method);
@unlink($phpbb_root_path . 'store/lang_' . $row['lang_iso'] . $use_method);
exit;

View file

@ -131,7 +131,7 @@ class dbal
/**
* SQL Transaction
* @access: private
* @access private
*/
function sql_transaction($status = 'begin')
{

View file

@ -66,7 +66,7 @@ class dbal_firebird extends dbal
/**
* SQL Transaction
* @access: private
* @access private
*/
function _sql_transaction($status = 'begin')
{
@ -360,7 +360,7 @@ class dbal_firebird extends dbal
/**
* Build db-specific query data
* @access: private
* @access private
*/
function _sql_custom_build($stage, $data)
{
@ -369,7 +369,7 @@ class dbal_firebird extends dbal
/**
* return sql error array
* @access: private
* @access private
*/
function _sql_error()
{
@ -381,7 +381,7 @@ class dbal_firebird extends dbal
/**
* Close sql connection
* @access: private
* @access private
*/
function _sql_close()
{
@ -395,7 +395,7 @@ class dbal_firebird extends dbal
/**
* Build db-specific report
* @access: private
* @access private
*/
function _sql_report($mode, $query = '')
{

View file

@ -79,7 +79,7 @@ class dbal_mssql extends dbal
/**
* SQL Transaction
* @access: private
* @access private
*/
function _sql_transaction($status = 'begin')
{
@ -371,7 +371,7 @@ class dbal_mssql extends dbal
/**
* return sql error array
* @access: private
* @access private
*/
function _sql_error()
{
@ -410,7 +410,7 @@ class dbal_mssql extends dbal
/**
* Build db-specific query data
* @access: private
* @access private
*/
function _sql_custom_build($stage, $data)
{
@ -419,7 +419,7 @@ class dbal_mssql extends dbal
/**
* Close sql connection
* @access: private
* @access private
*/
function _sql_close()
{
@ -428,7 +428,7 @@ class dbal_mssql extends dbal
/**
* Build db-specific report
* @access: private
* @access private
*/
function _sql_report($mode, $query = '')
{

View file

@ -73,7 +73,7 @@ class dbal_mssql_odbc extends dbal
/**
* SQL Transaction
* @access: private
* @access private
*/
function _sql_transaction($status = 'begin')
{
@ -381,7 +381,7 @@ class dbal_mssql_odbc extends dbal
/**
* Build db-specific query data
* @access: private
* @access private
*/
function _sql_custom_build($stage, $data)
{
@ -390,7 +390,7 @@ class dbal_mssql_odbc extends dbal
/**
* return sql error array
* @access: private
* @access private
*/
function _sql_error()
{
@ -402,7 +402,7 @@ class dbal_mssql_odbc extends dbal
/**
* Close sql connection
* @access: private
* @access private
*/
function _sql_close()
{
@ -411,7 +411,7 @@ class dbal_mssql_odbc extends dbal
/**
* Build db-specific report
* @access: private
* @access private
*/
function _sql_report($mode, $query = '')
{

View file

@ -33,7 +33,7 @@ class dbal_mysql extends dbal
{
/**
* Connect to server
* @access: public
* @access public
*/
function sql_connect($sqlserver, $sqluser, $sqlpassword, $database, $port = false, $persistency = false)
{
@ -65,7 +65,7 @@ class dbal_mysql extends dbal
/**
* SQL Transaction
* @access: private
* @access private
*/
function _sql_transaction($status = 'begin')
{
@ -330,7 +330,7 @@ class dbal_mysql extends dbal
/**
* Build db-specific query data
* @access: private
* @access private
*/
function _sql_custom_build($stage, $data)
{
@ -346,7 +346,7 @@ class dbal_mysql extends dbal
/**
* return sql error array
* @access: private
* @access private
*/
function _sql_error()
{
@ -366,7 +366,7 @@ class dbal_mysql extends dbal
/**
* Close sql connection
* @access: private
* @access private
*/
function _sql_close()
{
@ -375,7 +375,7 @@ class dbal_mysql extends dbal
/**
* Build db-specific report
* @access: private
* @access private
*/
function _sql_report($mode, $query = '')
{

View file

@ -67,7 +67,7 @@ class dbal_mysql4 extends dbal
/**
* SQL Transaction
* @access: private
* @access private
*/
function _sql_transaction($status = 'begin')
{
@ -333,7 +333,7 @@ class dbal_mysql4 extends dbal
/**
* Build db-specific query data
* @access: private
* @access private
*/
function _sql_custom_build($stage, $data)
{
@ -349,7 +349,7 @@ class dbal_mysql4 extends dbal
/**
* return sql error array
* @access: private
* @access private
*/
function _sql_error()
{
@ -369,7 +369,7 @@ class dbal_mysql4 extends dbal
/**
* Close sql connection
* @access: private
* @access private
*/
function _sql_close()
{
@ -378,7 +378,7 @@ class dbal_mysql4 extends dbal
/**
* Build db-specific report
* @access: private
* @access private
*/
function _sql_report($mode, $query = '')
{

View file

@ -67,7 +67,7 @@ class dbal_mysqli extends dbal
/**
* SQL Transaction
* @access: private
* @access private
*/
function _sql_transaction($status = 'begin')
{
@ -313,7 +313,7 @@ class dbal_mysqli extends dbal
/**
* Build db-specific query data
* @access: private
* @access private
*/
function _sql_custom_build($stage, $data)
{
@ -329,7 +329,7 @@ class dbal_mysqli extends dbal
/**
* return sql error array
* @access: private
* @access private
*/
function _sql_error()
{
@ -349,7 +349,7 @@ class dbal_mysqli extends dbal
/**
* Close sql connection
* @access: private
* @access private
*/
function _sql_close()
{
@ -358,7 +358,7 @@ class dbal_mysqli extends dbal
/**
* Build db-specific report
* @access: private
* @access private
*/
function _sql_report($mode, $query = '')
{

View file

@ -57,7 +57,7 @@ class dbal_oracle extends dbal
/**
* SQL Transaction
* @access: private
* @access private
*/
function _sql_transaction($status = 'begin')
{
@ -443,7 +443,7 @@ class dbal_oracle extends dbal
/**
* return sql error array
* @access: private
* @access private
*/
function _sql_error()
{
@ -465,7 +465,7 @@ class dbal_oracle extends dbal
/**
* Close sql connection
* @access: private
* @access private
*/
function _sql_close()
{
@ -474,7 +474,7 @@ class dbal_oracle extends dbal
/**
* Build db-specific report
* @access: private
* @access private
*/
function _sql_report($mode, $query = '')
{

View file

@ -105,7 +105,7 @@ class dbal_postgres extends dbal
/**
* SQL Transaction
* @access: private
* @access private
*/
function _sql_transaction($status = 'begin')
{
@ -189,7 +189,7 @@ class dbal_postgres extends dbal
/**
* Build db-specific query data
* @access: private
* @access private
*/
function _sql_custom_build($stage, $data)
{
@ -398,7 +398,7 @@ class dbal_postgres extends dbal
/**
* return sql error array
* @access: private
* @access private
*/
function _sql_error()
{
@ -410,7 +410,7 @@ class dbal_postgres extends dbal
/**
* Close sql connection
* @access: private
* @access private
*/
function _sql_close()
{
@ -419,7 +419,7 @@ class dbal_postgres extends dbal
/**
* Build db-specific report
* @access: private
* @access private
*/
function _sql_report($mode, $query = '')
{

View file

@ -63,7 +63,7 @@ class dbal_sqlite extends dbal
/**
* SQL Transaction
* @access: private
* @access private
*/
function _sql_transaction($status = 'begin')
{
@ -310,7 +310,7 @@ class dbal_sqlite extends dbal
/**
* return sql error array
* @access: private
* @access private
*/
function _sql_error()
{
@ -322,7 +322,7 @@ class dbal_sqlite extends dbal
/**
* Build db-specific query data
* @access: private
* @access private
*/
function _sql_custom_build($stage, $data)
{
@ -331,7 +331,7 @@ class dbal_sqlite extends dbal
/**
* Close sql connection
* @access: private
* @access private
*/
function _sql_close()
{
@ -340,7 +340,7 @@ class dbal_sqlite extends dbal
/**
* Build db-specific report
* @access: private
* @access private
*/
function _sql_report($mode, $query = '')
{

View file

@ -15,7 +15,7 @@
*
* Set variable, used by {@link request_var the request_var function}
*
* @access: private
* @access private
*/
function set_var(&$result, $var, $type, $multibyte = false)
{
@ -1865,7 +1865,8 @@ function login_box($redirect = '', $l_explain = '', $l_success = '', $admin = fa
if (!$redirect)
{
// We just use what the session code determined...
$redirect = $user->page['page_name'] . (($user->page['query_string']) ? '?' . $user->page['query_string'] : '');
// We do not append the phpbb_root_path directory because we are within the root dir if the redirect happens and not within the current directory.
$redirect = (($user->page['page_dir']) ? $user->page['page_dir'] . '/' : '') . $user->page['page_name'] . (($user->page['query_string']) ? '?' . $user->page['query_string'] : '');
}
$s_hidden_fields = build_hidden_fields(array('redirect' => $redirect, 'sid' => $user->session_id));

View file

@ -2467,7 +2467,7 @@ function get_remote_file($host, $directory, $filename, &$errstr, &$errno, $port
}
else if (strpos($line, '404 Not Found') !== false)
{
$errstr = $user->lang['FILE_NOT_FOUND'];
$errstr = $user->lang['FILE_NOT_FOUND'] . ': ' . $filename;
return false;
}
}

View file

@ -627,7 +627,7 @@ class jabber
/**
* Send auth
* @access: private
* @access private
*/
function _sendauth_ok($zerok_token, $zerok_sequence)
{
@ -655,7 +655,7 @@ class jabber
/**
* Send auth digest
* @access: private
* @access private
*/
function _sendauth_digest()
{
@ -671,7 +671,7 @@ class jabber
/**
* Send auth plain
* @access: private
* @access private
*/
function _sendauth_plaintext()
{
@ -687,7 +687,7 @@ class jabber
/**
* Listen on socket
* @access: private
* @access private
*/
function _listen_incoming()
{
@ -704,7 +704,7 @@ class jabber
/**
* Check if connected
* @access: private
* @access private
*/
function _check_connected()
{
@ -733,7 +733,7 @@ class jabber
/**
* Split incoming packet
* @access: private
* @access private
*/
function _split_incoming($incoming)
{
@ -750,7 +750,7 @@ class jabber
/**
* Get packet type
* @access: private
* @access private
*/
function _get_packet_type($packet = NULL)
{
@ -765,7 +765,7 @@ class jabber
/**
* Recursively prepares the strings in an array to be used in XML data.
* @access: private
* @access private
*/
function _array_xmlspecialchars(&$array)
{
@ -787,7 +787,7 @@ class jabber
/**
* Prepares a string for usage in XML data.
* @access: private
* @access private
*/
function _xmlspecialchars(&$string)
{
@ -797,7 +797,7 @@ class jabber
/**
* Recursively converts all elements in an array to UTF-8 from the encoding stored in {@link encoding the encoding attribute}.
* @access: private
* @access private
*/
function _array_conv_utf8(&$array)
{
@ -830,7 +830,7 @@ class jabber
*
* @return boolean True on success, false on failure.
*
* @access: private
* @access private
*/
function _conv_utf8(&$string)
{

View file

@ -706,7 +706,7 @@ class queue
/**
* Format array
* @access: private
* @access private
*/
function format_array($array)
{

View file

@ -21,7 +21,7 @@ class custom_profile
/**
* Assign editable fields to template, mode can be profile (for profile change) or register (for registration)
* Called by ucp_profile and ucp_register
* @access: public
* @access public
*/
function generate_profile_fields($mode, $lang_id)
{
@ -74,7 +74,7 @@ class custom_profile
/**
* Validate entered profile field data
* @access: public
* @access public
*/
function validate_profile_field($field_type, &$field_value, $field_data)
{
@ -186,7 +186,7 @@ class custom_profile
/**
* Build profile cache, used for display
* @access: private
* @access private
*/
function build_cache()
{
@ -248,7 +248,7 @@ class custom_profile
/**
* Submit profile field
* @access: public
* @access public
*/
function submit_cp_field($mode, $lang_id, &$cp_data, &$cp_error)
{
@ -340,7 +340,7 @@ class custom_profile
/**
* Assign fields to template, used for viewprofile, viewtopic and memberlist (if load setting is enabled)
* This is directly connected to the user -> mode == grab is to grab the user specific fields, mode == show is for assigning the row to the template
* @access: public
* @access public
*/
function generate_profile_fields_template($mode, $user_id = 0, $profile_row = false)
{
@ -535,7 +535,7 @@ class custom_profile
/**
* Get field value for registration/profile
* @access: private
* @access private
*/
function get_var($field_validation, &$profile_row, $default_value, $preview)
{
@ -590,7 +590,7 @@ class custom_profile
/**
* Process int-type
* @access: private
* @access private
*/
function generate_int($profile_row, $preview = false)
{
@ -602,7 +602,7 @@ class custom_profile
/**
* Process date-type
* @access: private
* @access private
*/
function generate_date($profile_row, $preview = false)
{
@ -661,7 +661,7 @@ class custom_profile
/**
* Process bool-type
* @access: private
* @access private
*/
function generate_bool($profile_row, $preview = false)
{
@ -692,7 +692,7 @@ class custom_profile
/**
* Process string-type
* @access: private
* @access private
*/
function generate_string($profile_row, $preview = false)
{
@ -704,7 +704,7 @@ class custom_profile
/**
* Process text-type
* @access: private
* @access private
*/
function generate_text($profile_row, $preview = false)
{
@ -721,7 +721,7 @@ class custom_profile
/**
* Process dropdown-type
* @access: private
* @access private
*/
function generate_dropdown($profile_row, $preview = false)
{
@ -750,7 +750,7 @@ class custom_profile
/**
* Return Templated value/field. Possible values for $mode are:
* change == user is able to set/enter profile values; preview == just show the value
* @access: private
* @access private
*/
function process_field_row($mode, $profile_row)
{
@ -814,7 +814,7 @@ class custom_profile
/**
* Get profile field value on submit
* @access: private
* @access private
*/
function get_profile_field($profile_row)
{

View file

@ -52,7 +52,7 @@ class template_compile
/**
* Load template source from file
* @access: private
* @access private
*/
function _tpl_load_file($handle)
{
@ -153,7 +153,7 @@ class template_compile
/**
* The all seeing all doing compile method. Parts are inspired by or directly from Smarty
* @access: private
* @access private
*/
function compile($code, $no_echo = false, $echo_var = '')
{
@ -280,7 +280,7 @@ class template_compile
/**
* Compile variables
* @access: private
* @access private
*/
function compile_var_tags(&$text_blocks)
{
@ -322,7 +322,7 @@ class template_compile
/**
* Compile blocks
* @access: private
* @access private
*/
function compile_tag_block($tag_args)
{
@ -413,7 +413,7 @@ class template_compile
/**
* Compile IF tags - much of this is from Smarty with
* some adaptions for our block level methods
* @access: private
* @access private
*/
function compile_tag_if($tag_args, $elseif)
{
@ -540,7 +540,7 @@ class template_compile
/**
* Compile DEFINE tags
* @access: private
* @access private
*/
function compile_tag_define($tag_args, $op)
{
@ -593,7 +593,7 @@ class template_compile
/**
* Compile INCLUDE tag
* @access: private
* @access private
*/
function compile_tag_include($tag_args)
{
@ -602,7 +602,7 @@ class template_compile
/**
* Compile INCLUDE_PHP tag
* @access: private
* @access private
*/
function compile_tag_include_php($tag_args)
{
@ -612,7 +612,7 @@ class template_compile
/**
* parse expression
* This is from Smarty
* @access: private
* @access private
*/
function _parse_is_expr($is_arg, $tokens)
{
@ -683,7 +683,7 @@ class template_compile
* ' . $this->_tpldata['parent'][$_parent_i]['$child1'][$_child1_i]['$child2'][$_child2_i]...['varname'] . '
* It's ready to be inserted into an "echo" line in one of the templates.
* NOTE: expects a trailing "." on the namespace.
* @access: private
* @access private
*/
function generate_block_varref($namespace, $varname, $echo = true, $defop = false)
{
@ -708,7 +708,7 @@ class template_compile
*
* If $include_last_iterator is true, then [$_childN_i] will be appended to the form shown above.
* NOTE: does not expect a trailing "." on the blockname.
* @access: private
* @access private
*/
function generate_block_data_ref($blockname, $include_last_iterator, $defop = false)
{
@ -737,7 +737,7 @@ class template_compile
/**
* Write compiled file to cache directory
* @access: private
* @access private
*/
function compile_write(&$handle, $data)
{

View file

@ -188,6 +188,24 @@ class transfer
return $this->_rename($old_handle, $new_handle);
}
/**
* Check if a specified file exist...
*/
function file_exists($directory, $filename)
{
global $phpbb_root_path;
$directory = $this->root_path . str_replace($phpbb_root_path, '', $directory);
$result = $this->_ls($directory);
if ($result !== false && is_array($result))
{
return (in_array($filename, $result)) ? true : false;
}
return false;
}
/**
* Open session
*/
@ -272,7 +290,7 @@ class ftp extends transfer
/**
* Init FTP Session
* @access: private
* @access private
*/
function _init()
{
@ -304,7 +322,7 @@ class ftp extends transfer
/**
* Create Directory (MKDIR)
* @access: private
* @access private
*/
function _mkdir($dir)
{
@ -313,7 +331,7 @@ class ftp extends transfer
/**
* Remove directory (RMDIR)
* @access: private
* @access private
*/
function _rmdir($dir)
{
@ -322,7 +340,7 @@ class ftp extends transfer
/**
* Rename file
* @access: private
* @access private
*/
function _rename($old_handle, $new_handle)
{
@ -331,7 +349,7 @@ class ftp extends transfer
/**
* Change current working directory (CHDIR)
* @access: private
* @access private
*/
function _chdir($dir = '')
{
@ -345,7 +363,7 @@ class ftp extends transfer
/**
* change file permissions (CHMOD)
* @access: private
* @access private
*/
function _chmod($file, $perms)
{
@ -364,7 +382,7 @@ class ftp extends transfer
/**
* Upload file to location (PUT)
* @access: private
* @access private
*/
function _put($from_file, $to_file)
{
@ -386,7 +404,7 @@ class ftp extends transfer
/**
* Delete file (DELETE)
* @access: private
* @access private
*/
function _delete($file)
{
@ -395,7 +413,7 @@ class ftp extends transfer
/**
* Close ftp session (CLOSE)
* @access: private
* @access private
*/
function _close()
{
@ -410,7 +428,7 @@ class ftp extends transfer
/**
* Return current working directory (CWD)
* At the moment not used by parent class
* @access: private
* @access private
*/
function _cwd()
{
@ -419,8 +437,7 @@ class ftp extends transfer
/**
* Return list of files in a given directory (LS)
* At the moment not used by parent class
* @access: private
* @access private
*/
function _ls($dir = './')
{
@ -429,7 +446,7 @@ class ftp extends transfer
/**
* FTP SITE command (ftp-only function)
* @access: private
* @access private
*/
function _site($command)
{
@ -487,7 +504,7 @@ class ftp_fsock extends transfer
/**
* Init FTP Session
* @access: private
* @access private
*/
function _init()
{
@ -526,7 +543,7 @@ class ftp_fsock extends transfer
/**
* Create Directory (MKDIR)
* @access: private
* @access private
*/
function _mkdir($dir)
{
@ -535,7 +552,7 @@ class ftp_fsock extends transfer
/**
* Remove directory (RMDIR)
* @access: private
* @access private
*/
function _rmdir($dir)
{
@ -544,7 +561,7 @@ class ftp_fsock extends transfer
/**
* Rename File
* @access: private
* @access private
*/
function _rename($old_handle, $new_handle)
{
@ -554,7 +571,7 @@ class ftp_fsock extends transfer
/**
* Change current working directory (CHDIR)
* @access: private
* @access private
*/
function _chdir($dir = '')
{
@ -568,7 +585,7 @@ class ftp_fsock extends transfer
/**
* change file permissions (CHMOD)
* @access: private
* @access private
*/
function _chmod($file, $perms)
{
@ -577,7 +594,7 @@ class ftp_fsock extends transfer
/**
* Upload file to location (PUT)
* @access: private
* @access private
*/
function _put($from_file, $to_file)
{
@ -613,7 +630,7 @@ class ftp_fsock extends transfer
/**
* Delete file (DELETE)
* @access: private
* @access private
*/
function _delete($file)
{
@ -622,7 +639,7 @@ class ftp_fsock extends transfer
/**
* Close ftp session (CLOSE)
* @access: private
* @access private
*/
function _close()
{
@ -637,7 +654,7 @@ class ftp_fsock extends transfer
/**
* Return current working directory (CWD)
* At the moment not used by parent class
* @access: private
* @access private
*/
function _cwd()
{
@ -647,8 +664,7 @@ class ftp_fsock extends transfer
/**
* Return list of files in a given directory (LS)
* At the moment not used by parent class
* @access: private
* @access private
*/
function _ls($dir = './')
{
@ -671,7 +687,7 @@ class ftp_fsock extends transfer
/**
* Send a command to server (FTP fsock only function)
* @access: private
* @access private
*/
function _send_command($command, $args = '', $check = true)
{
@ -692,7 +708,7 @@ class ftp_fsock extends transfer
/**
* Opens a connection to send data (FTP fosck only function)
* @access: private
* @access private
*/
function _open_data_connection()
{
@ -727,7 +743,7 @@ class ftp_fsock extends transfer
/**
* Closes a connection used to send data
* @access: private
* @access private
*/
function _close_data_connection()
{
@ -736,7 +752,7 @@ class ftp_fsock extends transfer
/**
* Check to make sure command was successful (FTP fsock only function)
* @access: private
* @access private
*/
function _check_command($return = false)
{

View file

@ -38,7 +38,7 @@ class filespec
/**
* File Class
* @access: private
* @access private
*/
function filespec($upload_ary, $upload_namespace)
{

View file

@ -803,7 +803,7 @@ class bbcode_firstpass extends bbcode
* @param string $url the url to check
* @return true if the url is pointing to this domain/script_path/php-file, false if not
*
* @access: private
* @access private
*/
function path_in_domain($url)
{

View file

@ -588,6 +588,9 @@ class session
$SID = '?sid=';
$this->session_id = $_SID = '';
// To make sure a valid session is created we create one for the anonymous user
$this->session_create(ANONYMOUS);
return true;
}
@ -1207,7 +1210,7 @@ class user extends session
/**
* Set language entry (called by add_lang)
* @access: private
* @access private
*/
function set_lang(&$lang, &$help, $lang_file, $use_db = false, $use_help = false)
{

View file

@ -39,7 +39,7 @@ class template
/**
* Set template location
* @access: public
* @access public
*/
function set_template()
{
@ -60,7 +60,7 @@ class template
/**
* Set custom template location (able to use directory outside of phpBB)
* @access: public
* @access public
*/
function set_custom_template($template_path, $template_name)
{
@ -75,7 +75,7 @@ class template
/**
* Sets the template filenames for handles. $filename_array
* should be a hash of handle => filename pairs.
* @access: public
* @access public
*/
function set_filenames($filename_array)
{
@ -100,7 +100,7 @@ class template
/**
* Destroy template data set
* @access: public
* @access public
*/
function destroy()
{
@ -109,7 +109,7 @@ class template
/**
* Reset/empty complete block
* @access: public
* @access public
*/
function destroy_block_vars($blockname)
{
@ -139,7 +139,7 @@ class template
/**
* Display handle
* @access: public
* @access public
*/
function display($handle, $include_once = true)
{
@ -159,7 +159,7 @@ class template
/**
* Display the handle and assign the output to a template variable or return the compiled result.
* @access: public
* @access public
*/
function assign_display($handle, $template_var = '', $return_content = true, $include_once = false)
{
@ -179,7 +179,7 @@ class template
/**
* Load a compiled template if possible, if not, recompile it
* @access: private
* @access private
*/
function _tpl_load(&$handle)
{
@ -271,7 +271,7 @@ class template
/**
* Assign key variable pairs from an array
* @access: public
* @access public
*/
function assign_vars($vararray)
{
@ -285,7 +285,7 @@ class template
/**
* Assign a single variable to a single key
* @access: public
* @access public
*/
function assign_var($varname, $varval)
{
@ -296,7 +296,7 @@ class template
/**
* Assign key variable pairs from an array to a specified block
* @access: public
* @access public
*/
function assign_block_vars($blockname, $vararray)
{
@ -398,7 +398,7 @@ class template
* and inserting at position 1 will result in this array: array(first positioned array, vararray, following vars)
*
* @return false on error, true on success
* @access: public
* @access public
*/
function alter_block_array($blockname, $vararray, $key = false, $mode = 'insert')
{
@ -484,7 +484,7 @@ class template
/**
* Include a seperate template
* @access: private
* @access private
*/
function _tpl_include($filename, $include = true)
{

File diff suppressed because it is too large Load diff

View file

@ -59,17 +59,13 @@ function utf8_recode($string, $encoding)
return $string;
}
/**
* PHP has a built-in function for encoding from iso-8859-1, let's use that
*/
// PHP has a built-in function for encoding from iso-8859-1, let's use that
if ($encoding == 'iso-8859-1')
{
return utf8_encode($string);
}
/**
* First, try iconv()
*/
// First, try iconv()
if (function_exists('iconv'))
{
$ret = @iconv($encoding, 'utf-8', $string);
@ -80,9 +76,7 @@ function utf8_recode($string, $encoding)
}
}
/**
* Try the mb_string extension
*/
// Try the mb_string extension
if (function_exists('mb_convert_encoding'))
{
$ret = @mb_convert_encoding($string, 'utf-8', $encoding);
@ -93,9 +87,7 @@ function utf8_recode($string, $encoding)
}
}
/**
* Try the recode extension
*/
// Try the recode extension
if (function_exists('recode_string'))
{
$ret = @recode_string($encoding . '..utf-8', $string);
@ -106,19 +98,15 @@ function utf8_recode($string, $encoding)
}
}
/**
* If nothing works, check if we have a custom transcoder available
*/
// If nothing works, check if we have a custom transcoder available
if (!preg_match('#^[a-z0-9\\-]+$#', $encoding))
{
/**
* Make sure the encoding name is alphanumeric, we don't want it
* to be abused into loading arbitrary files
*/
trigger_error('Unknown encoding: ' . $encoding);
// Make sure the encoding name is alphanumeric, we don't want it to be abused into loading arbitrary files
trigger_error('Unknown encoding: ' . $encoding, E_USER_ERROR);
}
global $phpbb_root_path;
if (!file_exists($phpbb_root_path . 'includes/utf/data/'))
{
return $string;

View file

@ -271,6 +271,7 @@ $lang = array_merge($lang, array(
'CURRENT_FILE' => 'Current original file',
'CURRENT_VERSION' => 'Current version',
'DATABASE_UPDATE_INFO_OLD' => 'The latest version is newer than the database info stored. Please download the correct archive.',
'DESTINATION' => 'Destination file',
'DIFF_INLINE' => 'Inline',
'DIFF_RAW' => 'Raw unified diff',