diff options
author | Meik Sievertsen <acydburn@phpbb.com> | 2007-07-03 15:36:18 +0000 |
---|---|---|
committer | Meik Sievertsen <acydburn@phpbb.com> | 2007-07-03 15:36:18 +0000 |
commit | b883ff119f4e42fbc967a6b1971af2198762fbd8 (patch) | |
tree | 95341356c3efea7cad58309f28c224c45296f1f5 /phpBB | |
parent | 3d9b5e52d9a14495f42d676428b6d00aff756923 (diff) | |
download | forums-b883ff119f4e42fbc967a6b1971af2198762fbd8.tar forums-b883ff119f4e42fbc967a6b1971af2198762fbd8.tar.gz forums-b883ff119f4e42fbc967a6b1971af2198762fbd8.tar.bz2 forums-b883ff119f4e42fbc967a6b1971af2198762fbd8.tar.xz forums-b883ff119f4e42fbc967a6b1971af2198762fbd8.zip |
let's see if i can break something. :o
git-svn-id: file:///svn/phpbb/trunk@7830 89ea8834-ac86-4346-8a33-228a782c2dd0
Diffstat (limited to 'phpBB')
-rw-r--r-- | phpBB/develop/create_schema_files.php | 8 | ||||
-rw-r--r-- | phpBB/includes/acm/acm_file.php | 22 | ||||
-rw-r--r-- | phpBB/includes/acp/acp_php_info.php | 2 | ||||
-rw-r--r-- | phpBB/includes/functions.php | 6 | ||||
-rw-r--r-- | phpBB/includes/functions_install.php | 9 | ||||
-rw-r--r-- | phpBB/includes/functions_messenger.php | 2 | ||||
-rw-r--r-- | phpBB/includes/functions_posting.php | 5 | ||||
-rwxr-xr-x | phpBB/install/install_install.php | 8 |
8 files changed, 35 insertions, 27 deletions
diff --git a/phpBB/develop/create_schema_files.php b/phpBB/develop/create_schema_files.php index 5bcda458bf..1261d4f57e 100644 --- a/phpBB/develop/create_schema_files.php +++ b/phpBB/develop/create_schema_files.php @@ -764,10 +764,10 @@ foreach ($supported_dbms as $dbms) * BOOL => tinyint(1) UNSIGNED * VCHAR => varchar(255) * CHAR:x => char(x) -* XSTEXT => text for storing 1000 characters (topic_title for example) -* STEXT => text for storing 3000 characters (normal input field with a max of 255 single-byte chars) -* TEXT => text for storing 8000 characters (short text, descriptions, comments, etc.) -* MTEXT => mediumtext (post text, large text) +* XSTEXT_UNI => text for storing 100 characters (topic_title for example) +* STEXT_UNI => text for storing 255 characters (normal input field with a max of 255 single-byte chars) - same as VCHAR_UNI +* TEXT_UNI => text for storing 3000 characters (short text, descriptions, comments, etc.) +* MTEXT_UNI => mediumtext (post text, large text) * VCHAR:x => varchar(x) * TIMESTAMP => int(11) UNSIGNED * DECIMAL => decimal number (5,2) diff --git a/phpBB/includes/acm/acm_file.php b/phpBB/includes/acm/acm_file.php index faa6403a2e..63eaa341f5 100644 --- a/phpBB/includes/acm/acm_file.php +++ b/phpBB/includes/acm/acm_file.php @@ -121,7 +121,7 @@ class acm @include($this->cache_dir . $entry); if ($expired) { - @unlink($this->cache_dir . $entry); + $this->remove_file($this->cache_dir . $entry); } } closedir($dir); @@ -215,7 +215,7 @@ class acm continue; } - @unlink($this->cache_dir . $entry); + $this->remove_file($this->cache_dir . $entry); } closedir($dir); @@ -273,7 +273,7 @@ class acm if ($found) { - @unlink($this->cache_dir . $entry); + $this->remove_file($this->cache_dir . $entry); } } closedir($dir); @@ -288,7 +288,7 @@ class acm if ($var_name[0] == '_') { - @unlink($this->cache_dir . 'data' . $var_name . ".$phpEx"); + $this->remove_file($this->cache_dir . 'data' . $var_name . ".$phpEx"); } else if (isset($this->vars[$var_name])) { @@ -351,7 +351,7 @@ class acm } else if ($expired) { - @unlink($this->cache_dir . 'sql_' . md5($query) . ".$phpEx"); + $this->remove_file($this->cache_dir . 'sql_' . md5($query) . ".$phpEx"); return false; } @@ -461,6 +461,18 @@ class acm return true; } + + /** + * Removes/unlinks file + */ + function remove_file($filename) + { + if (!@unlink($filename)) + { + // E_USER_ERROR - not using language entry - intended. + trigger_error('Unable to remove files within ' . $this->cache_dir . '. Please check directory permissions.', E_USER_ERROR); + } + } } ?>
\ No newline at end of file diff --git a/phpBB/includes/acp/acp_php_info.php b/phpBB/includes/acp/acp_php_info.php index 342d89addd..d5adef1097 100644 --- a/phpBB/includes/acp/acp_php_info.php +++ b/phpBB/includes/acp/acp_php_info.php @@ -51,7 +51,7 @@ class acp_php_info $output = str_replace(array('class="e"', 'class="v"', 'class="h"', '<hr />', '<font', '</font>'), array('class="row1"', 'class="row2"', '', '', '<span', '</span>'), $output); preg_match_all('#<div class="center">(.*)</div>#siU', $output, $output); - $output = $output[1][0]; + $output = (!empty($output[1][0])) ? $output[1][0] : @$output[1]; $template->assign_var('PHPINFO', $output); } diff --git a/phpBB/includes/functions.php b/phpBB/includes/functions.php index a91bddd9b8..caf26bf379 100644 --- a/phpBB/includes/functions.php +++ b/phpBB/includes/functions.php @@ -472,7 +472,7 @@ if (!function_exists('stripos')) if (!function_exists('realpath')) { - if (substr(PHP_OS, 0, 3) != 'WIN' && !(bool) ini_get('safe_mode') && function_exists('shell_exec') && trim(`realpath .`)) + if (DIRECTORY_SEPARATOR != '\\' && !(bool) ini_get('safe_mode') && function_exists('shell_exec') && trim(`realpath .`)) { /** * @author Chris Smith <chris@project-minerva.org> @@ -497,7 +497,7 @@ if (!function_exists('realpath')) */ function is_absolute($path) { - return ($path[0] == '/' || (substr(PHP_OS, 0, 3) == 'WIN' && preg_match('#^[a-z]:/#i', $path))) ? true : false; + return ($path[0] == '/' || (DIRECTORY_SEPARATOR == '\\' && preg_match('#^[a-z]:/#i', $path))) ? true : false; } /** @@ -3608,7 +3608,7 @@ function phpbb_checkdnsrr($host, $type = '') { $type = (!$type) ? 'MX' : $type; - if (strpos(PHP_OS, 'WIN') !== false) + if (DIRECTORY_SEPARATOR == '\\') { if (!function_exists('exec')) { diff --git a/phpBB/includes/functions_install.php b/phpBB/includes/functions_install.php index 61ac1883b3..133ef294b0 100644 --- a/phpBB/includes/functions_install.php +++ b/phpBB/includes/functions_install.php @@ -13,14 +13,7 @@ */ function can_load_dll($dll) { - global $suffix; - - if (empty($suffix)) - { - $suffix = (defined('PHP_OS') && strpos(strtolower(PHP_OS), 'win') === 0) ? 'dll' : 'so'; - } - - return ((@ini_get('enable_dl') || strtolower(@ini_get('enable_dl')) == 'on') && (!@ini_get('safe_mode') || strtolower(@ini_get('safe_mode')) == 'off') && @dl($dll . ".$suffix")) ? true : false; + return ((@ini_get('enable_dl') || strtolower(@ini_get('enable_dl')) == 'on') && (!@ini_get('safe_mode') || strtolower(@ini_get('safe_mode')) == 'off') && @dl($dll . '.' . PHP_SHLIB_SUFFIX)) ? true : false; } /** diff --git a/phpBB/includes/functions_messenger.php b/phpBB/includes/functions_messenger.php index 6497bfb392..b2cb5ec054 100644 --- a/phpBB/includes/functions_messenger.php +++ b/phpBB/includes/functions_messenger.php @@ -52,7 +52,7 @@ class messenger $this->addresses['to'][$pos]['email'] = trim($address); // If empty sendmail_path on windows, PHP changes the to line - if (!$config['smtp_delivery'] && strpos(strtolower(PHP_OS), 'win') === 0) + if (!$config['smtp_delivery'] && DIRECTORY_SEPARATOR == '\\') { $this->addresses['to'][$pos]['name'] = ''; } diff --git a/phpBB/includes/functions_posting.php b/phpBB/includes/functions_posting.php index cf38f07a15..fb8c4a85e8 100644 --- a/phpBB/includes/functions_posting.php +++ b/phpBB/includes/functions_posting.php @@ -2253,7 +2253,10 @@ function submit_post($mode, $subject, $username, $topic_type, &$poll, &$data, $u trigger_error('NO_SUCH_SEARCH_MODULE'); } - require_once("{$phpbb_root_path}includes/search/$search_type.$phpEx"); + if (!class_exists($search_type)) + { + include("{$phpbb_root_path}includes/search/$search_type.$phpEx"); + } $error = false; $search = new $search_type($error); diff --git a/phpBB/install/install_install.php b/phpBB/install/install_install.php index 5b753d12ca..7fd4c881c6 100755 --- a/phpBB/install/install_install.php +++ b/phpBB/install/install_install.php @@ -380,7 +380,7 @@ class install_install extends module } // Can we find Imagemagick anywhere on the system? - $exe = (defined('PHP_OS') && strpos(strtolower(PHP_OS), 'win') === 0) ? '.exe' : ''; + $exe = (DIRECTORY_SEPARATOR == '\\') ? '.exe' : ''; $magic_home = getenv('MAGICK_HOME'); $img_imagick = ''; @@ -868,8 +868,6 @@ class install_install extends module $available_dbms = get_available_dbms($dbms); $check_exts = array_merge(array($available_dbms[$dbms]['MODULE']), $this->php_dlls_other); - $suffix = (defined('PHP_OS') && strpos(strtolower(PHP_OS), 'win') === 0) ? 'dll' : 'so'; - foreach ($check_exts as $dll) { if (!@extension_loaded($dll)) @@ -879,7 +877,7 @@ class install_install extends module continue; } - $load_extensions[] = "$dll.$suffix"; + $load_extensions[] = $dll . '.' . PHP_SHLIB_SUFFIX; } } @@ -892,6 +890,8 @@ class install_install extends module } @fclose($fp); + @chmod($phpbb_root_path . 'cache/install_lock', 0666); + $dbpasswd = htmlspecialchars_decode($dbpasswd); $load_extensions = implode(',', $load_extensions); |