]> granicus.if.org Git - php/log
php
4 years agoMerge branch 'PHP-8.0'
Nikita Popov [Mon, 9 Nov 2020 10:03:14 +0000 (11:03 +0100)]
Merge branch 'PHP-8.0'

* PHP-8.0:
  Remove embedded property from mysqli_driver

4 years agoRemove embedded property from mysqli_driver
Dharman [Fri, 6 Nov 2020 23:00:33 +0000 (23:00 +0000)]
Remove embedded property from mysqli_driver

All other leftovers of this feature have been dropped in PHP 8,
so we should remove the property as well.

Closes GH-6407.

4 years agoMerge branch 'PHP-8.0'
Nikita Popov [Mon, 9 Nov 2020 09:19:40 +0000 (10:19 +0100)]
Merge branch 'PHP-8.0'

* PHP-8.0:
  Fixed bug #80334

4 years agoFixed bug #80334
Nikita Popov [Mon, 9 Nov 2020 09:18:43 +0000 (10:18 +0100)]
Fixed bug #80334

If assert() was called with named args, add description as named
arg as well.

4 years agoMerge branch 'PHP-8.0'
Dmitry Stogov [Mon, 9 Nov 2020 08:50:51 +0000 (11:50 +0300)]
Merge branch 'PHP-8.0'

* PHP-8.0:
  Fixed missaligned access

4 years agoFixed missaligned access
Dmitry Stogov [Mon, 9 Nov 2020 08:50:26 +0000 (11:50 +0300)]
Fixed missaligned access

4 years agoMerge branch 'PHP-8.0'
Nikita Popov [Mon, 9 Nov 2020 08:47:12 +0000 (09:47 +0100)]
Merge branch 'PHP-8.0'

* PHP-8.0:
  Skip preload test under asan

4 years agoSkip preload test under asan
Nikita Popov [Mon, 9 Nov 2020 08:46:48 +0000 (09:46 +0100)]
Skip preload test under asan

Just like the other preload tests with startup failures, this may
cause leaks.

4 years agoMerge branch 'PHP-8.0'
Nikita Popov [Mon, 9 Nov 2020 08:41:23 +0000 (09:41 +0100)]
Merge branch 'PHP-8.0'

* PHP-8.0:
  Rename PhpToken::getAll() to PhpToken::tokenize()

4 years agoRename PhpToken::getAll() to PhpToken::tokenize()
Nikita Popov [Mon, 9 Nov 2020 08:40:31 +0000 (09:40 +0100)]
Rename PhpToken::getAll() to PhpToken::tokenize()

See https://externals.io/message/112189.
Fixes bug #80328.

4 years agoMerge branch 'PHP-8.0'
Derick Rethans [Sat, 7 Nov 2020 18:49:11 +0000 (18:49 +0000)]
Merge branch 'PHP-8.0'

4 years agoMerge branch 'PHP-7.4' into PHP-8.0
Derick Rethans [Sat, 7 Nov 2020 18:49:00 +0000 (18:49 +0000)]
Merge branch 'PHP-7.4' into PHP-8.0

4 years agoUpdate version in 7.4 branch
Derick Rethans [Sat, 7 Nov 2020 18:48:13 +0000 (18:48 +0000)]
Update version in 7.4 branch

4 years agoMerge branch 'PHP-8.0'
Christoph M. Becker [Fri, 6 Nov 2020 16:45:29 +0000 (17:45 +0100)]
Merge branch 'PHP-8.0'

* PHP-8.0:
  Split tests for compatibility with ICU 68.1

4 years agoMerge branch 'PHP-7.4' into PHP-8.0
Christoph M. Becker [Fri, 6 Nov 2020 16:44:51 +0000 (17:44 +0100)]
Merge branch 'PHP-7.4' into PHP-8.0

* PHP-7.4:
  Split tests for compatibility with ICU 68.1

4 years agoSplit tests for compatibility with ICU 68.1
Christoph M. Becker [Fri, 6 Nov 2020 16:11:26 +0000 (17:11 +0100)]
Split tests for compatibility with ICU 68.1

4 years agoStabalize IMAP parallel testing, again
George Peter Banyard [Fri, 6 Nov 2020 14:24:41 +0000 (14:24 +0000)]
Stabalize IMAP parallel testing, again

Drive by clean-up
Use less the default mailbox again

4 years agoMerge branch 'PHP-8.0'
Remi Collet [Fri, 6 Nov 2020 10:00:56 +0000 (11:00 +0100)]
Merge branch 'PHP-8.0'

* PHP-8.0:
  Raise E_WARNING on PHP related errors

4 years agoRaise E_WARNING on PHP related errors
Christoph M. Becker [Tue, 20 Oct 2020 10:31:58 +0000 (12:31 +0200)]
Raise E_WARNING on PHP related errors

If Zip operations fails due to PHP error conditions before libzip even
has been called, there is no meaningful indication what failed; the
functions just return false, and the Zip status indicated that no error
did occur.  Therefore we raise `E_WARNING` in these cases.

Closes GH-6356.

4 years agoMerge branch 'PHP-8.0'
Dmitry Stogov [Fri, 6 Nov 2020 09:10:28 +0000 (12:10 +0300)]
Merge branch 'PHP-8.0'

* PHP-8.0:
  Move stack overflow checks out of the loops

4 years agoMove stack overflow checks out of the loops
Dmitry Stogov [Fri, 6 Nov 2020 09:09:56 +0000 (12:09 +0300)]
Move stack overflow checks out of the loops

4 years agoMerge branch 'PHP-8.0'
Remi Collet [Fri, 6 Nov 2020 08:59:47 +0000 (09:59 +0100)]
Merge branch 'PHP-8.0'

* PHP-8.0:
  report about ZSTD compression availability
  only display libzip both headers/library versions if they differ

4 years agoreport about ZSTD compression availability
Remi Collet [Thu, 5 Nov 2020 16:18:22 +0000 (17:18 +0100)]
report about ZSTD compression availability

4 years agoonly display libzip both headers/library versions if they differ
Remi Collet [Thu, 5 Nov 2020 16:13:39 +0000 (17:13 +0100)]
only display libzip both headers/library versions if they differ

4 years agoMerge branch 'PHP-8.0'
Nikita Popov [Thu, 5 Nov 2020 15:38:02 +0000 (16:38 +0100)]
Merge branch 'PHP-8.0'

* PHP-8.0:
  Backport preloading trait fixup fixes

4 years agoMerge branch 'PHP-7.4' into PHP-8.0
Nikita Popov [Thu, 5 Nov 2020 15:37:45 +0000 (16:37 +0100)]
Merge branch 'PHP-7.4' into PHP-8.0

* PHP-7.4:
  Backport preloading trait fixup fixes

4 years agoBackport preloading trait fixup fixes
Nikita Popov [Thu, 5 Nov 2020 10:58:31 +0000 (11:58 +0100)]
Backport preloading trait fixup fixes

This cherry-picks 33969c2252b2c33a72c9039072af8862fd347a5f and
2effbfd8713936742ef46e6e85ce193b320ac005 from PHP-8.0.

The issues these commits fix could also manifest in PHP 7.4, and
a commenter on bug #80307 reports this this might indeed be
happening.

4 years agoMerge branch 'PHP-8.0'
Dmitry Stogov [Thu, 5 Nov 2020 15:32:46 +0000 (18:32 +0300)]
Merge branch 'PHP-8.0'

* PHP-8.0:
  Fixed incorrect invariant guard motion

4 years agoFixed incorrect invariant guard motion
Dmitry Stogov [Thu, 5 Nov 2020 15:32:00 +0000 (18:32 +0300)]
Fixed incorrect invariant guard motion

4 years agoMerge branch 'PHP-8.0'
Nikita Popov [Thu, 5 Nov 2020 12:16:31 +0000 (13:16 +0100)]
Merge branch 'PHP-8.0'

* PHP-8.0:
  Fixup trait methods even if no traits are used

4 years agoFixup trait methods even if no traits are used
Nikita Popov [Thu, 5 Nov 2020 12:15:32 +0000 (13:15 +0100)]
Fixup trait methods even if no traits are used

Trait methods might be non-trivially inherited, in which case we
may have to perform fixup in classes that do not directly use any
traits.

4 years agoMerge branch 'PHP-8.0'
Nikita Popov [Thu, 5 Nov 2020 11:11:20 +0000 (12:11 +0100)]
Merge branch 'PHP-8.0'

* PHP-8.0:
  Fix multiple trait fixup

4 years agoFix multiple trait fixup
Nikita Popov [Thu, 5 Nov 2020 10:58:31 +0000 (11:58 +0100)]
Fix multiple trait fixup

If a trait method is inherited, preloading trait fixup might be
performed on it multiple times. Usually this is fine, because
the opcodes pointer will have already been updated, and will thus
not be found in the xlat table.

However, it can happen that the new opcodes pointer is the same
as one of the old opcodes pointers, if the pointer has been reused
by the allocator. In this case we will look up the wrong op array
and overwrite the trait method with an unrelated trait method.

We fix this by indexing the xlat table not by the opcodes pointer,
but by the refcount pointer. The refcount pointer is not changed
during optimization, and accurately represents which op arrays
should use the same opcodes.

Fixes bug #80307. The test case does not reproduce the bug, because
this depends on a lot of "luck" with the allocator. The test case
merely illustrates a case where orig_op_array would have been NULL
in the original code.

4 years agoMerge branch 'PHP-8.0'
Nikita Popov [Wed, 4 Nov 2020 15:05:48 +0000 (16:05 +0100)]
Merge branch 'PHP-8.0'

* PHP-8.0:
  End output handlers in preload shutdown

4 years agoEnd output handlers in preload shutdown
Nikita Popov [Wed, 4 Nov 2020 15:03:39 +0000 (16:03 +0100)]
End output handlers in preload shutdown

Same as in php_request_shutdown(), we need to end any active
output handlers, as these may no longer be safe to execute
lateron.

4 years agoMerge branch 'PHP-8.0'
Nikita Popov [Wed, 4 Nov 2020 14:53:17 +0000 (15:53 +0100)]
Merge branch 'PHP-8.0'

* PHP-8.0:
  getlastmod() can return false

4 years agogetlastmod() can return false
Nikita Popov [Wed, 4 Nov 2020 14:49:12 +0000 (15:49 +0100)]
getlastmod() can return false

At least this can happen during preloading.

4 years agoMerge branch 'PHP-8.0'
Nikita Popov [Wed, 4 Nov 2020 14:43:00 +0000 (15:43 +0100)]
Merge branch 'PHP-8.0'

* PHP-8.0:
  Fix static variable in methods inheritance during preloading

4 years agoFix static variable in methods inheritance during preloading
Nikita Popov [Wed, 4 Nov 2020 14:33:11 +0000 (15:33 +0100)]
Fix static variable in methods inheritance during preloading

This is now "bug compatible" with the normal behavior, and more
imporantly, does not crash :)

4 years agoMerge branch 'PHP-8.0'
Christoph M. Becker [Wed, 4 Nov 2020 13:58:47 +0000 (14:58 +0100)]
Merge branch 'PHP-8.0'

* PHP-8.0:
  Fix #80266: parse_url silently drops port number 0

4 years agoMerge branch 'PHP-7.4' into PHP-8.0
Christoph M. Becker [Wed, 4 Nov 2020 13:56:54 +0000 (14:56 +0100)]
Merge branch 'PHP-7.4' into PHP-8.0

* PHP-7.4:
  Fix #80266: parse_url silently drops port number 0

4 years agoMerge branch 'PHP-7.3' into PHP-7.4
Christoph M. Becker [Wed, 4 Nov 2020 13:54:14 +0000 (14:54 +0100)]
Merge branch 'PHP-7.3' into PHP-7.4

* PHP-7.3:
  Fix #80266: parse_url silently drops port number 0

4 years agoFix #80266: parse_url silently drops port number 0
Christoph M. Becker [Wed, 4 Nov 2020 10:34:10 +0000 (11:34 +0100)]
Fix #80266: parse_url silently drops port number 0

As of commit 81b2f3e[1], `parse_url()` accepts URLs with a zero port,
but does not report that port, what is wrong in hindsight.

Since the port number is stored as `unsigned short` there is no way to
distinguish between port zero and no port.  For BC reasons, we thus
introduce `parse_url_ex2()` which accepts an output parameter that
allows that distinction, and use the new function to fix the behavior.

The introduction of `parse_url_ex2()` has been suggested by Nikita.

[1] <http://git.php.net/?p=php-src.git;a=commit;h=81b2f3e5d9fcdffd87a4fcd12bd8c708a97091e1>

Closes GH-6399.

4 years agoMerge branch 'PHP-8.0'
Nikita Popov [Wed, 4 Nov 2020 13:52:47 +0000 (14:52 +0100)]
Merge branch 'PHP-8.0'

* PHP-8.0:
  Assert that references are not persisted

4 years agoAssert that references are not persisted
Nikita Popov [Wed, 4 Nov 2020 13:51:44 +0000 (14:51 +0100)]
Assert that references are not persisted

There should not be any need to persist references, and it's unlikely
that persisting a reference will behave correctly at runtime, because
we don't have a concept of an immutable reference.

4 years agoFix parallel testing for IMAP
George Peter Banyard [Wed, 4 Nov 2020 12:40:12 +0000 (12:40 +0000)]
Fix parallel testing for IMAP

The script for the clean section was missing the $ Meta-character to only delete the default
mailbox when it's an exact match.

Reinstore parallel testing for more tests.

4 years agoMerge branch 'PHP-8.0'
Nikita Popov [Wed, 4 Nov 2020 11:31:28 +0000 (12:31 +0100)]
Merge branch 'PHP-8.0'

* PHP-8.0:
  Don't xfail method_static_var.phpt

4 years agoDon't xfail method_static_var.phpt
Nikita Popov [Wed, 4 Nov 2020 11:30:41 +0000 (12:30 +0100)]
Don't xfail method_static_var.phpt

Let's test the current behavior here. It might not be right, but
it's long-standing behavior.

Nearly missed an assertion failure here because the test was
XFAILed...

4 years agoMerge branch 'PHP-8.0'
Nikita Popov [Wed, 4 Nov 2020 10:12:22 +0000 (11:12 +0100)]
Merge branch 'PHP-8.0'

* PHP-8.0:
  Don't disable opcache for generic tests

4 years agoDon't disable opcache for generic tests
Nikita Popov [Wed, 4 Nov 2020 10:11:14 +0000 (11:11 +0100)]
Don't disable opcache for generic tests

Even if the original issue only reproduces without opcache, we
should still allow running them with and without opcache.

4 years agoMerge branch 'PHP-8.0'
Nikita Popov [Wed, 4 Nov 2020 09:56:24 +0000 (10:56 +0100)]
Merge branch 'PHP-8.0'

* PHP-8.0:
  Fix dynamic function definition in preload script

4 years agoMerge branch 'PHP-7.4' into PHP-8.0
Nikita Popov [Wed, 4 Nov 2020 09:55:59 +0000 (10:55 +0100)]
Merge branch 'PHP-7.4' into PHP-8.0

* PHP-7.4:
  Fix dynamic function definition in preload script

4 years agoFix dynamic function definition in preload script
Nikita Popov [Wed, 4 Nov 2020 09:54:08 +0000 (10:54 +0100)]
Fix dynamic function definition in preload script

We should use normal function renaming if the function is declared
during preloading itself, rather than afterwards.

This fixes a regression introduced by
68f80be9d1380de731930187250a7ed6b55ae196.

4 years agoMake all IMAP fetch*() tests conflict with the default mailbox
George Peter Banyard [Tue, 3 Nov 2020 18:44:37 +0000 (18:44 +0000)]
Make all IMAP fetch*() tests conflict with the default mailbox

4 years agohash: murmur: Initialize final hash explicitly
Anatol Belski [Tue, 3 Nov 2020 14:33:52 +0000 (15:33 +0100)]
hash: murmur: Initialize final hash explicitly

Signed-off-by: Anatol Belski <ab@php.net>
4 years agoMerge branch 'PHP-8.0'
Nikita Popov [Tue, 3 Nov 2020 15:47:42 +0000 (16:47 +0100)]
Merge branch 'PHP-8.0'

* PHP-8.0:
  Don't disable early binding during preloading script

4 years agoDon't disable early binding during preloading script
Nikita Popov [Tue, 3 Nov 2020 15:45:13 +0000 (16:45 +0100)]
Don't disable early binding during preloading script

We should only disable early binding during the opcache_compile_file()
calls, not inside the preloading script or anything it includes.
The right condition to check for is whether we compile the file
without execution, as declaring classes is "execution".

4 years agoMerge branch 'PHP-8.0'
Nikita Popov [Tue, 3 Nov 2020 15:25:08 +0000 (16:25 +0100)]
Merge branch 'PHP-8.0'

* PHP-8.0:
  Report parse errors during preloading

4 years agoReport parse errors during preloading
Nikita Popov [Tue, 3 Nov 2020 15:24:54 +0000 (16:24 +0100)]
Report parse errors during preloading

4 years agoMerge branch 'PHP-8.0'
Nikita Popov [Tue, 3 Nov 2020 14:30:00 +0000 (15:30 +0100)]
Merge branch 'PHP-8.0'

* PHP-8.0:
  Fix use of type copy ctor when importing trait properties

4 years agoFix use of type copy ctor when importing trait properties
Nikita Popov [Tue, 3 Nov 2020 14:29:18 +0000 (15:29 +0100)]
Fix use of type copy ctor when importing trait properties

We shouldn't call the copy constructor inside the original type,
duh.

4 years agoMerge branch 'PHP-8.0'
Nikita Popov [Tue, 3 Nov 2020 13:50:15 +0000 (14:50 +0100)]
Merge branch 'PHP-8.0'

* PHP-8.0:
  Allow unlinked classes when performing in_compilation variance check

4 years agoAllow unlinked classes when performing in_compilation variance check
Nikita Popov [Tue, 3 Nov 2020 13:49:10 +0000 (14:49 +0100)]
Allow unlinked classes when performing in_compilation variance check

As preloading runs in in_compilation mode, we also need to allow
use of unlinked classes in lookup_class().

4 years agoMerge branch 'PHP-8.0'
Nikita Popov [Tue, 3 Nov 2020 13:19:53 +0000 (14:19 +0100)]
Merge branch 'PHP-8.0'

* PHP-8.0:
  Fix variance checks on resolved union types

4 years agoFix variance checks on resolved union types
Nikita Popov [Tue, 3 Nov 2020 13:15:05 +0000 (14:15 +0100)]
Fix variance checks on resolved union types

This is a bit annoying: When preloading is used, types might be
resolved during inheritance checks, so we need to deal with CE
types rather than just NAME types everywhere.

4 years agoMerge branch 'PHP-8.0'
Nikita Popov [Tue, 3 Nov 2020 10:51:29 +0000 (11:51 +0100)]
Merge branch 'PHP-8.0'

* PHP-8.0:
  Don't ignore internal classes during preloading

4 years agoDon't ignore internal classes during preloading
Nikita Popov [Tue, 3 Nov 2020 10:50:14 +0000 (11:50 +0100)]
Don't ignore internal classes during preloading

When preloading, it's fine to make use of internal class information,
as we do not support Windows. It is also necessary to allow proper
variance checks against internal classes.

4 years agoMerge branch 'PHP-8.0'
Nikita Popov [Tue, 3 Nov 2020 10:31:58 +0000 (11:31 +0100)]
Merge branch 'PHP-8.0'

* PHP-8.0:
  Fix persisting property info table with internal parent

4 years agoFix persisting property info table with internal parent
Nikita Popov [Tue, 3 Nov 2020 10:26:52 +0000 (11:26 +0100)]
Fix persisting property info table with internal parent

If the property info comes from an internal parent, we won't have
an xlat entry for it. Leave it alone in that case.

4 years agoMerge branch 'PHP-8.0'
Nikita Popov [Tue, 3 Nov 2020 09:57:01 +0000 (10:57 +0100)]
Merge branch 'PHP-8.0'

* PHP-8.0:
  Preserve trait method alias name during preloading

4 years agoPreserve trait method alias name during preloading
Nikita Popov [Tue, 3 Nov 2020 09:55:59 +0000 (10:55 +0100)]
Preserve trait method alias name during preloading

4 years agoModernize IMAP tests
George Peter Banyard [Tue, 3 Nov 2020 09:49:18 +0000 (09:49 +0000)]
Modernize IMAP tests

Use constants when appropriate, drop some ouputs which depends on env vars

Enable parallel testing.

Closes GH-6380

4 years agoMerge branch 'PHP-8.0'
Nikita Popov [Tue, 3 Nov 2020 09:39:33 +0000 (10:39 +0100)]
Merge branch 'PHP-8.0'

* PHP-8.0:
  Fix another implicit function declaration in configure

4 years agoMerge branch 'PHP-7.4' into PHP-8.0
Nikita Popov [Tue, 3 Nov 2020 09:39:26 +0000 (10:39 +0100)]
Merge branch 'PHP-7.4' into PHP-8.0

* PHP-7.4:
  Fix another implicit function declaration in configure

4 years agoMerge branch 'PHP-7.3' into PHP-7.4
Nikita Popov [Tue, 3 Nov 2020 09:39:13 +0000 (10:39 +0100)]
Merge branch 'PHP-7.3' into PHP-7.4

* PHP-7.3:
  Fix another implicit function declaration in configure

4 years agoFix another implicit function declaration in configure
Nikita Popov [Tue, 3 Nov 2020 09:38:16 +0000 (10:38 +0100)]
Fix another implicit function declaration in configure

As mentioned on bug #80171. This one is in libtool.m4, might get
lost on libtool updates.

4 years agoMerge branch 'PHP-8.0'
Nikita Popov [Tue, 3 Nov 2020 08:35:20 +0000 (09:35 +0100)]
Merge branch 'PHP-8.0'

* PHP-8.0:
  Fix typo in UPGRADING
  Improved error message for typed class properties with null as default value

4 years agoFix typo in UPGRADING
Chris Brown [Mon, 2 Nov 2020 17:15:04 +0000 (12:15 -0500)]
Fix typo in UPGRADING

Closes GH-6395.

4 years agoImproved error message for typed class properties with null as default value
Bogdan Ungureanu [Mon, 2 Nov 2020 22:18:12 +0000 (00:18 +0200)]
Improved error message for typed class properties with null as default value

Closes GH-6396.

4 years agoAdd test suite for ARMSCII-8 encoding
Alex Dowad [Sun, 18 Oct 2020 15:51:59 +0000 (17:51 +0200)]
Add test suite for ARMSCII-8 encoding

4 years agoFix mbstring support for ARMSCII-8
Alex Dowad [Sun, 18 Oct 2020 15:49:57 +0000 (17:49 +0200)]
Fix mbstring support for ARMSCII-8

- Identify filter was completely wrong.
- Respect `mb_substitute_character` rather than converting invalid bytes to
  Unicode 0xFFFD (generic replacement character).
- Don't convert Unicode 0xFFFD to a valid ARMSCII-8 character.
- When converting ARMSCII-8 to ARMSCII-8, don't pass invalid bytes through
  silently.

4 years agoOptimize (AND FIX) mb_check_encoding (cut execution time by 50%+)
Alex Dowad [Sat, 29 Aug 2020 17:12:28 +0000 (19:12 +0200)]
Optimize (AND FIX) mb_check_encoding (cut execution time by 50%+)

Previously, `mb_check_encoding` did an awful lot of unneeded work. In order to
determine whether a string was valid or not, it would convert the whole string
into wchar (code points), which required dynamically allocating a (potentially
large) buffer. Then it would turn right around and convert that big 'ol buffer
of code points back to the original encoding again. Finally, it would check
whether any invalid bytes were detected during that long and onerous process.

The thing is, mbstring _already_ has machinery for detecting whether a string
is valid in a certain encoding or not, and it doesn't require copying any data
around or allocating buffers. Better yet, it can fail fast when an invalid byte
is found. Why not use it? It's sure a lot faster!

Further, the legacy code was also badly broken. Why? Because aside from
checking whether illegal characters were detected, it would also check whether
the conversion to and from wchars was lossless. But, some encodings have
more than one valid encoding for the same character. In such cases, it is
not possible to make the conversion to and from wchars lossless for every
valid character. So `mb_check_encoding` would actually reject good strings
in a lot of encodings!

4 years agoAdd test suite for KOI8-U encoding
Alex Dowad [Sun, 18 Oct 2020 15:12:19 +0000 (17:12 +0200)]
Add test suite for KOI8-U encoding

4 years agoRemove dead code from mbfilter_koi8u.c (and do general code cleanup)
Alex Dowad [Sun, 18 Oct 2020 15:11:17 +0000 (17:11 +0200)]
Remove dead code from mbfilter_koi8u.c (and do general code cleanup)

4 years agoAll bytes are valid in KOI8-U encoding
Alex Dowad [Sun, 18 Oct 2020 15:10:22 +0000 (17:10 +0200)]
All bytes are valid in KOI8-U encoding

4 years agoAdd test suite for KOI8-R encoding
Alex Dowad [Sun, 18 Oct 2020 15:09:06 +0000 (17:09 +0200)]
Add test suite for KOI8-R encoding

4 years agoRemove dead code from mbfilter_iso8859_{2,4,5,9,10,13,14,15,16}.c
Alex Dowad [Sun, 18 Oct 2020 14:47:08 +0000 (16:47 +0200)]
Remove dead code from mbfilter_iso8859_{2,4,5,9,10,13,14,15,16}.c

...Plus some dead code related to ISO-8859-1.

4 years agoRemove dead code from mbfilter_koi8r.c
Alex Dowad [Sun, 18 Oct 2020 14:39:09 +0000 (16:39 +0200)]
Remove dead code from mbfilter_koi8r.c

4 years agoAll bytes are valid in KOI8-R encoding
Alex Dowad [Sun, 18 Oct 2020 14:38:27 +0000 (16:38 +0200)]
All bytes are valid in KOI8-R encoding

4 years agoAdd test suite for CP850 encoding
Alex Dowad [Sun, 18 Oct 2020 14:36:21 +0000 (16:36 +0200)]
Add test suite for CP850 encoding

4 years agoRemove dead code from mbfilter_cp850.c (and do general code cleanup)
Alex Dowad [Sun, 18 Oct 2020 14:35:20 +0000 (16:35 +0200)]
Remove dead code from mbfilter_cp850.c (and do general code cleanup)

Since there are no invalid bytes in CP850, these `if` conditions will never
be true.

4 years agoAll bytes are valid in CP850 encoding
Alex Dowad [Sun, 18 Oct 2020 14:35:00 +0000 (16:35 +0200)]
All bytes are valid in CP850 encoding

4 years agoAdd test suite for CP866 encoding
Alex Dowad [Sun, 18 Oct 2020 14:27:56 +0000 (16:27 +0200)]
Add test suite for CP866 encoding

4 years agoRemove dead code from mbfilter_cp866.c (and do general code cleanup)
Alex Dowad [Sun, 18 Oct 2020 14:26:59 +0000 (16:26 +0200)]
Remove dead code from mbfilter_cp866.c (and do general code cleanup)

Since there are no invalid bytes in CP866, these `if` conditions will never
be true.

4 years agoAll bytes are valid in CP866 encoding
Alex Dowad [Sun, 18 Oct 2020 14:25:55 +0000 (16:25 +0200)]
All bytes are valid in CP866 encoding

4 years agoAdd test suite for CP1254 encoding
Alex Dowad [Sun, 18 Oct 2020 13:23:17 +0000 (15:23 +0200)]
Add test suite for CP1254 encoding

4 years agoFix mbstring support for CP1254 encoding
Alex Dowad [Sun, 18 Oct 2020 13:30:03 +0000 (15:30 +0200)]
Fix mbstring support for CP1254 encoding

One funny thing: while the original author used Unicode 0xFFFD (generic
replacement character) for invalid bytes in CP1251 and CP1252, for CP1254
they used 0xFFFE, which is not a valid Unicode codepoint at all, but is a
reversed byte-order mark. Probably this was by mistake.

Anyways,

- Fixed identify filter, which was completely wrong.
- Don't convert Unicode 0xFFFE to a random (but valid) CP1254 byte.
- When converting CP1254 to CP1254, don't pass invalid bytes through silently.

4 years agoAdd test suite for CP1251 encoding
Alex Dowad [Sun, 18 Oct 2020 13:03:08 +0000 (15:03 +0200)]
Add test suite for CP1251 encoding

4 years agoFix mbstring support for CP1251 encoding
Alex Dowad [Sun, 18 Oct 2020 13:12:11 +0000 (15:12 +0200)]
Fix mbstring support for CP1251 encoding

- Identify filter was as wrong as wrong can be.
- Invalid CP1251 byte 0x98 was converted to Unicode 0xFFFD (generic
  replacement character), rather than respecting `mb_substitute_character`.
- Unicode 0xFFFD was converted to some random CP1251 byte.
- When converting CP1251 to CP1251, don't pass invalid bytes through silently.

4 years agoTest cases for mbstring encodings are less repetitive
Alex Dowad [Mon, 2 Nov 2020 11:11:16 +0000 (13:11 +0200)]
Test cases for mbstring encodings are less repetitive