joomla / joomla-cms

Home of the Joomla! Content Management System
https://www.joomla.org
GNU General Public License v2.0
4.77k stars 3.65k forks source link

Image title with special char - Error: Maximum execution time exceeded #40242

Open fatrr opened 1 year ago

fatrr commented 1 year ago

Steps to reproduce the issue

  1. install a new Joomla 4.2.9 stable
  2. create a new user and assign an "Administrator" User Group (it must be different from "Super Users").
  3. open an article or create e new one (or Custom module)
  4. click to "CMS contet > Media" to insert an image.
  5. right click on image and put a spechal char to "Image title" field (for example "à")
  6. Save the article

Expected result

Save the article/module

Actual result

Fatal error: Maximum execution time of 30 seconds exceeded in /joomla-root/libraries/vendor/joomla/string/src/phputf8/mbstring/core.php on line 96

function utf8_substr($str, $offset, $length = FALSE){ if ( $length === FALSE ) { return mb_substr($str, $offset); } else { return mb_substr($str, $offset, $length); } }

System information (as much as possible)

Joomla 4.2.9 stable php 8.1.13

brianteeman commented 1 year ago

Assuming that I understand this vbug report correctly then I cannot replicate it. Including a video so you can check I followed the instructions correctly

https://user-images.githubusercontent.com/1296369/230641427-3474d2f7-08f8-4c6b-a62c-ef902609e6b2.mp4

fatrr commented 1 year ago

@brianteeman thanks for trying to reproduce the bug. The steps are correct but I can not understand from your video if the your user is assigned to the Administrator user group or to Super User. It must be different from Super User to reproduce the bug. (step 2).

brianteeman commented 1 year ago

the user is in the manager user group in my video

fatrr commented 1 year ago

Ok. Please try to reproduce the steps with a user that is assignet only to Administrator user group. In my case I can reproduce the bug.

immagine

Thanks

brianteeman commented 1 year ago

still can not replicate

chmst commented 1 year ago

I cannot replicate the error, tried also frontend. I think that it is related to your system environment. @fatrr can you replcate the error on a live site (in a subdomain)?

fatrr commented 1 year ago

@brianteeman I just tryed with a new installation with softaculous in a shared hosting and I can reproduce the bug. try from here: https://tobestack.it/administrator/index.php user: bugtest psw: 3QR6WA3YfYUp92g

It will ask to change the password. I don't have nothing there, only a new joomla installation and I will delete every thing when you finish to test.

brianteeman commented 1 year ago

the good news is that I have seen it happen on your site AND I have now replicated it on my site.

brianteeman commented 1 year ago

the problem is coming from the joomla text filters - will investigate further in the morning

brianteeman commented 1 year ago

The easiest way to test this is in global configuration go to the text filters tab and change the value for super users from "no filtering" to "default filtering" and then it will error everytime you put an accented character in the tinymce image title input and try to save the articke.

If you change the setting in the tinymce plugin for "enity encoding" to use named instead of raw then that fixes the problem without having to turn off the joomla text filters.

ahotzler commented 1 year ago

A customer also has the problem, he uses the JCE and when saving articles with imagesm with umlauts, the above error appears.

Part 1 of Brian's solution works (text filter), part2 does not, then the JCE mangles the filenames in the source code.

brianteeman commented 1 year ago

As JCE completely replaces core functionality for handling images you should raise that issue with them.

ahotzler commented 1 year ago

If the JCE would write past the Joomla core into the database, should the error shown here come?

Is this not rather an error in a routine that is used in the Joomla! core after the editor (whichever one) has done its job of generating code?

[18-May-2023 00:22:06 Europe/Berlin] PHP Fatal error: Maximum execution time of xxx seconds exceeded in /var/www/xxx/htdocs/libraries/vendor/joomla/string/src/phputf8/mbstring/core.php on line 43

filipe-torres commented 1 year ago

The easiest way to test this is in global configuration go to the text filters tab and change the value for super users from "no filtering" to "default filtering" and then it will error everytime you put an accented character in the tinymce image title input and try to save the articke.

If you change the setting in the tinymce plugin for "enity encoding" to use named instead of raw then that fixes the problem without having to turn off the joomla text filters.

Hi Brian, I tested these configurations on a Joomla site (version 4.3.1 and PHP 7.4) and doesn't work. Using TinyMCE editor on administrator area, when saving a Custom HTML module or article, a similar error also occurs: when trying to use accented characters on link title:

Fatal error: Maximum execution time of 30 seconds exceeded in
/home/creativa/public_html/libraries/vendor/joomla/string/src/phputf8/mbstring/core.php on line 43

Symfony\Component\ErrorHandler\Error\FatalError:
Error: Maximum execution time of 30 seconds exceeded

at /home/creativa/public_html/libraries/vendor/joomla/string/src/phputf8/mbstring/core.php:43

Joomla 4.3.1 PHP 7.4