From b344e40acc535250f3a5901e5665d2ddaee065d6 Mon Sep 17 00:00:00 2001 From: Lukas Reschke Date: Sun, 26 Jul 2015 22:56:16 +0200 Subject: [PATCH] Allow classes in

tags Previously something like `

t('Some title')) ?>

` was shown as `

Some title` within the sidebar instead as `Some Title` due to the fact that the regex was catching these classes but was not properly running the string replace function. --- settings/admin.php | 4 ++-- settings/personal.php | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/settings/admin.php b/settings/admin.php index 533b615249..551608b5d2 100644 --- a/settings/admin.php +++ b/settings/admin.php @@ -197,8 +197,8 @@ if (\OC::$server->getLockingProvider() instanceof NoopLockingProvider) { } $formsMap = array_map(function ($form) { - if (preg_match('%(]*>.*?

)%i', $form, $regs)) { - $sectionName = str_replace('

', '', $regs[0]); + if (preg_match('%([^>]*)>.*?

)%i', $form, $regs)) { + $sectionName = str_replace('', '', $regs[0]); $sectionName = str_replace('', '', $sectionName); $anchor = strtolower($sectionName); $anchor = str_replace(' ', '-', $anchor); diff --git a/settings/personal.php b/settings/personal.php index f4409e633c..8823102e01 100644 --- a/settings/personal.php +++ b/settings/personal.php @@ -137,8 +137,8 @@ $formsAndMore[]= ['anchor' => 'passwordform', 'section-name' => $l->t('Personal $forms=OC_App::getForms('personal'); $formsMap = array_map(function($form){ - if (preg_match('%(]*>.*?)%i', $form, $regs)) { - $sectionName = str_replace('

', '', $regs[0]); + if (preg_match('%([^>]*)>.*?

)%i', $form, $regs)) { + $sectionName = str_replace('', '', $regs[0]); $sectionName = str_replace('', '', $sectionName); $anchor = strtolower($sectionName); $anchor = str_replace(' ', '-', $anchor);