mirror of
https://github.com/phpbb/phpbb.git
synced 2025-08-01 14:30:32 +02:00
Merge branch 'develop-olympus' into develop
* develop-olympus: [ticket/9851] "Search new posts" should require login. [task/phpdoc] Added a phpdoc task to the build process [task/phpdoc] Added a configuration file for phpDocumentor. [feature/acm-wincache] Adding caching module for WinCache's User Cache. [ticket/9939] Fix JavaScript error in admin recaptcha template [ticket/9575] Also change 'administrate' to 'administer' in templates [ticket/8736] guest can have 255 chars long username [ticket/9928] Do not link "login to your board" to the "send statistics" page. [ticket/9575] Change 'administrate' to 'administer' [ticket/9921] Adding sample configuration file for the lighttpd webserver. [ticket/9932] Add the Bing bot when converting [ticket/9930] Redirect failes with open_basedir enabled. [ticket/9910] Make sure S_BBCODE_ALLOWED exists when viewing PMs
This commit is contained in:
84
phpBB/includes/acm/acm_wincache.php
Normal file
84
phpBB/includes/acm/acm_wincache.php
Normal file
@@ -0,0 +1,84 @@
|
||||
<?php
|
||||
/**
|
||||
*
|
||||
* @package acm
|
||||
* @copyright (c) 2010 phpBB Group
|
||||
* @license http://opensource.org/licenses/gpl-license.php GNU Public License
|
||||
*
|
||||
*/
|
||||
|
||||
/**
|
||||
* @ignore
|
||||
*/
|
||||
if (!defined('IN_PHPBB'))
|
||||
{
|
||||
exit;
|
||||
}
|
||||
|
||||
// Include the abstract base
|
||||
if (!class_exists('acm_memory'))
|
||||
{
|
||||
require("{$phpbb_root_path}includes/acm/acm_memory.$phpEx");
|
||||
}
|
||||
|
||||
/**
|
||||
* ACM for WinCache
|
||||
* @package acm
|
||||
*/
|
||||
class acm extends acm_memory
|
||||
{
|
||||
var $extension = 'wincache';
|
||||
|
||||
/**
|
||||
* Purge cache data
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
function purge()
|
||||
{
|
||||
wincache_ucache_clear();
|
||||
|
||||
parent::purge();
|
||||
}
|
||||
|
||||
/**
|
||||
* Fetch an item from the cache
|
||||
*
|
||||
* @access protected
|
||||
* @param string $var Cache key
|
||||
* @return mixed Cached data
|
||||
*/
|
||||
function _read($var)
|
||||
{
|
||||
$success = false;
|
||||
$result = wincache_ucache_get($this->key_prefix . $var, $success);
|
||||
|
||||
return ($success) ? $result : false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Store data in the cache
|
||||
*
|
||||
* @access protected
|
||||
* @param string $var Cache key
|
||||
* @param mixed $data Data to store
|
||||
* @param int $ttl Time-to-live of cached data
|
||||
* @return bool True if the operation succeeded
|
||||
*/
|
||||
function _write($var, $data, $ttl = 2592000)
|
||||
{
|
||||
return wincache_ucache_set($this->key_prefix . $var, $data, $ttl);
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove an item from the cache
|
||||
*
|
||||
* @access protected
|
||||
* @param string $var Cache key
|
||||
* @return bool True if the operation succeeded
|
||||
*/
|
||||
function _delete($var)
|
||||
{
|
||||
return wincache_ucache_delete($this->key_prefix . $var);
|
||||
}
|
||||
}
|
@@ -2293,12 +2293,12 @@ function redirect($url, $return = false, $disable_cd_check = false)
|
||||
// Relative uri
|
||||
$pathinfo = pathinfo($url);
|
||||
|
||||
if (!$disable_cd_check && !file_exists($pathinfo['dirname']))
|
||||
if (!$disable_cd_check && !file_exists($pathinfo['dirname'] . '/'))
|
||||
{
|
||||
$url = str_replace('../', '', $url);
|
||||
$pathinfo = pathinfo($url);
|
||||
|
||||
if (!file_exists($pathinfo['dirname']))
|
||||
if (!file_exists($pathinfo['dirname'] . '/'))
|
||||
{
|
||||
// fallback to "last known user page"
|
||||
// at least this way we know the user does not leave the phpBB root
|
||||
|
@@ -1816,6 +1816,7 @@ function add_bots()
|
||||
'Alta Vista [Bot]' => array('Scooter/', ''),
|
||||
'Ask Jeeves [Bot]' => array('Ask Jeeves', ''),
|
||||
'Baidu [Spider]' => array('Baiduspider+(', ''),
|
||||
'Bing [Bot]' => array('bingbot/', ''),
|
||||
'Exabot [Bot]' => array('Exabot/', ''),
|
||||
'FAST Enterprise [Crawler]' => array('FAST Enterprise Crawler', ''),
|
||||
'FAST WebCrawler [Crawler]' => array('FAST-WebCrawler/', ''),
|
||||
|
@@ -172,6 +172,8 @@ function view_message($id, $mode, $folder_id, $msg_id, $folder, $message_row)
|
||||
// Number of "to" recipients
|
||||
$num_recipients = (int) preg_match_all('/:?(u|g)_([0-9]+):?/', $message_row['to_address'], $match);
|
||||
|
||||
$bbcode_status = ($config['allow_bbcode'] && $config['auth_bbcode_pm'] && $auth->acl_get('u_pm_bbcode')) ? true : false;
|
||||
|
||||
$template->assign_vars(array(
|
||||
'MESSAGE_AUTHOR_FULL' => get_username_string('full', $author_id, $user_info['username'], $user_info['user_colour'], $user_info['username']),
|
||||
'MESSAGE_AUTHOR_COLOUR' => get_username_string('colour', $author_id, $user_info['username'], $user_info['user_colour'], $user_info['username']),
|
||||
@@ -229,6 +231,7 @@ function view_message($id, $mode, $folder_id, $msg_id, $folder, $message_row)
|
||||
'S_AUTHOR_DELETED' => ($author_id == ANONYMOUS) ? true : false,
|
||||
'S_SPECIAL_FOLDER' => in_array($folder_id, array(PRIVMSGS_NO_BOX, PRIVMSGS_OUTBOX)),
|
||||
'S_PM_RECIPIENTS' => $num_recipients,
|
||||
'S_BBCODE_ALLOWED' => ($bbcode_status) ? 1 : 0,
|
||||
|
||||
'U_PRINT_PM' => ($config['print_pm'] && $auth->acl_get('u_pm_printpm')) ? "$url&f=$folder_id&p=" . $message_row['msg_id'] . "&view=print" : '',
|
||||
'U_FORWARD_PM' => ($config['forward_pm'] && $auth->acl_get('u_sendpm') && $auth->acl_get('u_pm_forward')) ? "$url&mode=compose&action=forward&f=$folder_id&p=" . $message_row['msg_id'] : '')
|
||||
|
Reference in New Issue
Block a user