mirror of
https://github.com/friendica/friendica
synced 2025-05-08 03:44:10 +02:00
Sanitize addon path items
This commit is contained in:
parent
b529c03a20
commit
cc64471e4c
3 changed files with 33 additions and 22 deletions
|
@ -6,6 +6,7 @@ namespace Friendica\Core;
|
|||
|
||||
use Friendica\BaseObject;
|
||||
use Friendica\Database\DBA;
|
||||
use Friendica\Util\Strings;
|
||||
|
||||
/**
|
||||
* Provide Language, Translation, and Localization functions to the application
|
||||
|
@ -193,6 +194,8 @@ class L10n extends BaseObject
|
|||
*/
|
||||
private static function loadTranslationTable($lang)
|
||||
{
|
||||
$lang = Strings::sanitizeFilePathItem($lang);
|
||||
|
||||
if ($lang === self::$lang) {
|
||||
return;
|
||||
}
|
||||
|
@ -203,7 +206,7 @@ class L10n extends BaseObject
|
|||
// load enabled addons strings
|
||||
$addons = DBA::select('addon', ['name'], ['installed' => true]);
|
||||
while ($p = DBA::fetch($addons)) {
|
||||
$name = $p['name'];
|
||||
$name = Strings::sanitizeFilePathItem($p['name']);
|
||||
if (file_exists("addon/$name/lang/$lang/strings.php")) {
|
||||
include "addon/$name/lang/$lang/strings.php";
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue