1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-05-06 23:55:26 +02:00

105 Commits

Author SHA1 Message Date
Cesar G
47514ca2df [ticket/13755] Ignore dots in path when determining file extension.
PHPBB3-13755
2015-04-10 16:23:51 -07:00
Marc Alexander
d31ff51785 [ticket/13031] Guess with all mimetype guessers and pick best guess
PHPBB3-13031
2014-09-05 10:56:06 +02:00
Marc Alexander
7de15bc54c [ticket/13031] Only use mimetype guesser guess if it helps us
If we already have a mimetype and the guesser's guess is the default fallback,
we should keep the already existing mimetype the browser supplied. Otherwise,
platforms that might not support mimetype guessers will cause us to always
have the mimetype set to application/octet-stream on images. This will prevent
users from uploading images.

PHPBB3-13031
2014-09-03 23:09:17 +02:00
Andreas Fischer
076d4ddd7f [ticket/12941] Fix remaining Sami complaints.
PHPBB3-12941
2014-08-09 18:08:49 +02:00
Joas Schilling
2f44a865a0 Merge pull request #2477 from n-aleha/ticket/12557ascraeus
[ticket/12557] Fix doc block errors found by Sami for ascraeus

* n-aleha/ticket/12557ascraeus:
  [ticket/12557] Fix load active module description
  [ticket/12557] Fix php file description
  [ticket/12557] Fix post data description for notifications
  [ticket/12557] Fix pass by reference doc blocks
  [ticket/12557] Fix doc block in extension base class
  [ticket/12557] Fix doc block in mimetype guesser
  [ticket/12557] Fix var $preserve_cr description
  [ticket/12557] Fix doc block errors found by Sami
  [ticket/12557] Fix doc block errors found by Sami
  [ticket/12557] Fix doc block errors found by Sami
  [ticket/12557] Template fixes
  [ticket/12557] Search, cron and profilefields fixes
  [ticket/12557] Notification fixes
  [ticket/12557] Fix doc block errors found by Sami pt1
  [ticket/12557] Fix doc block errors found by Sami
  [ticket/12557] Fix doc block errors found by Sami
2014-08-07 12:43:45 +02:00
Nils Adermann
b203b4afa1 Merge remote-tracking branch 'github-marc1706/ticket/11148' into develop-ascraeus
* github-marc1706/ticket/11148:
  [ticket/11148] Remove unneeded variable mimetype and use type octet-stream
  [ticket/11148] Change expected output with disallowed content in test
  [ticket/11148] Always use the output of the mimetype guesser in get_mimetype
  [ticket/11148] Get rid of extra line in mimetype guesser setter doc block
  [ticket/11148] Add missing parts to docblock of get_mimetype() method
  [ticket/11148] Default to application/octet-stream if no mimetype given
  [ticket/11148] Use mimetype guesser for uploaded avatars
  [ticket/11148] Pass mimetype guesser to upload_attachment() function
  [ticket/11148] Add mimetype guesser to filespec and fileupload class
2014-08-07 12:06:33 +02:00
n-aleha
95ec9590df [ticket/12557] Fix doc block errors found by Sami
PHPBB3-12557
2014-08-03 07:13:20 +03:00
n-aleha
8ac8c9ec61 [ticket/12557] Fix doc block errors found by Sami
More corrections.

PHPBB3-12557
2014-08-03 06:57:05 +03:00
n-aleha
19b9df7e63 [ticket/12557] Fix doc block errors found by Sami
PHPBB3-12557
2014-08-03 06:57:05 +03:00
Andreas Fischer
b5b0175d59 Merge branch 'develop-olympus' into develop-ascraeus
* develop-olympus:
  [ticket/12755] Apply de morgan to conditional
  [ticket/12755] Terminate upload loop if upload reaches filesize
  [ticket/12755] Change upload in remote_upload() method to fit get_remote_file
  [ticket/12755] Add language string for timed out remote upload
  [ticket/12755] Add timeout to remote upload to prevent infinite loop
2014-06-24 20:59:11 +02:00
Marc Alexander
8b3cc9a6c4 [ticket/12755] Apply de morgan to conditional
PHPBB3-12755
2014-06-24 19:53:52 +02:00
Marc Alexander
309dbb4ef9 [ticket/12755] Terminate upload loop if upload reaches filesize
Terminate the upload loop if the expected filesize has been reached instead
of trying to read more bytes until the timeout has been reached.

PHPBB3-12755
2014-06-24 19:07:49 +02:00
Marc Alexander
5ee1e07e17 [ticket/12755] Change upload in remote_upload() method to fit get_remote_file
PHPBB3-12755
2014-06-24 11:53:32 +02:00
Marc Alexander
ff56f0dcfe [ticket/11148] Remove unneeded variable mimetype and use type octet-stream
The variable $mimetype is not used in the method local_upload() afterwards
so it shouldn't be assigned. The correct default mimetype should be
application/octet-stream and not application/octetstream according to RFC 2046.

PHPBB3-11148
2014-06-23 21:39:24 +02:00
Marc Alexander
4eb7485b39 [ticket/11148] Always use the output of the mimetype guesser in get_mimetype
PHPBB3-11148
2014-06-23 21:39:24 +02:00
Marc Alexander
ea5bc9c833 [ticket/11148] Add missing parts to docblock of get_mimetype() method
PHPBB3-11148
2014-06-23 21:39:24 +02:00
Marc Alexander
de404002c7 [ticket/11148] Default to application/octet-stream if no mimetype given
This should prevent us from having an empty mimetype while uploading a file
using local_upload().

PHPBB3-11148
2014-06-23 21:39:24 +02:00
Marc Alexander
9bc6e641bf [ticket/11148] Add mimetype guesser to filespec and fileupload class
The mimetype guesser will be used to get the mimetype of uploaded files.
Until now, this was only used for files uploaded with plupload. If a file
doesn't have a mimetype supplied, we will now try to get the correct mimetype.

PHPBB3-11148
2014-06-23 21:37:47 +02:00
Marc Alexander
8817b59377 [ticket/12755] Add language string for timed out remote upload
PHPBB3-12755
2014-06-23 20:35:36 +02:00
Marc Alexander
0499655ba4 [ticket/12755] Add timeout to remote upload to prevent infinite loop
PHPBB3-12755
2014-06-21 11:55:54 +02:00
Andreas Fischer
ae35c4b05c [ticket/12673] IMAGETYPE_SWC might be missing when SWC is not supported.
PHPBB3-12673
2014-06-08 16:46:55 +02:00
Joas Schilling
cae8448fe4 Merge pull request #2432 from Nicofuma/ticket/11226
[ticket/11226] filespec::move_file() should error correctly

* Nicofuma/ticket/11226:
  [ticket/11226] Explicity set file_moved to false
  [ticket/11226] Add tests
  [ticket/11226] Use $user->lang()
  [ticket/11226] filespec::move_file() should error correctly
2014-05-29 00:15:10 +02:00
Tristan Darricau
b75fb96bab [ticket/11226] Explicity set file_moved to false
PHPBB3-11226
2014-05-28 22:34:10 +02:00
Yuriy Rusko
a759704b39 [ticket/12594] Remove @package tags and update file headers
PHPBB3-12594
2014-05-27 20:51:13 +02:00
Tristan Darricau
cee9b1d856 [ticket/11226] Use $user->lang()
PHPBB3-11226
2014-05-10 19:47:32 +02:00
Tristan Darricau
eee2091201 [ticket/11226] filespec::move_file() should error correctly
PHPBB3-11226
2014-05-10 15:09:25 +02:00
Andreas Fischer
89391dec08 [ticket/12458] Apply Squiz.WhiteSpace.SuperfluousWhitespace.* to legacy code.
* There MUST NOT be trailing whitespace at the end of lines.
* There MUST NOT be whitespace before the first content of a file.
* There MUST NOT be whitespace after the last content of a file.
* Functions MUST NOT contain multiple empty lines in a row.

PHPBB3-12458
2014-04-29 17:51:21 +02:00
Marc Alexander
106be54de3 [ticket/12211] Do not run attachment file names twice through htmlspecialchars
Upload filenames are already processed via htmlspecialchars in the
type_cast_helper of the new request class. There is no need to run it through
htmlspecialchars() again in the filespec class.

PHPBB3-12211
2014-04-11 21:10:28 +02:00
Andreas Fischer
2050a39da7 [feature/plupload/integration] Integration of Plupload
This commit is a highly-refactored and up-to-date version of Fyorl's work
which was part of his Google Summer of Code 2012 project "Attachment
Improvements".

PHPBB3-10929
2013-10-11 17:40:16 +02:00
Nils Adermann
b95fdacdd3 [ticket/11700] Move all recent code to namespaces
PHPBB3-11700
2013-09-16 00:25:27 +02:00
Nils Adermann
da2752e400 [ticket/11700] Modify all code to use the new interface names
PHPBB3-11700
2013-07-14 13:30:52 -04:00
Marc Alexander
4ae0c78782 [ticket/10763] Use self when calling get_extension() in filespec class
PHPBB3-10763
2012-12-17 19:17:32 +01:00
Marc Alexander
54d96dfac7 [ticket/10763] Make functions for remote avatars static
fileupload::image_types() and filespec::get_extension() are called
statically while submitting the form for the remote avatar. Make them
static as described in the ticket in order to prevent a PHP notice.
Also change the tests to use the static functions.

PHPBB3-10763
2012-12-17 17:42:13 +01:00
Fyorl
91b9cc90dd [ticket/10939] Modified functions_upload to not use $_FILES
PHPBB3-10939
2012-08-15 15:00:03 +01:00
Fyorl
e71474abb5 [ticket/10944] strpos now stricter and removed superfluous ternary
PHPBB3-10944
2012-07-17 17:39:19 +01:00
Fyorl
6aea4db6c7 [ticket/10944] Reverted changes in PHPBB3-10963
is_image now just checks the mimetype reported by the browser
and get_mimetype goes back to being unused.

PHPBB3-10944
2012-07-17 17:39:00 +01:00
Fyorl
4fbcf4eaad [ticket/10963] filespec::get_mimetype now used
filespec::get_mimetype now uses the finfo class in order to detect the
mimetype of a given filename. filespec::is_image() now uses this method.

PHPBB3-10963
2012-07-04 13:27:55 +01:00
Fyorl
f208b59c59 [ticket/10963] Removed superfluous ternary statement and strpos now stricter
PHPBB3-10963
2012-07-02 23:49:40 +01:00
Fyorl
03ddfbbaf1 [ticket/10963] Modified filespec::is_image() to check actual mimetype
Modified filespec::is_image() to check the Fileinfo mimetype rather than
trusting the browser.

PHPBB3-10963
2012-07-02 23:30:47 +01:00
Andreas Fischer
7edb52b9be Merge branch 'develop-olympus' into develop
* develop-olympus:
  [ticket/10908] Document that 0 filesize configuration means limited by PHP
  [ticket/10908] Download files only up to max_upload_filesize if limit is 0
2012-05-31 11:55:12 +02:00
Nils Adermann
13f30e8d9d [ticket/10908] Download files only up to max_upload_filesize if limit is 0
PHPBB3-10908
2012-05-29 14:27:25 +02:00
Unknown
7a04c9048c [ticket/9916] Updating header license and removing Version $Id$
PHPBB3-9916
2011-12-31 13:32:52 +00:00
Joas Schilling
179662e949 [ticket/10345] Use the plural function in some more places.
I added two function avatar_explanation_string() and avatar_error_wrong_size()
for easier handling of the "pixels"-languages, as they are used quite often.

PHPBB3-10345
2011-11-25 15:10:49 -05:00
Andreas Fischer
ac26bb458f [ticket/9764] Allow $config['mime_triggers'] to be an empty string.
explode('|', '') and explode('|', NULL) both return array(0 => '') which can
cause filespec::check_content() to reject everything starting with a '<'
character in case $config['mime_triggers'] is an empty string or not set.

fileupload::set_disallowed_content() now filters out empty strings by calling
array_diff() on the passed array, so setting $config['mime_triggers'] to an
empty string will turn off mime checking completely.

On the other side we want to fail safe if $config['mime_triggers'] is not set
at all. To do this, the array fileupload::$disallowed_content now contains some
default strings to be filtered out.

PHPBB3-9764
2010-10-28 22:00:04 +02:00
Andreas Fischer
dd63f57344 [ticket/9615] magic_quotes_gpc: call stripslashes() before utf8_basename()
When magic_quotes_gpc is 'On' it also affects the $_FILES array and a filename
like 'bantu"s testfile.txt' will be returned as 'bantu\"s testfile.txt'.

Because utf8_basename() also strips off anything before the last backslash
the filename was returned as '"s testfile.txt'.

Calling stripslashes() before utf8_basename() solves the problem.

PHPBB3-9615
2010-08-04 12:35:19 +02:00
Andreas Fischer
e4398ef42e [feature/remote_upload-filesize] Also check HTTP content-length before actually starting the file transfer.
PHPBB3-9517
2010-05-14 01:19:34 +02:00
Andreas Fischer
d19565756a [feature/remote_upload-filesize] When transferring files from a remote webserver, abort the transfer as soon as the allowed filesize has been exceeded.
PHPBB3-9517
2010-05-14 01:19:34 +02:00
Meik Sievertsen
3b73584430 why am i so dumb sometimes... /me hits myself with the dumbness stick...
regression from r10122

git-svn-id: file:///svn/phpbb/branches/phpBB-3_0_0@10141 89ea8834-ac86-4346-8a33-228a782c2dd0
2009-09-13 14:31:32 +00:00
Meik Sievertsen
a5e4ca259a Always remove temporary filename (Bug #50965)
git-svn-id: file:///svn/phpbb/branches/phpBB-3_0_0@10122 89ea8834-ac86-4346-8a33-228a782c2dd0
2009-09-08 14:02:40 +00:00
Meik Sievertsen
2958890439 Apply locale-independent basename() to attachment filenames. New function added: utf8_basename(). (Bug #43335 - Patch by ocean=Yohsuke)
git-svn-id: file:///svn/phpbb/branches/phpBB-3_0_0@9905 89ea8834-ac86-4346-8a33-228a782c2dd0
2009-08-01 12:28:50 +00:00