Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[RTM] Fix incompatibilities with PCRE 8.32 in the BackportedTranslator class #10

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions src/BackportedTranslator.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
* @package contao-community-alliance/translator
* @author Christian Schiffler <[email protected]>
* @author Sven Baumann <[email protected]>
* @author Philipp Lorenz <[email protected]>
* @copyright 2013-2018 Contao Community Alliance.
* @license https://github.com/contao-community-alliance/translator/blob/master/LICENSE LGPL-3.0
* @filesource
Expand Down Expand Up @@ -125,8 +126,8 @@ public function getLocale()
private function getFromGlobals($id)
{
// Split the ID into chunks allowing escaped dots (\.) and backslashes (\\)
preg_match_all('/(?:\\\\[.\\\\]|[^.])++/s', $id, $matches);
$parts = preg_replace('/\\\\([.\\\\])/s', '$1', $matches[0]);
preg_match_all('/(?:\\\\[\\\\.]|[^.])++/', $id, $matches);
$parts = preg_replace('/\\\\([\\\\.])/', '$1', $matches[0]);
$item = &$GLOBALS['TL_LANG'];
foreach ($parts as $part) {
if (!isset($item[$part])) {
Expand Down