diff options
author | Lukas Reschke <lukas@owncloud.com> | 2015-07-26 22:56:16 +0200 |
---|---|---|
committer | Lukas Reschke <lukas@owncloud.com> | 2015-07-26 23:00:50 +0200 |
commit | b344e40acc535250f3a5901e5665d2ddaee065d6 (patch) | |
tree | 3bda8b376807f03202126a8d2767c044afdb6812 /settings/personal.php | |
parent | 5b21ed805ce0525f24ffffd173f1f465cd6b13aa (diff) | |
download | nextcloud-server-b344e40acc535250f3a5901e5665d2ddaee065d6.tar.gz nextcloud-server-b344e40acc535250f3a5901e5665d2ddaee065d6.zip |
Allow classes in <h2> tags
Previously something like `<h2 class="inlineblock"><?php p($l->t('Some title')) ?></h2>` was shown as `<h2 class="inlineblock">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.
Diffstat (limited to 'settings/personal.php')
-rw-r--r-- | settings/personal.php | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/settings/personal.php b/settings/personal.php index f4409e633cf..8823102e01a 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('%(<h2[^>]*>.*?</h2>)%i', $form, $regs)) { - $sectionName = str_replace('<h2>', '', $regs[0]); + if (preg_match('%(<h2(?P<class>[^>]*)>.*?</h2>)%i', $form, $regs)) { + $sectionName = str_replace('<h2'.$regs['class'].'>', '', $regs[0]); $sectionName = str_replace('</h2>', '', $sectionName); $anchor = strtolower($sectionName); $anchor = str_replace(' ', '-', $anchor); |