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

Perbaiki halaman info sisten tidak bisa dibuka #891

Merged
merged 10 commits into from
Oct 9, 2023
Merged
Show file tree
Hide file tree
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
2 changes: 2 additions & 0 deletions catatan_rilis.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ Terima kasih pada totoprayogo1916 yang terus berkontribusi.
2. [#847](https://github.com/OpenSID/OpenDK/issues/847) Perbaikan validasi pengecekan ganti password default.
3. [#881](https://github.com/OpenSID/OpenDK/issues/881) Perbaikan CSP untuk tinymce dan filemanager.
4. [#892](https://github.com/OpenSID/OpenDK/issues/892) Perbaikan tidak bisa akses data pantau pada mode produksi.
5. [#890](https://github.com/OpenSID/OpenDK/issues/890) Perbaikan tidak bisa akses modul info-sistem.


#### Penyesuaian Teknis

Expand Down
148 changes: 60 additions & 88 deletions resources/views/vendor/laravel-log-viewer/info-sistem.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,103 +2,75 @@
<div class="col-md-12">
<div class="box box-info">
<div class="box-body">
<?php
$entitiesToUtf8 = function($input) {
@php
$entitiesToUtf8 = function ($input) {
// http://php.net/manual/en/function.html-entity-decode.php#104617
return preg_replace_callback("/(&#[0-9]+;)/", function($m) { return mb_convert_encoding($m[1], "UTF-8", "HTML-ENTITIES"); }, $input);
return preg_replace_callback(
'/(&#[0-9]+;)/',
function ($m) {
return mb_convert_encoding($m[1], 'UTF-8', 'HTML-ENTITIES');
},
$input,
);
};
$plainText = function($input) use ($entitiesToUtf8) {
$plainText = function ($input) use ($entitiesToUtf8) {
return trim(html_entity_decode($entitiesToUtf8(strip_tags($input))));
};
$titlePlainText = function($input) use ($plainText) {
return '# '.$plainText($input);
$titlePlainText = function ($input) use ($plainText) {
return '# ' . $plainText($input);
};

ob_start();
phpinfo(-1);

$phpinfo = array('phpinfo' => array());

$phpinfo = ['phpinfo' => []];

// Strip everything after the <h1>Configuration</h1> tag (other h1's)
if (!preg_match('#(.*<h1[^>]*>\s*Configuration.*)<h1#s', ob_get_clean(), $matches)) {
return [];
}

// Strip everything after the <h1>Configuration</h1> tag (other h1's)
if (!preg_match('#(.*<h1[^>]*>\s*Configuration.*)<h1#s', ob_get_clean(), $matches)) {
return array();
}

$input = $matches[1];
$matches = array();
$input = $matches[1];
$matches = [];

if(preg_match_all(
'#(?:<h2.*?>(?:<a.*?>)?(.*?)(?:<\ /a>)?<\ /h2>)|'.
'(?:<tr.*?>
<t[hd].*?>(.*?)\s*</t[hd]>(?:<t[hd].*?>(.*?)\s*</t[hd]>(?:<t[hd].*?>(.*?)\s*</t[hd]>)?)?</tr>)#s',
$input,
$matches,
PREG_SET_ORDER
)) {
foreach ($matches as $match) {
$fn = strpos($match[0], '<th')===false
?
$plainText
:
$titlePlainText;
if
(strlen($match[1]))
{
$phpinfo[$match[1]]=array();
}
elseif
(isset($match[3]))
{
$keys1=array_keys($phpinfo);
$phpinfo[end($keys1)][$fn($match[2])]=isset($match[4])
?
array($fn($match[3]),
$fn($match[4]))
:
$fn($match[3]);
}
else
{
$keys1=array_keys($phpinfo);
$phpinfo[end($keys1)][]=$fn($match[2]);
}
}
}
?
>
<?php $i = 0; ?>
<?php foreach ($phpinfo as $name => $section): ?>
<?php $i++; ?>
<?php if ($i==1): ?>
<div class='table-responsive'>
<table class='table table-bordered dataTable table-hover'>
<?php else: ?>
<h3><?= $name ?></h3>
<div class='table-responsive'>
<table class='table table-bordered dataTable table-hover'>
<?php endif ?>
<?php foreach ($section as $key => $val): ?>
<?php if (is_array($val)): ?>
<tr>
<td class="col-md-4 info"><?= $key ?></td>
<td><?= $val[0] ?></td>
<td><?= $val[1] ?></td>
</tr>
<?php elseif (is_string($key)): ?>
<tr>
<td class="col-md-4 info"><?= $key ?></td>
<td colspan='2'><?= $val ?></td>
</tr>
<?php else: ?>
<tr>
<td class="btn-primary" colspan='3'><?= $val ?></td>
</tr>
<?php endif; ?>
<?php endforeach;?>
</table>
</div>
<?php endforeach;?>
</div>
if (preg_match_all('#(?:<h2.*@endphp(?:<a.*?>)?(.*?)(?:<\/a>)?<\/h2>)|' . '(?:<tr.*?><t[hd].*?>(.*?)\s*</t[hd]>(?:<t[hd].*?>(.*?)\s*</t[hd]>(?:<t[hd].*?>(.*?)\s*</t[hd]>)?)?</tr>)#s', $input, $matches, PREG_SET_ORDER)) {
foreach ($matches as $match) {
$fn = strpos($match[0], '<th') === false ? $plainText : $titlePlainText;
if (strlen($match[1])) {
$phpinfo[$match[1]] = [];
} elseif (isset($match[3])) {
$keys1 = array_keys($phpinfo);
$phpinfo[end($keys1)][$fn($match[2])] = isset($match[4]) ? [$fn($match[3]), $fn($match[4])] : $fn($match[3]);
} else {
$keys1 = array_keys($phpinfo);
$phpinfo[end($keys1)][] = $fn($match[2]);
}
}
}
?>
@php $i = 0; @endphp
@foreach ($phpinfo as $name => $section)
@php $i++; @endphp
@if ($i == 1)
<div class='table-responsive'>
<table class='table table-bordered dataTable table-hover'>
@else
<h3>{{ $name }}</h3>
<div class='table-responsive'>
<table class='table table-bordered dataTable table-hover'>
@endif
@foreach ($section as $key => $val)
@if (is_array($val))
<tr><td class="col-md-4 info">{{ $key }}</td><td>{{ $val[0] }}</td><td>{{ $val[1] }}</td></tr>
@elseif (is_string($key))
<tr><td class="col-md-4 info">{{ $key }}</td><td colspan='2'>{{ $val }}</td></tr>
@else
<tr><td class="btn-primary" colspan='3'>{{ $val }}</td></tr>
@endif @endforeach
</table>
</div>
@endforeach
</div>
</div>
</div>
</div>