Commit Graph

5922 Commits

Author SHA1 Message Date
Miguel Dantas
5eb4a7d711 [MEDIA] File downloader now in PHP, added proper name in the UI and changed the format for new attachment file names
The file downloader was changed from a simple redirect to the file to one
implemented in PHP, which should make it safer, by making it possible disallow
direct access to the file, to prevent executing of atttachments

The filename has a new format:
  bin2hex("{$original_name}")."-{$filehash}"
This format should be respected. Notice the dash, which is important to distinguish it from the previous
format, which was "{$hash}.{$ext}"

This change was made to both make the experience more user friendly, by
providing a readable name for files, as opposed to it's hash. This name is taken
from the upload filename, but, clearly, as this wasn't done before, it's
impossible to have a proper name for older files, so those are displayed as
"untitled.{$ext}".

This new name is displayed in the UI, instead of the previous name.
2019-08-03 17:31:36 +01:00
Diogo Cordeiro
d705bcbd98 [CORE] Use random_bytes() if available and improve common_confirmation_code() randomness.
With PHP 7 comes the [random_bytes()](https://php.net/manual/en/function.random-bytes.php) and the [random_int()](https://www.php.net/manual/en/function.random-int.php) function which generates cryptographically secure pseudo-random bytes and integers, respectively.
2019-08-03 17:29:14 +01:00
Diogo Cordeiro
f0f5ecb756 [SCRIPTS] Fix sessiongc by XRevan86 2019-08-01 14:38:04 +01:00
Diogo Cordeiro
d1fc7c0774 [CORE] MySQL 5.5 support fully restored 2019-07-25 15:35:24 +01:00
Diogo Cordeiro
5ea0d74a57 [UI] Long strings/words in dents weren't being wrapped 2019-07-10 00:33:19 +01:00
Diogo Cordeiro
0a4eeb89da [CORE][ROUTER] Fix wrong parameter in all/:tag by XRevan86 2019-07-01 22:40:21 +01:00
Diogo Cordeiro
11dc170ead [CORE][FRAMEWORK] URL_REGEX_VALID_PATH_CHARS didn't recognize the parenthesis sign. 2019-06-26 15:54:51 +01:00
Diogo Cordeiro
98c0c1ed53 Implement $config['site']['logdebug'] 2019-06-25 22:59:10 +01:00
Diogo Cordeiro
83a05724b8 [CORE] Fix subscriptions and subscribers list (related to 44653d339d) 2019-06-24 14:06:43 +01:00
Diogo Cordeiro
44653d339d [Poll] Refactoring and minor bug fixes 2019-06-23 23:06:04 +01:00
Diogo Cordeiro
f2705180e0 [TagSub] Fix User's tags list issue
Issue introduced with 6d9f390b and 9a92b58057
2019-06-18 14:56:55 +01:00
Diogo Cordeiro
306d80de94 [DATABASE] Revert accidental regression introduced with 9a39ebe66f 2019-06-14 12:00:10 +01:00
Diogo Cordeiro
2740ff8c4c [DOCUMENTATION] Minor corrections
Add two missing contributors
Bumped patch due to changed introduced with 0583a6a904
2019-06-12 12:55:42 +01:00
Daniel Supernault
74ad4038ac Allow username or email in login form 2019-06-12 03:25:06 +01:00
Diogo Cordeiro
81d65afb28 [RELEASE] The Invicta Crusade 2019-06-11 18:37:25 +01:00
Miguel Dantas
20c73f0596 [FORMATING] Ran php-cs-fixer on lib/mediafile.php, lib/imagefile.php and classes/File.php 2019-06-10 00:38:16 +01:00
Miguel Dantas
b224d93098 [MEDIA] ImageFile now extends MediaFile and validates images more aggressively.
Default supported files need to use consistent names. Bumped version to 1.20.0

ImageFile has been changed to extend MediaFile and rely on it to partially
validate files. This validation has been extended to not rely solely on
Fileinfo, as it is disabled on some places. Now it'll try to use the shell
command `file`, if Fileinfo isn't available.

ImageFile now converts every new upload to PNG, except JPEG and GIF, which
are kept, but still resized (to the same size), to remove possible scripts
embedded therein.

MediaFile::fromUpload will return an ImageFile if the uploaded file is an image
or a MediaFile otherwise.

MediaFile can be constructed with an id with value -1 to denote a temporary
object, which is not added to the DB. This is useful to create a temporary
object for representing images, so it can be used to rescale them.

The supported attachment array needs to be populated with the result of calling
`image_type_to_extension` for the appropriate image type, in the case of images.
This is important so all parts of the code see the same extension for each image
type (jpg vs jpeg).

Added documentation to classes/File.php and to lib/MediaFile and lib/ImageFile
2019-06-10 00:35:53 +01:00
brunoccast
a1041a53f7 [THEME] Fix OpenID settings styles
- Action buttons are now side-by-side
- Dropped unused style rule concerning the solo-positioning of the Remove button
- Bump GS patch version
2019-06-09 18:13:04 +01:00
brunoccast
1e4063254b [OpenID] Added synchronization button and corresponding action
UI:
- "Delete" area is now "Actions" area
- Updated themes to better reflect the changes

Routes:
- index.php?action=finishsyncopenid => finishsyncopenid

Translations:
- Updated OpenID translation files
- Updated OpenID POT file

Versioning:
- Bump OpenID minor version
- Bump GS patch version

Why would have labeling the Synchronize button of Sync been of bad taste? - answered by XRevan86:

In "synchronise" "ch" is a digraph meaning /k/ (actually /x/ turned into /k/ in English but whatever).
So… not separate letters.
It's like "ph" in "alphabet", or "sh" in "sheep", or "ch" in "chop" -- "ch" can mean a whole variety of sounds.
2019-06-09 17:04:26 +01:00
Diogo Cordeiro
08b6cfde66 [SESSION] Add backwards compatibility for third party plugins depending on old Session::cleanup()
Namely Qvitter
2019-06-08 00:31:32 +01:00
Diogo Cordeiro
b6be1a3659 [DATABASE][User_openid_prefs] Fix wrong type for modified column
Patch submited by Sorokin Alexei (XRevan86)
2019-06-07 15:02:09 +01:00
brunoccast
00b4a084ad PSR2-format 2019-06-07 15:02:09 +01:00
brunoccast
061e7891e9 Cleanup and documentation of common_ensure_session
- Remove redundant branch
- Remove error suppression of session_start()
2019-06-07 15:02:09 +01:00
Diogo Cordeiro
a1af5562de EmailRegistration plugin flow requires a confirmation address before user creation 2019-06-07 15:02:09 +01:00
Diogo Cordeiro
46f98b3142 [VersionBump] 1.19.0, fairly late
The core plugins whose version was attached to GS's were reseted to 2.0.0.

2.0.0 was chosen as reset version for plugins because it is higher than
  the one that was set by inheriting GS version. Furthermore, it's a
  major change from prior plugin versioning system thus it also makes
  semantic sense.

Justification for version bump:

== GS ==
9a4ab31f26 1.19.0
c13b935201 1.18.3
c13b935201 1.18.2
18fc39d2cf 1.18.1
c083a8bcc2 1.18.0
e8783d46d0 1.17.1
d9a42550ff 1.17.0
1536d3ef29 1.16.0
c03ed457a6 1.15.0
d2e6519bad 1.14.2
fe411e8138 1.14.1
b17e0b4169 1.14.0
daa5f87fd4 1.13.0
d75b5d2f4a 1.11.7
f6dbf66983 1.11.6
6cf674f8f8 1.11.5
7845a09b34 1.11.4
e4d432295d 1.11.3
339204f1ee 1.11.2
a4e679a118 1.11.1
7967db6ff5 1.11.0
bc030da320 1.10.1
9cc7df51d6 1.10.0
bf7f17474d 1.9.2
8a07edec5f 1.9.1
0042971d74 1.9.0
6b5450b7e6 1.8.0
5dcc98d1c6 1.7.0
e6667db0cd 1.6.0
3290227b50 1.5.0
a59c439b46 1.4.0
496ab8c920 1.3.10
986030060b 1.3.9
1d529c021a 1.3.8
f89c052cf8 1.3.7
38f2ecefac 1.3.6
e473937cb9 1.3.5
9a39ebe66f 1.3.4
ddc3cecfc0 1.3.3
2b43d484eb 1.3.2
e8e487187e 1.3.1

== Plugins ==
XMPP plugin
e0887220b0 bump patch
e186ad57d0 bump patch

OStatus
e186ad57d0 bump patch

Nodeinfo
ceae66a30f bump minor
586fb5a517 bump major
195296846e bump minor
2019-06-07 15:02:08 +01:00
brunoccast
43df2d201c Extend Action with redirect after login logic, update some actions to use it 2019-06-07 15:02:07 +01:00
Diogo Cordeiro
4ca32628f7 [SESSION] Log messages were a bit confusing
Reported by XRevan86
2019-05-26 20:14:05 +01:00
Diogo Cordeiro
c083a8bcc2 [SESSION] Implement SessionHandlerInterface instead of setting custom handlers by XRevan86 2019-05-22 22:29:33 +01:00
Diogo Cordeiro
d9a42550ff is_rtl should handle lang instead of code 2019-05-16 22:51:11 +01:00
Diogo Cordeiro
1536d3ef29 [XML/HTML Outputter] General improvements and refactoring as well as some bug fixes 2019-05-07 15:57:19 +01:00
Diogo Cordeiro
c03ed457a6 Fix broken user activitystreams feed due to deleted notices 2019-05-06 23:27:38 +01:00
Diogo Cordeiro
d2e6519bad lib/ping.php - Fix PHP 7.3 Warning switch continue -> break 2019-05-06 23:27:38 +01:00
Diogo Cordeiro
fe411e8138 Fix some typos/small obvious bugs on twitterRssGroupArray 2019-05-03 17:09:23 +01:00
Diogo Cordeiro
6cf674f8f8 Some minor refactoring on session handler 2019-04-27 00:28:05 +01:00
Diogo Cordeiro
9cc7df51d6 Some obvious bug fixes for i18n 2019-04-25 23:12:46 +01:00
Diogo Cordeiro
bf7f17474d When an attachment fails to load, it shouldn't destroy the whole layout by XRevan86 2019-04-25 20:46:47 +01:00
Diogo Cordeiro
8a07edec5f Fix fulltext search by XRevan86 2019-04-25 19:32:20 +01:00
Diogo Cordeiro
0042971d74 Fix bug in 36a55d84.
We still have to further review and improve the caching of streams.
Important related changes: 2272cc24#diff-8633314d55a2834ab2ea425d7157bec14aca672L60
Important related discussion: https://github.com/chimo/gs-rediscache/issues/{1,2}
2019-04-25 18:51:44 +01:00
Diogo Cordeiro
6b5450b7e6 Faster inboxnoticestream.php by XRevan86.
This commit consequently reverts 5dcc98d1c6 and a59c439b46. This translated the php based version into a faster SQL query.
2019-04-25 18:48:53 +01:00
Diogo Cordeiro
5dcc98d1c6 inboxnoticestream.php gotta go fast 2019-04-23 23:10:43 +01:00
Diogo Cordeiro
e6667db0cd Add chimo's Nodeinfo plugin as a default GNU social plugin 2019-04-22 06:50:28 +01:00
Diogo Cordeiro
3290227b50 Modern version of XMPPHP extlib
Original XMPPHP is no longer maintained
Therefore I've done some optimizations and imported some commits from birkner and zorn-v forks.
None of the forks really looked ready to be adopted...
2019-04-21 17:13:07 +01:00
Diogo Cordeiro
a59c439b46 Faster inboxnoticestream.php by XRevan86 2019-04-21 00:56:56 +01:00
Diogo Cordeiro
f89c052cf8 Set default value of datetime columns to CURRENT_TIMESTAMP
This resolves an issue with MySQL 5.7 where the default SQL_MODE is set to disallow zero dates (i.e. '0000-00-00 00:00:00')
Fixed thanks to Francis and Normandy from postActiv.
2019-04-16 00:43:17 +01:00
Diogo Cordeiro
8305641b20 Update master GS version 2019-04-04 10:12:56 +01:00
Diogo Cordeiro
d1ba0dddec Merge branch 'issue-338' into 'master'
Database fields with timestamp type now allow CURRENT_TIMESTAMP to be set as default value

See merge request diogo/gnu-social!3
2018-09-14 21:30:16 +00:00
Diogo Cordeiro
9a39ebe66f Database fields with timestamp type now allow CURRENT_TIMESTAMP to be set as default value
Add default values to created and modified columns of Profile_list table to fix issue #338
2018-08-25 14:07:52 +01:00
Diogo Cordeiro
ddc3cecfc0 Add default values for avatar and attachment directories in web installer 2018-08-25 14:05:56 +01:00
Mikael Nordfeldth
ec98fd0c43 Merge remote-tracking branch 'gnuio/master' into nightly 2017-12-17 18:32:23 +01:00
mmn
67a9c0415c Merge branch 'cache-html-sanitizer' into 'master'
set the html sanitizer cache directory to ['cache']['dir'] from the config file;

See merge request gnu/gnu-social!156
2017-12-17 17:25:46 +00:00