-
Notifications
You must be signed in to change notification settings - Fork 341
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ORGU: 42501, use multi byte string when writing the path into the sto…
- Loading branch information
1 parent
cc30fba
commit 7e442e7
Showing
1 changed file
with
4 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
<?php | ||
|
||
/** | ||
* This file is part of ILIAS, a powerful learning management system | ||
* published by ILIAS open source e-Learning e.V. | ||
|
@@ -16,6 +17,8 @@ | |
******************************************************************** | ||
*/ | ||
|
||
declare(strict_types=1); | ||
|
||
/** | ||
* Class ilOrgUnitPathStorage | ||
* @author Fabian Schmid <[email protected]> | ||
|
@@ -150,7 +153,7 @@ public static function writePathByRefId(string $ref_id): void | |
$last = array_pop($path); | ||
$middle = implode(self::GLUE_SIMPLE, $path); | ||
if (strlen($middle) > self::MAX_MIDDLE_PATH_LENGTH) { | ||
$middle = substr($middle, 0, self::MAX_MIDDLE_PATH_LENGTH) . " ..."; | ||
$middle = mb_substr($middle, 0, self::MAX_MIDDLE_PATH_LENGTH) . " ..."; | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
klees
Member
|
||
} | ||
$expression = implode(self::GLUE_SIMPLE, [$first, $middle, $last]); | ||
} else { | ||
|
Maybe we should also use
mb_strlen
above.And: Is the
php-mbstring
extension obligatory when installing ILIAS? I am just not sure, so I did some checks in one of my PRs lately.