aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/includes
diff options
context:
space:
mode:
authorMeik Sievertsen <acydburn@phpbb.com>2007-07-03 15:36:18 +0000
committerMeik Sievertsen <acydburn@phpbb.com>2007-07-03 15:36:18 +0000
commitb883ff119f4e42fbc967a6b1971af2198762fbd8 (patch)
tree95341356c3efea7cad58309f28c224c45296f1f5 /phpBB/includes
parent3d9b5e52d9a14495f42d676428b6d00aff756923 (diff)
downloadforums-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/includes')
-rw-r--r--phpBB/includes/acm/acm_file.php22
-rw-r--r--phpBB/includes/acp/acp_php_info.php2
-rw-r--r--phpBB/includes/functions.php6
-rw-r--r--phpBB/includes/functions_install.php9
-rw-r--r--phpBB/includes/functions_messenger.php2
-rw-r--r--phpBB/includes/functions_posting.php5
6 files changed, 27 insertions, 19 deletions
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);