Skip to content

Conversation

vannidellaricca
Copy link

@vannidellaricca vannidellaricca commented Mar 24, 2025

Hi,
we found an rare case in which library return an invalid url.
some preconditions:

  • php engine jail in chrooted mode ( or DocumentRoot is in root filesystem).
  • base root have the same name of domain
    which this condition in file Config.php on method get_url the function str_replace trigger the transformation many time for the string.
    this is te our test env

wp_list_pluck( $bases, 'base_dir' ) return

Array
(
    [wpmu_plugin] => /miodominiouno.it/ita/wp-content/mu-plugins
    [wp_plugin] => /miodominiouno.it/ita/wp-content/plugins
    [wp_content] => /miodominiouno.it/ita/wp-content
    [plugins] => /miodominiouno.it/ita/wp-content/plugins
    [stylesheet] => /miodominiouno.it/ita/wp-content/themes/twentytwentyfive
))

wp_list_pluck( $bases, 'base_url' ) return

Array
(
    [wpmu_plugin] => http://miodominiouno.it/ita/wp-content/mu-plugins
    [wp_plugin] => http://miodominiouno.it/ita/wp-content/plugins
    [wp_content] => http://miodominiouno.it/ita/wp-content
    [plugins] => http://miodominiouno.it/ita/wp-content/plugins
    [stylesheet] => http://miodominiouno.it/ita/wp-content/themes/twentytwentyfive
)

the transformation return
http:/http:/http://miodominiouno.it/ita/wp-content/plugins/the-events-calendar/common/

we have made a test using strtr that perform only one substitution and the code works.

We attach a 1 line patch

@dpanta94 dpanta94 self-requested a review March 24, 2025 12:10
@bordoni
Copy link
Member

bordoni commented Mar 31, 2025

@vannidellaricca thank you for this PR.

I would love to see us have a Test set for this @dpanta94 before we merge.

Not 100% a priority but worth the time after we finish Tyson.

@dpanta94 dpanta94 self-assigned this Apr 9, 2025
@vannidellaricca
Copy link
Author

Hi,
any time for this task.. we need to patch manually the events calendar and event ticket at every update.
Do you prefer that an issue be opened for you?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants