1
0

Code cleanup

This commit is contained in:
Mike Schwörer 2022-10-16 15:50:38 +02:00
parent 31c0bda8cb
commit cb22029f7e
Signed by: Mikescher
GPG Key ID: D3C7172E0A70F8CF
8 changed files with 26 additions and 25 deletions

View File

@ -7,6 +7,7 @@
</Languages>
</inspection_tool>
<inspection_tool class="HtmlUnknownTarget" enabled="true" level="INFORMATION" enabled_by_default="true" />
<inspection_tool class="PhpIllegalPsrClassPathInspection" enabled="false" level="WARNING" enabled_by_default="false" />
<inspection_tool class="PhpUnhandledExceptionInspection" enabled="true" level="INFORMATION" enabled_by_default="true" />
<inspection_tool class="SpellCheckingInspection" enabled="false" level="TYPO" enabled_by_default="false">
<option name="processCode" value="true" />

View File

@ -1,4 +1,4 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="PhpProjectSharedConfiguration" php_language_level="7.2" />
<component name="PhpProjectSharedConfiguration" php_language_level="8.1" />
</project>

View File

@ -25,10 +25,10 @@ $std = shell_exec("ncc_upload " . '"' . $tmppath . '" "' . $reltarget . '" 2>&1'
fclose($fp);
$content = "REQUEST: " . $uri . "\r\n\r\n" .
"IP: " . get_client_ip() . "\r\n\r\n" .
"TARGET: " . $reltarget . "\r\n\r\n" .
"OUTPUT: " . $std . "\r\n\r\n";
$content = "REQUEST: " . $uri . "\n\n" .
"IP: " . get_client_ip() . "\n\n" .
"TARGET: " . $reltarget . "\n\n" .
"OUTPUT: " . $std . "\n\n";
sendMail("Fileupload to '$folder' triggered", $content, 'virtualadmin@mikescher.de', 'webserver-info@mikescher.com');

View File

@ -25,10 +25,10 @@ else
$std = shell_exec($cmd);
$content = "REQUEST: " . $uri . "\r\n\r\n" .
"IP: " . get_client_ip() . "\r\n\r\n" .
"TARGET: " . $hook . "\r\n\r\n" .
"OUTPUT: " . $std . "\r\n\r\n";
$content = "REQUEST: " . $uri . "\n\n" .
"IP: " . get_client_ip() . "\n\n" .
"TARGET: " . $hook . "\n\n" .
"OUTPUT: " . $std . "\n\n";
sendMail("Webhook '$hook' triggered", $content, 'virtualadmin@mikescher.de', 'webserver-info@mikescher.com');

View File

@ -5,7 +5,7 @@ function queryStatus(appendix, secret)
success: function(result)
{
let ajaxOutput = $('#egg_ajaxOutput');
ajaxOutput.val(result + '\r\n' + appendix);
ajaxOutput.val(result + '\n' + appendix);
ajaxOutput.scrollTop(ajaxOutput[0].scrollHeight);
},
async: true
@ -27,7 +27,7 @@ function startAjaxRefresh(secret)
error: function( jqXHR, textStatus, errorThrown)
{
clearInterval(val);
queryStatus('AN ERROR OCCURED:' + '\r\n' + textStatus, secret);
queryStatus('AN ERROR OCCURED:' + '\n' + textStatus, secret);
},
async: true
});
@ -48,7 +48,7 @@ function startAjaxRedraw(secret)
error: function( jqXHR, textStatus, errorThrown)
{
clearInterval(val);
queryStatus('AN ERROR OCCURED:' + '\r\n' + textStatus, secret);
queryStatus('AN ERROR OCCURED:' + '\n' + textStatus, secret);
},
async: true
});

View File

@ -84,7 +84,7 @@ class SessionLogger implements ILogger
{
if (session_status() === PHP_SESSION_DISABLED) return;
$_SESSION[$this->sessionvar] .= $text . "\r\n";
$_SESSION[$this->sessionvar] .= $text . "\n";
session_commit();
}
}
@ -96,7 +96,7 @@ class OutputLogger implements ILogger
if ($text !== '') $text = '[' . date('H:i:s') . '] ' . $text;
print $text;
print "\r\n";
print "\n";
}
}

View File

@ -88,27 +88,27 @@ $problems = $SITE->modules->Euler()->listAll();
<?php
foreach ($problems as $problem)
{
echo '<tr class="PEB_tablerowProblems">' . "\r\n";
echo '<tr class="PEB_tablerowProblems">' . "\n";
echo '<td class="PEB_tablecellProblems PEB_TC_Number">';
echo '<a href="' . $problem['url'] . '">';
echo $problem['number'];
echo '</a>';
echo '</td>' . "\r\n";
echo '</td>' . "\n";
echo '<td class="PEB_tablecellProblems PEB_TC_Title">';
echo '<a href="' . $problem['url'] . '">';
echo htmlspecialchars($problem['title']);
echo '</a>';
echo '</td>' . "\r\n";
echo '</td>' . "\n";
echo '<td class="PEB_tablecellProblems PEB_TC_Rating">';
echo '<a href="' . $problem['url'] . '">';
echo '<div class="PEB_TC_Time PEB_TC_Timelevel_' . $problem['rating'] . '">';
echo formatMilliseconds($problem['time']) . "</div></td>\r\n";
echo formatMilliseconds($problem['time']) . "</div></td>\n";
echo '</div>';
echo '</a>';
echo '</td>' . "\r\n";
echo '</td>' . "\n";
echo '<td class="PEB_tablecellProblems PEB_TC_Size">';
echo '<a href="' . $problem['url'] . '">';
@ -117,13 +117,13 @@ $problems = $SITE->modules->Euler()->listAll();
echo ($problem['is93'] ? 'Bef-93' : 'Bef-93+');
echo '</div>';
echo '</a>';
echo '</td>' . "\r\n";
echo '</td>' . "\n";
echo '<td class="PEB_tablecellProblems PEB_TC_Value">';
echo number_format($problem['value'], 0, null, ',');
echo '</td>' . "\r\n";
echo '</td>' . "\n";
echo "</tr>\r\n";
echo "</tr>\n";
}
?>
</tbody>

View File

@ -102,9 +102,9 @@ try
catch (exception $e)
{
$content =
"REQUEST: " . var_export($_REQUEST) . "\r\n\r\n" .
"IP: " . get_client_ip() . "\r\n\r\n" .
"ERROR: " . $e . "\r\n\r\n";
"REQUEST: " . var_export($_REQUEST) . "\n\n" .
"IP: " . get_client_ip() . "\n\n" .
"ERROR: " . $e . "\n\n";
if ($SITE->isProd()) sendMail("Website API call failed", $content, 'virtualadmin@mikescher.de', 'webserver-info@mikescher.com');