diff options
author | Meik Sievertsen <acydburn@phpbb.com> | 2006-09-28 15:04:59 +0000 |
---|---|---|
committer | Meik Sievertsen <acydburn@phpbb.com> | 2006-09-28 15:04:59 +0000 |
commit | 26befa094147b542e48e36867eb41eaf424225f7 (patch) | |
tree | 5131952196ff19744498bbbdc962635cecc94c4f /phpBB/includes/functions.php | |
parent | 67accdb07263030c29eebba9edf944fd350879d1 (diff) | |
download | forums-26befa094147b542e48e36867eb41eaf424225f7.tar forums-26befa094147b542e48e36867eb41eaf424225f7.tar.gz forums-26befa094147b542e48e36867eb41eaf424225f7.tar.bz2 forums-26befa094147b542e48e36867eb41eaf424225f7.tar.xz forums-26befa094147b542e48e36867eb41eaf424225f7.zip |
- added confirmation to removing bbcodes
- added optional MX and DNSBL checks
- added backtrace (triggering sql error) on error within sql_in_set as well as making sure it is handling an array
- let users having f_list access to a forum actually see the forum without a topic list and not displaying an error message - this allows for giving people access to subforums but not the parent forum without the need to add the (sub-)forum to the index.
- some additional bugfixes
git-svn-id: file:///svn/phpbb/trunk@6414 89ea8834-ac86-4346-8a33-228a782c2dd0
Diffstat (limited to 'phpBB/includes/functions.php')
-rw-r--r-- | phpBB/includes/functions.php | 48 |
1 files changed, 47 insertions, 1 deletions
diff --git a/phpBB/includes/functions.php b/phpBB/includes/functions.php index 4fa041bfd1..b449f5985e 100644 --- a/phpBB/includes/functions.php +++ b/phpBB/includes/functions.php @@ -2705,6 +2705,52 @@ function truncate_string($string, $max_length = 60) return implode('', array_slice($chars, 0, $max_length)); } + +/** +* Wrapper for php's checkdnsrr function +* The windows failover is from this page: http://www.zend.com/codex.php?id=370&single=1 +* Please make sure to check the return value for === true and === false, since NULL could +* be returned too. +* +* @return true if entry found, false if not, NULL if this function is not supported by this environment +*/ +function phpbb_checkdnsrr($host, $type = '') +{ + $type = (!$type) ? 'MX' : $type; + + if (strpos(PHP_OS, 'WIN') !== false) + { + if (!function_exists('exec')) + { + return NULL; + } + + @exec('nslookup -type=' . escapeshellarg($type) . ' ' . escapeshellarg($host), $output); + + foreach ($output as $line) + { + if (!trim($line)) + { + continue; + } + + // Valid records begin with host name: + if (strpos($line, $host) === 0) + { + return true; + } + } + + return false; + } + else if (function_exists('checkdnsrr')) + { + return (checkdnsrr($domain, $type)) ? true : false; + } + + return NULL; +} + // Handler, header and footer /** @@ -2777,7 +2823,7 @@ function msg_handler($errno, $msg_text, $errfile, $errline) if (!empty($config['board_contact'])) { - echo ' <p>Please notify the board administrator or webmaster : <a href="mailto:' . $config['board_contact'] . '">' . $config['board_contact'] . '</a></p>'; + echo ' <p>Please notify the board administrator or webmaster: <a href="mailto:' . $config['board_contact'] . '">' . $config['board_contact'] . '</a></p>'; } echo ' </div>'; |