Home›Support›English Support›[Waiting for user confirmation] str_replace function in LoadTextDomain::fallbackDefaultTranslations causes warnings
[Waiting for user confirmation] str_replace function in LoadTextDomain::fallbackDefaultTranslations causes warnings
This is the technical support forum for WPML - the multilingual WordPress plugin.
Everyone can read, but only WPML clients can post here. WPML team is replying on the forum 6 days per week, 22 hours per day.
Elementor users - please update WPML to the latest version to maintain compatibility. More details here - https://wpml.org/changelog/2024/12/wpml-4-6-15-critical-update-for-elementor-sites/
Background of the issue:
I recently updated the WPML String Translation plugin to version 3.2.16, and then to 3.2.17. I looked on that line in code and I saw that you're replacing the "mo" in file path with "l10n.php".
.
However, this causes not only the .mo extension at the end of file, but also the "mo" in "modemtec" (name of website) to be replaced, leading in invalid path (www.l10n.phpdemtec.com) and warnings.
For me, this works
(replacing .mo at end of the file path) – note that using only .mo in str_replace wouldn't work, as in my path, I have ".mo"demtec.com.
Symptoms:
Warning: file_exists(): open_basedir restriction in effect. File(/www/doc/www.l10n.phpdemtec.com/www/wp-content/plugins/post-carousel/languages/post-carousel-en_US.l10n.php) is not within the allowed path(s): (https://cdn.wpml.org/www/doc/www.modemtec.com) in /www/doc/www.modemtec.com/www/wp-content/plugins/wpml-string-translation/classes/MO/Hooks/LoadTextDomain.php on line 173.
Questions:
Could you fix the str_replace function in your WPML String Translation plugin, so it won't cause the warnings anymore?