Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: PHP Deprecated:Function utf8_encode() #43602

Closed
5 of 8 tasks
isdnfan opened this issue Feb 15, 2024 · 3 comments · Fixed by #43637
Closed
5 of 8 tasks

[Bug]: PHP Deprecated:Function utf8_encode() #43602

isdnfan opened this issue Feb 15, 2024 · 3 comments · Fixed by #43637
Labels
0. Needs triage Pending check for reproducibility or if it fits our roadmap 28-feedback bug

Comments

@isdnfan
Copy link

isdnfan commented Feb 15, 2024

⚠️ This issue respects the following points: ⚠️

Bug description

after local external storage and system completed scanning the mount I found following logs when files with international characters are scanned (using occ files:scan):

PHP Deprecated:  Function utf8_encode() is deprecated in /var/www/html/lib/private/Log/LogDetails.php on line 109

according to https://wiki.php.net/rfc/remove_utf8_decode_and_utf8_encode functions utf8_encode() and utf8_decode() can produce unintended results and deprecated for this reason. multiple ways to replace the function are described in the article.

code search shows utf8_encode() is used only once:

$entry[$key] = utf8_encode($value);

would be great deprecated function is replaced timely.

Steps to reproduce

  1. add local external storage with files names including international character e.g. éèáã etc.. some of my real life examples:
  • Entry ".../Верн Жюль - Двадцать тысяч лье под водой" will not be accessible due to incompatible encoding
  • Entry ".../Perry Rhodan, komplett/[heft] Perry Rhodan 2605 - Die Planetenbrücke.epub" will not be accessible due to incompatible encoding
  • Entry ".../John Sinclair, Heftfolgen/[heft] Dark, Jason - John Sinclair 0238 - Belphégors Rueckkehr (2 of 3).epub" will not be accessible due to incompatible encoding
  1. scan the storage using occ files:scan
  2. see an issue

Expected behavior

no deperecation notice (and ideally files successfully added to system)

Installation method

Community Docker image

Nextcloud Server version

28

Operating system

Debian/Ubuntu

PHP engine version

PHP 8.2

Web server

Apache (supported)

Database engine version

MariaDB

Is this bug present after an update or on a fresh install?

None

Are you using the Nextcloud Server Encryption module?

None

What user-backends are you using?

  • Default user-backend (database)
  • LDAP/ Active Directory
  • SSO - SAML
  • Other

Configuration report

No response

List of activated Apps

No response

Nextcloud Signing status

No response

Nextcloud Logs

No response

Additional info

No response

@isdnfan isdnfan added 0. Needs triage Pending check for reproducibility or if it fits our roadmap bug labels Feb 15, 2024
@igefa-awelzel
Copy link

In addition: the deprecation started with PHP 8.2. Also see https://www.php.net/manual/en/function.utf8-encode.php

There are also hints how to replace it here: https://php.watch/versions/8.2/utf8_encode-utf8_decode-deprecated

@solracsf
Copy link
Member

Feel free to try #43637

@isdnfan
Copy link
Author

isdnfan commented Feb 19, 2024

worked like a charm, no more deprecated logs :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
0. Needs triage Pending check for reproducibility or if it fits our roadmap 28-feedback bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants