Skip to content

Commit

Permalink
perbaikan tidak bisa akses modul info-sistem (#891)
Browse files Browse the repository at this point in the history
  • Loading branch information
yogiperdana authored Oct 9, 2023
1 parent eef2a17 commit df0d552
Show file tree
Hide file tree
Showing 2 changed files with 62 additions and 88 deletions.
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>

0 comments on commit df0d552

Please sign in to comment.