1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-02-25 12:33:29 +01:00

5033 Commits

Author SHA1 Message Date
Nils Adermann
a5ef6c3b20 [ticket/10188] Prevent semi-compressed output
When a non-fatal error occurs at the beginning of the script before any custom
error handler is set one of two situations can be encountered:

1) if the ini option output buffer is disabled:
      - headers are sent to the http client
      - the error message is output
2) if the ini option output_buffer is enabled or the script
   is run within an ob_start()/ob_end() wrapper:
      - the error message is written to the output buffer

Once the script reaches page_header() phpbb starts gzip compression if enabled.
This is done through ob_start with a ob_gzhandler as a callback. The
compression is skipped if headers have already been sent. In situation 1) the
error message sent in plain text comes with headers and this gzip compression
is skipped. The client receives a plaintext version of the page. However in
situation 2) headers have not been sent yet and the rest of the page will be
compressed. The result is a plaintext error message followed by compressed
output. The client does not understand this output resulting in either an
error message or simply a blank page in the browser.

In addition to the above situation this problem occurs with errors that are
triggered after the custom error handler is loaded. The problem has been
noticed before, and a workaround was found. The error handler would call
ob_flush() for particular configuration settings before outputting the error
message. This resulted in headers being sent when output buffering was enabled
thus disabling gzip compression for the rest of the page. The constraints under
which ob_flush() was called were lessened over time whenever a new case was
found that would trigger this problem. Eventually ob_flush() would be called
even when code causing an E_NOTICE was simply run within an ob_start/ob_end.
This makes it impossible to use output buffering to retrieve the content of an
error message without prohibiting the page from setting headers afterwards.

This commit removes all flushing in msg_handler completely and instead fixes
the problem for both errors before and after the error handler is registered.
GZIP compression is only enabled if there is at most one level of output
buffering (e.g. the output_buffer php.ini option is enabled) and if there has
not yet been any output in this buffer. This should avoid any partial output
compression.

PHPBB3-10188
2011-06-26 20:31:22 +02:00
Nils Adermann
c1ef02716e Merge branch 'develop-olympus' into develop
* develop-olympus:
  [ticket/7729] Prevent date/time functions from throwing E_WARNING on PHP 5.3.
2011-06-26 01:38:05 +02:00
Nils Adermann
0e067ec3c2 Merge branch 'prep-release-3.0.9' into develop-olympus
* prep-release-3.0.9:
  [ticket/7729] Prevent date/time functions from throwing E_WARNING on PHP 5.3.
2011-06-26 01:37:30 +02:00
Andreas Fischer
9f3b159998 [ticket/7729] Prevent date/time functions from throwing E_WARNING on PHP 5.3.
PHPBB3-7729
2011-06-25 17:42:52 +02:00
rxu
18fb3d86cd [ticket/10226] Use is_numeric() instead of preg_replace()
PHPBB3-10226
2011-06-21 22:03:19 +08:00
rxu
578f9dffa6 [ticket/10226] Allow mysqli connections via local sockets/pipes
PHPBB3-10226
2011-06-21 00:55:10 +08:00
Nils Adermann
bf39d6abdc Merge branch 'develop-olympus' into develop
* develop-olympus:
  [ticket/10234] Report E_WARNING errors as "PHP Warning" instead of "PHP Notice"
2011-06-20 00:36:05 +02:00
Nils Adermann
fd7e29131e Merge branch 'prep-release-3.0.9' into develop-olympus
* prep-release-3.0.9:
  [ticket/10234] Report E_WARNING errors as "PHP Warning" instead of "PHP Notice"
2011-06-20 00:35:17 +02:00
Andreas Fischer
8c01ed578d [ticket/10234] Report E_WARNING errors as "PHP Warning" instead of "PHP Notice"
PHPBB3-10234
2011-06-20 00:03:20 +02:00
Andreas Fischer
bd4a781c15 Merge branch 'develop-olympus' into develop
* develop-olympus:
  [ticket/10227] Allow persistent connections for mysqli with PHP 5.3.0+
2011-06-19 17:58:44 +02:00
rxu
7de078b26e [ticket/10227] Allow persistent connections for mysqli with PHP 5.3.0+
PHPBB3-10227
2011-06-19 19:03:53 +08:00
Andreas Fischer
d79d093d11 Merge branch 'develop-olympus' into develop
* develop-olympus:
  [ticket/10221] Append unit (seconds) after input field, remove from explanation
2011-06-16 16:11:38 +02:00
Andreas Fischer
bd6e27d9c5 Merge branch 'prep-release-3.0.9' into develop-olympus
* prep-release-3.0.9:
  [ticket/10221] Append unit (seconds) after input field, remove from explanation
2011-06-16 16:11:27 +02:00
Nils Adermann
63b9b91dee [ticket/10221] Append unit (seconds) after input field, remove from explanation
PHPBB3-10221
2011-06-16 16:02:34 +02:00
Andreas Fischer
48e5e56146 [prep-release-3.0.9] Bumping version number for 3.0.9-RC2. 2011-06-15 19:41:14 +02:00
Andreas Fischer
835faff61a Merge branch 'develop-olympus' into develop
* develop-olympus:
  [ticket/10218] Prevent startime from being overwritten by deregister_globals()
  [ticket/10218] Moving global deregistration, etc. to startup.php

Conflicts:
	phpBB/install/database_update.php
2011-06-15 18:51:45 +02:00
Andreas Fischer
79f757d4b7 Merge branch 'prep-release-3.0.9' into develop-olympus
* prep-release-3.0.9:
  [ticket/10218] Prevent startime from being overwritten by deregister_globals()
  [ticket/10218] Moving global deregistration, etc. to startup.php

Conflicts:
	phpBB/install/database_update.php
2011-06-15 18:51:04 +02:00
Andreas Fischer
2d6df4c7fc Merge remote-tracking branch 'Marshalrusty/ticket/10218' into prep-release-3.0.9
* Marshalrusty/ticket/10218:
  [ticket/10218] Prevent startime from being overwritten by deregister_globals()
  [ticket/10218] Moving global deregistration, etc. to startup.php
2011-06-15 18:50:14 +02:00
Andreas Fischer
9b2a72e6ff Merge branch 'develop-olympus' into develop
* develop-olympus:
  [ticket/10220] Limit user agent value length for storage in login attempt table
2011-06-15 18:47:30 +02:00
Andreas Fischer
1e8c257bd4 Merge branch 'prep-release-3.0.9' into develop-olympus
* prep-release-3.0.9:
  [ticket/10220] Limit user agent value length for storage in login attempt table
2011-06-15 18:47:27 +02:00
Nils Adermann
74785a8bda [ticket/10220] Limit user agent value length for storage in login attempt table
PHPBB3-10220
2011-06-15 18:20:16 +02:00
Yuriy Rusko
4bb98fb046 [ticket/10218] Prevent startime from being overwritten by deregister_globals()
PHPBB3-10218
2011-06-15 00:50:12 -04:00
Yuriy Rusko
f8eb154714 [ticket/10218] Moving global deregistration, etc. to startup.php
Because startup.php deletes all variables, the constants in
database_update are used to preserve settings at the top.

PHPBB3-10218
2011-06-14 06:11:35 -04:00
Andreas Fischer
bf61602a28 [develop-olympus] Incrementing the version to 3.0.10-dev in develop-olympus. 2011-06-13 22:23:28 +02:00
Andreas Fischer
8a54aa5d68 Merge branch 'develop-olympus' into develop
* develop-olympus:
  [ticket/10214] Correct Oracle create table query syntax in db_tools
2011-06-13 19:50:06 +02:00
Nils Adermann
c090e1c9e9 [ticket/10214] Correct Oracle create table query syntax in db_tools
Removes the semicolon at end of oracle CREATE TABLE queries and adds a
semicolon to the end of a SELECT query inside of the trigger for a new
table's auto increment column before the end keyword

PHPBB3-10214
2011-06-13 06:14:59 +02:00
Andreas Fischer
7232ca4102 [develop-olympus] Bumping version number for 3.0.9-RC1. 2011-06-12 19:45:01 +02:00
Andreas Fischer
9b469eb163 Merge branch 'develop-olympus' into develop
* develop-olympus:
  [ticket/9892] Correct copyright year
  [ticket/9892] Remove incorrect use of camel case
  [ticket/9892] Removing closing php tag from create_schema_files
  [ticket/9892] Transaction support for database update sql execution function
  [ticket/9892] count is a keyword in firebird, so renaming this alias
  [ticket/9892] Q&A CAPTCHA did not work on firebird, so no need to change config
  [ticket/9892] Shorten login_attempt key names to avoid firebird length problems
  [ticket/9892] Drop Q&A CAPTCHA tables if left in inconsistent state
  [ticket/9892] Adding a number of tests for db_tools
  [ticket/9892] Table prefix lengths influence index lengths in db_tools
  [ticket/9892] Shorten the index names on the q&a captcha
  [ticket/9892] column & index name limits, firebird auto increment in db_tools

Conflicts:
	phpBB/develop/create_schema_files.php
2011-06-12 19:27:01 +02:00
Nils Adermann
ef977abe59 [ticket/9892] count is a keyword in firebird, so renaming this alias
PHPBB3-9892
2011-06-12 11:33:55 +02:00
Nils Adermann
ef544ee095 [ticket/9892] Table prefix lengths influence index lengths in db_tools
PHPBB3-9892
2011-06-12 04:10:51 +02:00
Nils Adermann
8a5e3781d5 [ticket/9892] Shorten the index names on the q&a captcha
PHPBB3-9892
2011-06-12 01:28:06 +02:00
Nils Adermann
418c3d546a [ticket/9892] column & index name limits, firebird auto increment in db_tools
- Column names are limited to 30 characters
- Index names are limited to 31 characters.
  On some dbms the index name contains both table name and actual index name
  so the limit applies to the sum of the lenghts of table name and index name.
- Auto incremented column names are limited to 26 characters to provide an
  additional 4 characters for sequence names

The code for firebird auto increment support using generators/sequences with
triggers was copied from create_schema_files.php

PHPBB3-9892
2011-06-12 01:28:01 +02:00
Andreas Fischer
fe5d616349 Merge branch 'develop-olympus' into develop
* develop-olympus:
  [ticket/9992] Clarify explanations of ip and account limits on login
  [ticket/9992] Add a comma to language for IP_LOGIN_LIMIT_MAX_EXPLAIN
  [ticket/9992] Use sql_fetchfield for single row and single column result
  [ticket/9992] Adding a limit on login attempts per IP.
  [ticket/9992] Make sql_create_table and sql_table_exists available in updater
2011-06-11 19:42:04 +02:00
Andreas Fischer
bf2125f0f7 Merge remote-tracking branch 'naderman/ticket/9992' into develop-olympus
* naderman/ticket/9992:
  [ticket/9992] Clarify explanations of ip and account limits on login
  [ticket/9992] Add a comma to language for IP_LOGIN_LIMIT_MAX_EXPLAIN
  [ticket/9992] Use sql_fetchfield for single row and single column result
  [ticket/9992] Adding a limit on login attempts per IP.
  [ticket/9992] Make sql_create_table and sql_table_exists available in updater
2011-06-11 19:40:03 +02:00
Igor Wiedler
0cad4ed49f Merge branch 'develop-olympus' into develop
* develop-olympus:
  [ticket/10110] Remove multi-server syntax from Redis ACM.

Conflicts:
	phpBB/includes/cache/driver/redis.php
2011-06-11 12:06:29 +02:00
Andreas Fischer
b9f4240c10 [ticket/10110] Remove multi-server syntax from Redis ACM.
PHPBB3-10110
2011-06-11 01:47:50 +02:00
Nils Adermann
7f7a94e5dc Merge branch 'develop-olympus' into develop
* develop-olympus:
  [ticket/9908] Send 301 before stripping SID so bots do (hopefully) not revisit.
2011-06-11 01:26:19 +02:00
Andreas Fischer
b5cefc400e [ticket/9908] Send 301 before stripping SID so bots do (hopefully) not revisit.
PHPBB3-9908
2011-06-10 20:08:10 +02:00
Nils Adermann
c8828473a8 [ticket/9992] Use sql_fetchfield for single row and single column result
PHPBB3-9992
2011-06-10 18:37:29 +02:00
Nils Adermann
2dee57fd43 [ticket/9992] Adding a limit on login attempts per IP.
A new table was created to save all failed login attempts with
corresponding information on username, ip and useragent. By default
the limit is 50 login attempts within 6 hours per IP. The limit is
relatively high to avoid big problems on sites behind a reverse
proxy that don't receive the forwarded-for value as REMOTE_ADDR but
see all users as coming from the same IP address. But if these
users run into problems a special forwarded-for option is available
to limit logins by forwarded-for value instead of ip.

PHPBB3-9992
2011-06-10 12:18:19 +02:00
Andreas Fischer
df52801989 Merge branch 'develop-olympus' into develop
* develop-olympus:
  [ticket/10198] range validation for strings should limit characters not bytes
  [ticket/10198] validate_config_vars() improperly validates multibyte strings

Conflicts:
	phpBB/adm/index.php
2011-06-10 01:24:16 +02:00
Nils Adermann
ca1944ebe2 Merge branch 'develop-olympus' into develop
* develop-olympus:
  [ticket/9802] Remove unnecessary htmlspecialchars() call on REMOTE_ADDR.
  [ticket/9802] Only check for IPv4-mapped address when address is IPv6.
  [ticket/9802] Fix tiny logic bug in loop determining REMOTE_ADDR.
  [ticket/9802] Remove redundant character class definition from preg_replace.
  [ticket/9802] Fix redundant str_replace call. No need to replace ' ' with ' '.

Conflicts:
	phpBB/includes/session.php
2011-06-10 00:53:38 +02:00
Nils Adermann
cdfbd82504 Merge branch 'ticket/bantu/9802' into develop-olympus
* ticket/bantu/9802:
  [ticket/9802] Remove unnecessary htmlspecialchars() call on REMOTE_ADDR.
  [ticket/9802] Only check for IPv4-mapped address when address is IPv6.
  [ticket/9802] Fix tiny logic bug in loop determining REMOTE_ADDR.
  [ticket/9802] Remove redundant character class definition from preg_replace.
  [ticket/9802] Fix redundant str_replace call. No need to replace ' ' with ' '.
2011-06-10 00:47:40 +02:00
Nils Adermann
735cae076a Merge branch 'develop-olympus' into develop
* develop-olympus:
  [ticket/6712] Properly explain result of setting the bump interval to 0.
  [ticket/6712] Add phpbb_ function name prefix, more docs, rename current_time
  [ticket/6712] Pass $post_data by the value instead of by the reference.
  [ticket/6712] Bump does not create new topic icon on index.

Conflicts:
	phpBB/includes/functions_posting.php
2011-06-10 00:26:41 +02:00
Nils Adermann
5b701dc3ed Merge branch 'ticket/rxu/6712' into develop-olympus
* ticket/rxu/6712:
  [ticket/6712] Properly explain result of setting the bump interval to 0.
  [ticket/6712] Add phpbb_ function name prefix, more docs, rename current_time
  [ticket/6712] Pass $post_data by the value instead of by the reference.
  [ticket/6712] Bump does not create new topic icon on index.
2011-06-10 00:24:43 +02:00
Nils Adermann
d02d00e951 Merge branch 'develop-olympus' into develop
* develop-olympus:
  [ticket/217] Use positive assertions in tests.
  [ticket/217] Silence errors in tests, not code.
  [ticket/217] Use positive parameter statement for bbcode_init()
  [ticket/217] Adjust patch, add tests
  [ticket/217] Multiline [url] not converted
2011-06-09 22:40:26 +02:00
Nils Adermann
928ee43881 Merge branch 'ticket/rxu/217' into develop-olympus
* ticket/rxu/217:
  [ticket/217] Use positive assertions in tests.
  [ticket/217] Silence errors in tests, not code.
  [ticket/217] Use positive parameter statement for bbcode_init()
  [ticket/217] Adjust patch, add tests
  [ticket/217] Multiline [url] not converted
2011-06-09 22:39:28 +02:00
Andreas Fischer
b64159c001 Merge remote-tracking branch 'naderman/ticket/7057' into develop-olympus
* naderman/ticket/7057:
  [ticket/7057] Use GET for quicksearch and add session id to hidden fields
  [ticket/7057] Remove trailing whitespace in functions.php
2011-06-09 13:10:48 +02:00
Andreas Fischer
19439b86b8 Merge branch 'develop-olympus' into develop
* develop-olympus:
  [ticket/7057] Use GET for quicksearch and add session id to hidden fields
  [ticket/7057] Remove trailing whitespace in functions.php
2011-06-09 13:10:48 +02:00
Andreas Fischer
7d5438eb03 Merge branch 'develop-olympus' into develop
* develop-olympus:
  [ticket/8138] Add autocomplete="off" to acp_board and ldap settings
  [ticket/8138] Add autocomplete="off" to a user and forum ACP.

Conflicts:
	phpBB/adm/index.php
2011-06-09 13:00:39 +02:00