diff options
Diffstat (limited to 'phpBB')
| -rw-r--r-- | phpBB/config/parameters.yml | 2 | ||||
| -rw-r--r-- | phpBB/config/services.yml | 3 | ||||
| -rw-r--r-- | phpBB/download/file.php | 4 | ||||
| -rw-r--r-- | phpBB/includes/functions.php | 33 | ||||
| -rw-r--r-- | phpBB/includes/functions_acp.php | 29 | ||||
| -rw-r--r-- | phpBB/includes/functions_messenger.php | 12 | ||||
| -rw-r--r-- | phpBB/install/index.php | 2 | ||||
| -rw-r--r-- | phpBB/phpbb/db/migration/data/v310/soft_delete_mod_convert.php | 2 | ||||
| -rw-r--r-- | phpBB/phpbb/user.php | 11 | ||||
| -rw-r--r-- | phpBB/styles/prosilver/theme/bidi.css | 30 | ||||
| -rw-r--r-- | phpBB/styles/prosilver/theme/colours.css | 2 | ||||
| -rw-r--r-- | phpBB/styles/prosilver/theme/responsive.css | 11 | 
12 files changed, 83 insertions, 58 deletions
diff --git a/phpBB/config/parameters.yml b/phpBB/config/parameters.yml new file mode 100644 index 0000000000..5bf2c678ee --- /dev/null +++ b/phpBB/config/parameters.yml @@ -0,0 +1,2 @@ +parameters: +    datetime.class: \phpbb\datetime diff --git a/phpBB/config/services.yml b/phpBB/config/services.yml index a9f9f5ed19..6b06deb256 100644 --- a/phpBB/config/services.yml +++ b/phpBB/config/services.yml @@ -10,6 +10,7 @@ imports:      - { resource: mimetype_guessers.yml }      - { resource: passwords.yml }      - { resource: profilefields.yml } +    - { resource: parameters.yml }  services:      acl.permissions: @@ -346,6 +347,8 @@ services:      user:          class: phpbb\user +        arguments: +            - %datetime.class%      user_loader:          class: phpbb\user_loader diff --git a/phpBB/download/file.php b/phpBB/download/file.php index 984de2165f..fd94e78fee 100644 --- a/phpBB/download/file.php +++ b/phpBB/download/file.php @@ -224,12 +224,12 @@ else  		else  		{  			// Attachment is in a private message. -			$row['forum_id'] = false; +			$post_row = array('forum_id' => false);  			phpbb_download_handle_pm_auth($db, $auth, $user->data['user_id'], $attachment['post_msg_id']);  		}  		$extensions = array(); -		if (!extension_allowed($row['forum_id'], $attachment['extension'], $extensions)) +		if (!extension_allowed($post_row['forum_id'], $attachment['extension'], $extensions))  		{  			send_status_line(403, 'Forbidden');  			trigger_error(sprintf($user->lang['EXTENSION_DISABLED_AFTER_POSTING'], $attachment['extension'])); diff --git a/phpBB/includes/functions.php b/phpBB/includes/functions.php index f23b9840c6..d7554588c5 100644 --- a/phpBB/includes/functions.php +++ b/phpBB/includes/functions.php @@ -1061,7 +1061,7 @@ function phpbb_timezone_select($user, $default = '', $truncate = false)  		foreach ($unsorted_timezones as $timezone)  		{  			$tz = new DateTimeZone($timezone); -			$dt = new \phpbb\datetime($user, 'now', $tz); +			$dt = $user->create_datetime('now', $tz);  			$offset = $dt->getOffset();  			$current_time = $dt->format($user->lang['DATETIME_FORMAT'], true);  			$offset_string = phpbb_format_timezone_offset($offset); @@ -4892,7 +4892,7 @@ function page_header($page_title = '', $display_online_list = false, $item_id =  		}  	} -	$dt = new \phpbb\datetime($user, 'now', $user->timezone); +	$dt = $user->create_datetime();  	$timezone_offset = 'GMT' . phpbb_format_timezone_offset($dt->getOffset());  	$timezone_name = $user->timezone->getName();  	if (isset($user->lang['timezones'][$timezone_name])) @@ -5052,6 +5052,20 @@ function page_header($page_title = '', $display_online_list = false, $item_id =  		'SITE_LOGO_IMG'			=> $user->img('site_logo'),  	)); +	// An array of http headers that phpbb will set. The following event may override these. +	$http_headers = array( +		// application/xhtml+xml not used because of IE +		'Content-type' => 'text/html; charset=UTF-8', +		'Cache-Control' => 'private, no-cache="set-cookie"', +		'Expires' => '0', +		'Pragma' => 'no-cache', +	); +	if (!empty($user->data['is_bot'])) +	{ +		// Let reverse proxies know we detected a bot. +		$http_headers['X-PHPBB-IS-BOT'] = 'yes'; +	} +  	/**  	* Execute code and/or overwrite _common_ template variables after they have been assigned.  	* @@ -5062,23 +5076,16 @@ function page_header($page_title = '', $display_online_list = false, $item_id =  	*									session item, e.g. forum for  	*									session_forum_id  	* @var	int		item_id				Restrict online users to item id +	* @var	array		http_headers			HTTP headers that should be set by phpbb  	*  	* @since 3.1.0-b3  	*/ -	$vars = array('page_title', 'display_online_list', 'item_id', 'item'); +	$vars = array('page_title', 'display_online_list', 'item_id', 'item', 'http_headers');  	extract($phpbb_dispatcher->trigger_event('core.page_header_after', compact($vars))); -	// application/xhtml+xml not used because of IE -	header('Content-type: text/html; charset=UTF-8'); - -	header('Cache-Control: private, no-cache="set-cookie"'); -	header('Expires: 0'); -	header('Pragma: no-cache'); - -	if (!empty($user->data['is_bot'])) +	foreach ($http_headers as $hname => $hval)  	{ -		// Let reverse proxies know we detected a bot. -		header('X-PHPBB-IS-BOT: yes'); +		header((string) $hname . ': ' . (string) $hval);  	}  	return; diff --git a/phpBB/includes/functions_acp.php b/phpBB/includes/functions_acp.php index dc3d745d53..d9dc11239c 100644 --- a/phpBB/includes/functions_acp.php +++ b/phpBB/includes/functions_acp.php @@ -107,12 +107,31 @@ function adm_page_header($page_title)  		'S_CONTENT_FLOW_END'	=> ($user->lang['DIRECTION'] == 'ltr') ? 'right' : 'left',  	)); -	// application/xhtml+xml not used because of IE -	header('Content-type: text/html; charset=UTF-8'); +	// An array of http headers that phpbb will set. The following event may override these. +	$http_headers = array( +		// application/xhtml+xml not used because of IE +		'Content-type' => 'text/html; charset=UTF-8', +		'Cache-Control' => 'private, no-cache="set-cookie"', +		'Expires' => '0', +		'Pragma' => 'no-cache', +	); -	header('Cache-Control: private, no-cache="set-cookie"'); -	header('Expires: 0'); -	header('Pragma: no-cache'); +	/** +	* Execute code and/or overwrite _common_ template variables after they have been assigned. +	* +	* @event core.adm_page_header_after +	* @var	string	page_title			Page title +	* @var	array	http_headers			HTTP headers that should be set by phpbb +	* +	* @since 3.1.0-RC3 +	*/ +	$vars = array('page_title', 'http_headers'); +	extract($phpbb_dispatcher->trigger_event('core.adm_page_header_after', compact($vars))); + +	foreach ($http_headers as $hname => $hval) +	{ +		header((string) $hname . ': ' . (string) $hval); +	}  	return;  } diff --git a/phpBB/includes/functions_messenger.php b/phpBB/includes/functions_messenger.php index 3657a89aa0..045e555d05 100644 --- a/phpBB/includes/functions_messenger.php +++ b/phpBB/includes/functions_messenger.php @@ -402,17 +402,9 @@ class messenger  	*/  	function generate_message_id()  	{ -		global $config; +		global $config, $request; -		$domain = 'phpbb.generated'; -		if ($config['server_name']) -		{ -			$domain = $config['server_name']; -		} -		else if (!empty($_SERVER['SERVER_NAME'])) -		{ -			$domain = $_SERVER['SERVER_NAME']; -		} +		$domain = ($config['server_name']) ?: $request->server('SERVER_NAME', 'phpbb.generated');  		return md5(unique_id(time())) . '@' . $domain;  	} diff --git a/phpBB/install/index.php b/phpBB/install/index.php index 395aff6c7d..2e497da3db 100644 --- a/phpBB/install/index.php +++ b/phpBB/install/index.php @@ -240,7 +240,7 @@ $sub = $request->variable('sub', '');  // Set PHP error handler to ours  set_error_handler(defined('PHPBB_MSG_HANDLER') ? PHPBB_MSG_HANDLER : 'msg_handler'); -$user = new \phpbb\user(); +$user = new \phpbb\user('\phpbb\datetime');  $auth = new \phpbb\auth\auth();  // Add own hook handler, if present. :o diff --git a/phpBB/phpbb/db/migration/data/v310/soft_delete_mod_convert.php b/phpBB/phpbb/db/migration/data/v310/soft_delete_mod_convert.php index 6335c75398..58845b88ec 100644 --- a/phpBB/phpbb/db/migration/data/v310/soft_delete_mod_convert.php +++ b/phpBB/phpbb/db/migration/data/v310/soft_delete_mod_convert.php @@ -121,7 +121,7 @@ class soft_delete_mod_convert extends \phpbb\db\migration\migration  			new \phpbb\auth\auth(),  			$this->config,  			$this->db, -			new \phpbb\user(), +			new \phpbb\user('\phpbb\datetime'),  			$this->phpbb_root_path,  			$this->php_ext,  			$this->table_prefix . 'forums', diff --git a/phpBB/phpbb/user.php b/phpBB/phpbb/user.php index 4e90044395..ea98034434 100644 --- a/phpBB/phpbb/user.php +++ b/phpBB/phpbb/user.php @@ -31,6 +31,11 @@ class user extends \phpbb\session  	*/  	public $timezone; +	/** +	* @var string Class name of datetime object +	*/ +	protected $datetime; +  	var $lang_name = false;  	var $lang_id = false;  	var $lang_path; @@ -42,12 +47,14 @@ class user extends \phpbb\session  	/**  	* Constructor to set the lang path +	* @param string $datetime_class Class name of datetime class  	*/ -	function __construct() +	function __construct($datetime_class)  	{  		global $phpbb_root_path;  		$this->lang_path = $phpbb_root_path . 'language/'; +		$this->datetime = $datetime_class;  	}  	/** @@ -727,7 +734,7 @@ class user extends \phpbb\session  	public function create_datetime($time = 'now', \DateTimeZone $timezone = null)  	{  		$timezone = $timezone ?: $this->timezone; -		return new \phpbb\datetime($this, $time, $timezone); +		return new $this->datetime($this, $time, $timezone);  	}  	/** diff --git a/phpBB/styles/prosilver/theme/bidi.css b/phpBB/styles/prosilver/theme/bidi.css index f6e490f82a..0d98fe7a66 100644 --- a/phpBB/styles/prosilver/theme/bidi.css +++ b/phpBB/styles/prosilver/theme/bidi.css @@ -112,6 +112,15 @@  	text-align: right;  } +.rtl .dropdown-contents > li { +	padding-left: 15px; +	padding-right: 0; +} + +.rtl .dropdown-nonscroll > li { +	padding-left: 0; +} +  .rtl .dropdown li li {  	padding-left: 0;  	padding-right: 18px; @@ -601,8 +610,8 @@ li.breadcrumbs span:first-child > a {  /* Rollover buttons     Based on: http://wellstyled.com/css-nopreload-rollovers.html  ----------------------------------------*/ -.rtl .icon-button.dropdown-select { -	padding-left: 26px; +.rtl .dropdown-select { +	padding-left: 24px;  	padding-right: 8px;  } @@ -612,7 +621,12 @@ li.breadcrumbs span:first-child > a {  	margin-right: 2px;  } -.dropdown-select:after { +.rtl .dropdown-select.icon-button:before { +	margin-left: 4px; +	margin-right: 0; +} + +.rtl .dropdown-select:after {  	border-left: 0;  	border-right-style: solid;  	border-right-width: 1px; @@ -915,16 +929,6 @@ li.breadcrumbs span:first-child > a {  	float: left;  } -/* Jumpbox */ -.rtl fieldset.jumpbox { -	text-align: left; -} - -.rtl fieldset.quickmod { -	float: left; -	text-align: left; -} -  /* Posting page styles  ----------------------------------------*/ diff --git a/phpBB/styles/prosilver/theme/colours.css b/phpBB/styles/prosilver/theme/colours.css index 82542c8d86..df27467cf8 100644 --- a/phpBB/styles/prosilver/theme/colours.css +++ b/phpBB/styles/prosilver/theme/colours.css @@ -610,7 +610,7 @@ Colours and backgrounds for buttons.css  	color: #D31141;  } -.dropdown-select, .dropdown-select:visited { +.dropdown-select {  	color: #536482;  } diff --git a/phpBB/styles/prosilver/theme/responsive.css b/phpBB/styles/prosilver/theme/responsive.css index b9cbd4cdfb..3ef0044621 100644 --- a/phpBB/styles/prosilver/theme/responsive.css +++ b/phpBB/styles/prosilver/theme/responsive.css @@ -466,12 +466,6 @@ p.rightside {  	margin-bottom: 0;  } -fieldset.quickmod { -	width: auto; -	float: none; -	text-align: center; -} -  fieldset.display-options label {  	display: block;  	clear: both; @@ -509,14 +503,11 @@ fieldset.display-actions {  		margin: 0;  	} -	.action-bar > .pagination, fieldset.jumpbox { -		text-align: center; -	} -  	.action-bar > .pagination {  		float: none;  		clear: both;  		padding-bottom: 1px; +		text-align: center;  	}  	.action-bar > .pagination li.page-jump {  | 
