Fixed display
authorSascha Greuel <SoftCreatR@users.noreply.github.com>
Tue, 27 May 2014 17:21:44 +0000 (19:21 +0200)
committerSascha Greuel <SoftCreatR@users.noreply.github.com>
Tue, 27 May 2014 17:21:44 +0000 (19:21 +0200)
Since wordwrapping isn't possible for disable_functions and disable_classes, it produces an oneliner, which may break the whole layout.

wcfsetup/install/files/lib/acp/page/PHPInfoPage.class.php

index 0ad48542d7612c463235f2a879ebaa9f856a18a9..abbc594b0e505bbee43e1a18b06c7479b2ae526d 100644 (file)
@@ -48,6 +48,15 @@ class PHPInfoPage extends AbstractPage {
                $info = preg_replace('%<table border="0" cellpadding="3" width="600">%', '<div class="tabularBox marginTop"><table class="table">', $info);
                $info = str_replace('</table>', '</table></div>', $info);
                
+               // fix display of disable_functions & disable_classes
+               $info = preg_replace_callback('%<td class="e">disable_(?P<t>functions|classes)</td><td class="v">(?P<l>.*?)</td><td class="v">(?P<m>.*?)</td>%s', function ($match) {
+                       $ret = '<td class="e">disable_' . $match['t'] . '</td>';
+                       $ret .= '<td class="v">' . str_replace(' ', ', ', rtrim(wordwrap(str_replace(',', ' ', $match['l'])))) . '</td>';
+                       $ret .= '<td class="v">' . str_replace(' ', ', ', rtrim(wordwrap(str_replace(',', ' ', $match['m'])))) . '</td>';
+                       
+                       return $ret;
+               }, $info);
+               
                WCF::getTPL()->assign(array(
                        'phpInfo' => $info
                ));