Commit Graph

63 Commits

Author SHA1 Message Date
Philip Weir
ccede1f272 Update links in comments and config to https where available (#9759) 2025-01-26 13:34:57 +01:00
Aleksander Machniak
15659d7815 PHPCS: phpdoc_annotation_without_dot=true (default) 2024-04-14 10:32:35 +02:00
Aleksander Machniak
20d9edce04 Code improvements 2024-03-31 19:22:56 +02:00
Michael Voříšek
d18406a8bd Fix binary operator spaces CS (#9330)
* align_single_space_minimal for assign

* assign operators grouping is not supported by PHP CS Fixer

* binary_operator_spaces = single_space

* fix anonymous function on single line

* align comments manually
2024-02-02 07:53:34 +01:00
Aleksander Machniak
34500a4fa4 Fix "missing return statement" phpstan errors 2024-01-27 19:07:52 +01:00
Michael Voříšek
ff2d721680 Fix more CS whitespace (#9318)
* fix "no_useless_else" manually

* fix some "blank_line_before_statement"

* two manual changes

* Revert "fix some "blank_line_before_statement""

This reverts commit 2cc857c00e.

* fix some "blank_line_before_statement" using patched fixer (after "}" only)

* fix continue/break too
2024-01-25 19:17:29 +01:00
Michael Voříšek
b1a0067e5d Fix more CS (#9303)
* fix "class_attributes_separation"

* fix "ternary_to_null_coalescing"

* fix "no_extra_blank_lines"

* fix "php_unit_data_provider_name" - use snake_case

* fix remaining "function data_" manually

* move "php_unit_test_case_static_method_calls" to a better place in cnf

* fix 3.47.1 CS
2024-01-20 08:22:32 +01:00
Michael Voříšek
6a53a1d853 Fix CS (whitespace, visibility) (#9297)
* Fix "method_argument_space"

* Fix "control_structure_continuation_position"

* Fix "new_with_parentheses"

* Fix "blank_line_before_statement"

* Fix "visibility_required"

* Fix some "array_indentation"

* Fix some "array_indentation" - unify all "rcube::raise_error" calls

* rm useless eslint ignores and add rules counts

* sort eslint ignores

* fix eslint ignores grammar

* Revert "Fix "blank_line_before_statement""

* fix CS 3.46.0
2024-01-04 14:26:35 +01:00
Michael Voříšek
3e458fa5fd Refer native constants unambiguously (#9275)
* Fix "native_constant_invocation" CS

* "self_accessor" was fixed in 9269 PR

* "php_unit_strict" was fixed in 9268 PR
2023-12-23 17:02:19 +01:00
Michael Voříšek
a9167a0d2f Fix "static_lambda" CS (#9276) 2023-12-20 20:01:00 +01:00
Michael Voříšek
e7d7e62146 Modernize more basic CS II (#9254)
* fix "integer_literal_case"

* fix "phpdoc_separation"

* fix "phpdoc_var_without_name"

* fix "operator_linebreak"

* fix "no_alias_language_construct_call"

* fix "list_syntax"

* fix "concat_space"

* fix "array_syntax"

* fix "binary_operator_spaces"

* fix "binary_operator_spaces" relaxed

* fix "phpdoc_types_order"

* fix "phpdoc_trim"

* fix "native_type_declaration_casing"

* fix "method_chaining_indentation"

* fix "phpdoc_no_package"

* fix "elseif"

* fix PHP CS Fixer config itself too

* fix "native_type_declaration_casing"
2023-12-17 13:14:45 +01:00
Michael Voříšek
ca8b17d191 Modernize more basic CS (#9258)
* fix "yoda_style"

* fix "is_null"

* rm useless rule ignores

* add full "PhpCsFixer:risky" ruleset

* fix "implode_call"

* fix "no_alias_functions"

* fix "array_push"

* fix "long_to_shorthand_operator"

* fix "ternary_to_elvis_operator"

* fix "logical_operators"

* fix "fopen_flags"

* rename "returns" phpdoc tags to "return"

* fix "php_unit_construct"

* fix "function_to_constant"

* fix "php_unit_data_provider_return_type"

* fix "php_unit_set_up_tear_down_visibility"

* some safe "string_length_to_empty"

* fix "phpdoc_align"

* fix "phpdoc_no_alias_tag"

* fix "trailing_comma_in_multiline"

---------

Co-authored-by: Aleksander Machniak <alec@alec.pl>
2023-12-17 09:51:11 +01:00
Michael Voříšek
93946f4ca7 Fix "self_accessor" PHP CS Fixer rule (#9269) 2023-12-17 09:44:43 +01:00
Michael Voříšek
a8707ae220 Fix and assert basic CS using CI (#9246)
* Assert CS using CI

* fix "single_blank_line_at_eof"

* fix "statement_indentation"

* fix "switch_case_semicolon_to_colon"

* fix "control_structure_braces"

* fix "statement_indentation"

* fix "no_whitespace_in_blank_line"

* fix "no_trailing_whitespace_in_comment"

* fix "no_trailing_whitespace"

* fix "single_space_around_construct"

* fix "spaces_inside_parentheses"

* fix "ternary_operator_spaces"

* fix "trim_array_spaces"

* fix "whitespace_after_comma_in_array"

* fix "cast_spaces"

* fix "unary_operator_spaces"

* fix "no_trailing_comma_in_singleline"

* fix "ordered_imports"

* fix "no_unused_imports"

* Check composer.json format

* fix CI job name

* file header comments are not phpdoc

* fix "phpdoc_indent"

* fix "braces_position"

* fix "phpdoc_types"

* fix "no_blank_lines_after_class_opening"

* fix "no_multiple_statements_per_line"

* fix "multiline_comment_opening_closing"

* fix "single_line_empty_body"

* fix "non_printable_character"

* fix "phpdoc_trim_consecutive_blank_line_separation"

* fix "include"

* fix "no_mixed_echo_print"

---------

Co-authored-by: Aleksander Machniak <alec@alec.pl>
2023-12-16 15:37:43 +01:00
Michael Voříšek
5425d1a84a Fix invalid phpdocs (#9252)
* fix missing return type in phpdoc
* fix "phpdoc_scalar"
* Fix phpdoc variable names typos
* fix wrong phpdoc tags
2023-12-10 16:20:50 +01:00
Aleksander Machniak
8415e34c2b Cleanup 2023-11-07 15:53:40 +01:00
Aleksander Machniak
cd87dd013f Fix cross-site scripting (XSS) vulnerability in setting Content-Type/Content-Disposition for attachment preview/download
Thanks to rehme.infosec for reporting the issues.
2023-11-04 17:52:00 +01:00
Aleksander Machniak
4b488353c5 Fix support for Windows-31J charset (#8869) 2023-01-29 10:11:53 +01:00
Rok Jaklič
0077d7a52d Added prioritized charsets for Slovenian language (#8701) 2022-09-24 09:13:38 +02:00
Aleksander Machniak
1389e573d3 Remove use of utf8_encode() and utf8_decode() functions deprecated in PHP 8.2 2022-08-06 18:58:23 +02:00
Aleksander Machniak
f23aaed10e Remove use of unreliable charset detection (#8344) 2022-04-09 14:13:50 +02:00
Aleksander Machniak
3fd9e2faf6 Small improvements to rcube_charset::detect() 2021-11-27 09:38:38 +01:00
Aleksander Machniak
bbde830be2 Improve precision of charset detection on vCard import 2021-11-27 09:26:21 +01:00
Aleksander Machniak
13da16b36f Fix charset conversion errors on PHP < 8 for charsets not supported by mbstring (#8252) 2021-10-28 14:09:29 +02:00
Aleksander Machniak
0d4a395464 Fix PHP 8.1 deprecation warnings 2021-07-31 07:53:14 +02:00
Aleksander Machniak
f74bc3fd80 Fix bug where invalid non-unicode characters in JSON output could make the UI unresponsive (#7955) 2021-03-27 09:19:18 +01:00
Aleksander Machniak
12562a7b0e Remove redundant code from rcube_charset::clean() 2021-03-22 08:36:19 +01:00
Aleksander Machniak
5ac44fd4ed PHPDoc fixes 2021-02-28 11:58:27 +01:00
Aleksander Machniak
cdeccac627 Also ignore PHP8 warnings on iconv() use with invalid encoding 2021-01-30 17:59:09 +01:00
Aleksander Machniak
d258f845ab Fix PHP8 Fatal error: Uncaught ValueError: mb_convert_encoding() (#7850)
Also, bring back iconv() fallback, it supports much more charsets than mbstring.
2021-01-30 15:51:23 +01:00
Aleksander Machniak
f4ed1024dc PHP8 fixes, CS fixes, short array syntax, tests 2020-12-02 20:15:00 +01:00
Aleksander Machniak
37d75d96a3 Short array syntax, CS fixes 2020-11-27 19:51:33 +01:00
Aleksander Machniak
bde383d051 PHP8: Fix various issues
for now only these I found by running our unit tests, there will be much more
2020-10-11 10:32:41 +02:00
Aleksander Machniak
a5c2b4360c Fixes in context of undefined variables, and code style 2020-08-15 12:13:31 +02:00
Aleksander Machniak
30610e867e Merge branch 'fix_encode' of https://github.com/shirosaki/roundcubemail into shirosaki-fix_encode
Refactor the new code
2020-06-13 12:53:31 +02:00
Aleksander Machniak
35c29be9b2 Remove use of ext-iconv 2020-05-03 18:33:20 +02:00
Hiroshi Shirosaki
d9667295d8 Fix wordwrap with ISO-2022-JP
A message with ISO-2022-JP-MS characters currupts by wordwrap.
Use ISO-2022-JP-MS charset in wordwrap.
Add a unit test.
2019-12-03 17:35:02 +09:00
Hiroshi Shirosaki
869d1d1eaf Fix ISO-2022-JP-MS encoding convert
ISO-2022-JP-MS characters are removed by iconv on sending mail.
Use mbstring functions on sending.
Add a unit test.
2019-12-03 17:25:11 +09:00
Aleksander Machniak
e7ebff56df PHPDoc fixes 2019-09-30 20:43:07 +02:00
Aleksander Machniak
0c4d78aa11 Remove language code from charset name as per the RFC2231.5 2019-05-15 10:09:57 +02:00
Aleksander Machniak
57c67db029 Remove year(s) from copyright headers + some cleanup 2019-04-16 10:42:45 +02:00
Aleksander Machniak
0bef84c410 Fix decoding non-ascii attachment names from TNEF attachments (#5646, #5799) 2017-06-27 15:25:01 +02:00
ka7
9a35768c26 spelling fixes (#5690) 2017-03-12 12:14:19 +01:00
Shin Kojima
0b385dc946 Skip iconv for problematic ISO-2022-JP strings (#5668)
We sometimes get broken character encodings such as:
Subject: =?iso-2022-jp?B?GyRCLWo7M3l1OSk2SBsoQgo=?=
This actually is not a strict ISO-2022-JP string, but a CP50220 string
that is a variant of ISO-2022-JP with extended characters proposed by
Microsoft. Iconv can not handle these encodings well.
2017-03-06 09:22:55 +01:00
Aleksander Machniak
42ddfe5ec9 Simplify mbstring code path in rcube_charset::convert() 2016-09-27 17:03:02 +02:00
Aleksander Machniak
c65bb121eb Describe Framework requirements, drop some redundant code (since we require mbstring) 2016-08-20 11:07:05 +02:00
Aleksander Machniak
7e3298753a Use ternary operator where aplicable 2015-11-14 10:08:07 +01:00
Aleksander Machniak
1b61a48eec Get rid of mb_check_encoding() before mb_convert_encoding() for better performance, CS fixes 2015-09-22 21:18:15 +02:00
Aleksander Machniak
83345af059 Log charset conversion warning only when no function was found, not when the string was invalid 2015-09-22 13:11:30 +02:00
Aleksander Machniak
a958748947 CS fixes 2015-06-07 15:26:33 +02:00