let's see if i can break something. :o

git-svn-id: file:///svn/phpbb/trunk@7830 89ea8834-ac86-4346-8a33-228a782c2dd0
This commit is contained in:
Meik Sievertsen 2007-07-03 15:36:18 +00:00
parent 3d9b5e52d9
commit b883ff119f
8 changed files with 35 additions and 27 deletions

View file

@ -764,10 +764,10 @@ foreach ($supported_dbms as $dbms)
* BOOL => tinyint(1) UNSIGNED * BOOL => tinyint(1) UNSIGNED
* VCHAR => varchar(255) * VCHAR => varchar(255)
* CHAR:x => char(x) * CHAR:x => char(x)
* XSTEXT => text for storing 1000 characters (topic_title for example) * XSTEXT_UNI => text for storing 100 characters (topic_title for example)
* STEXT => text for storing 3000 characters (normal input field with a max of 255 single-byte chars) * STEXT_UNI => text for storing 255 characters (normal input field with a max of 255 single-byte chars) - same as VCHAR_UNI
* TEXT => text for storing 8000 characters (short text, descriptions, comments, etc.) * TEXT_UNI => text for storing 3000 characters (short text, descriptions, comments, etc.)
* MTEXT => mediumtext (post text, large text) * MTEXT_UNI => mediumtext (post text, large text)
* VCHAR:x => varchar(x) * VCHAR:x => varchar(x)
* TIMESTAMP => int(11) UNSIGNED * TIMESTAMP => int(11) UNSIGNED
* DECIMAL => decimal number (5,2) * DECIMAL => decimal number (5,2)

View file

@ -121,7 +121,7 @@ class acm
@include($this->cache_dir . $entry); @include($this->cache_dir . $entry);
if ($expired) if ($expired)
{ {
@unlink($this->cache_dir . $entry); $this->remove_file($this->cache_dir . $entry);
} }
} }
closedir($dir); closedir($dir);
@ -215,7 +215,7 @@ class acm
continue; continue;
} }
@unlink($this->cache_dir . $entry); $this->remove_file($this->cache_dir . $entry);
} }
closedir($dir); closedir($dir);
@ -273,7 +273,7 @@ class acm
if ($found) if ($found)
{ {
@unlink($this->cache_dir . $entry); $this->remove_file($this->cache_dir . $entry);
} }
} }
closedir($dir); closedir($dir);
@ -288,7 +288,7 @@ class acm
if ($var_name[0] == '_') 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])) else if (isset($this->vars[$var_name]))
{ {
@ -351,7 +351,7 @@ class acm
} }
else if ($expired) else if ($expired)
{ {
@unlink($this->cache_dir . 'sql_' . md5($query) . ".$phpEx"); $this->remove_file($this->cache_dir . 'sql_' . md5($query) . ".$phpEx");
return false; return false;
} }
@ -461,6 +461,18 @@ class acm
return true; 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);
}
}
} }
?> ?>

View file

@ -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); $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); 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); $template->assign_var('PHPINFO', $output);
} }

View file

@ -472,7 +472,7 @@ if (!function_exists('stripos'))
if (!function_exists('realpath')) 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> * @author Chris Smith <chris@project-minerva.org>
@ -497,7 +497,7 @@ if (!function_exists('realpath'))
*/ */
function is_absolute($path) 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; $type = (!$type) ? 'MX' : $type;
if (strpos(PHP_OS, 'WIN') !== false) if (DIRECTORY_SEPARATOR == '\\')
{ {
if (!function_exists('exec')) if (!function_exists('exec'))
{ {

View file

@ -13,14 +13,7 @@
*/ */
function can_load_dll($dll) function can_load_dll($dll)
{ {
global $suffix; 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;
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;
} }
/** /**

View file

@ -52,7 +52,7 @@ class messenger
$this->addresses['to'][$pos]['email'] = trim($address); $this->addresses['to'][$pos]['email'] = trim($address);
// If empty sendmail_path on windows, PHP changes the to line // 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'] = ''; $this->addresses['to'][$pos]['name'] = '';
} }

View file

@ -2253,7 +2253,10 @@ function submit_post($mode, $subject, $username, $topic_type, &$poll, &$data, $u
trigger_error('NO_SUCH_SEARCH_MODULE'); 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; $error = false;
$search = new $search_type($error); $search = new $search_type($error);

View file

@ -380,7 +380,7 @@ class install_install extends module
} }
// Can we find Imagemagick anywhere on the system? // 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'); $magic_home = getenv('MAGICK_HOME');
$img_imagick = ''; $img_imagick = '';
@ -868,8 +868,6 @@ class install_install extends module
$available_dbms = get_available_dbms($dbms); $available_dbms = get_available_dbms($dbms);
$check_exts = array_merge(array($available_dbms[$dbms]['MODULE']), $this->php_dlls_other); $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) foreach ($check_exts as $dll)
{ {
if (!@extension_loaded($dll)) if (!@extension_loaded($dll))
@ -879,7 +877,7 @@ class install_install extends module
continue; continue;
} }
$load_extensions[] = "$dll.$suffix"; $load_extensions[] = $dll . '.' . PHP_SHLIB_SUFFIX;
} }
} }
@ -892,6 +890,8 @@ class install_install extends module
} }
@fclose($fp); @fclose($fp);
@chmod($phpbb_root_path . 'cache/install_lock', 0666);
$dbpasswd = htmlspecialchars_decode($dbpasswd); $dbpasswd = htmlspecialchars_decode($dbpasswd);
$load_extensions = implode(',', $load_extensions); $load_extensions = implode(',', $load_extensions);