mirror of
https://github.com/nextcloud/server.git
synced 2026-02-19 02:38:40 -05:00
fix: Prevent duplicate creation of print_exception function
Signed-off-by: Louis Chemineau <louis@chmn.me>
This commit is contained in:
parent
b124f19777
commit
4e75a3c55c
4 changed files with 39 additions and 23 deletions
|
|
@ -9,20 +9,7 @@
|
|||
|
||||
style('core', ['styles', 'header', 'exception']);
|
||||
|
||||
function print_exception(Throwable $e, \OCP\IL10N $l): void {
|
||||
print_unescaped('<pre>');
|
||||
p($e->getTraceAsString());
|
||||
print_unescaped('</pre>');
|
||||
|
||||
if ($e->getPrevious() !== null) {
|
||||
print_unescaped('<br />');
|
||||
print_unescaped('<h4>');
|
||||
p($l->t('Previous'));
|
||||
print_unescaped('</h4>');
|
||||
|
||||
print_exception($e->getPrevious(), $l);
|
||||
}
|
||||
}
|
||||
require_once __DIR__ . '/print_exception.php';
|
||||
|
||||
?>
|
||||
<div class="guest-box wide">
|
||||
|
|
|
|||
21
core/templates/print_exception.php
Normal file
21
core/templates/print_exception.php
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
<?php
|
||||
/**
|
||||
* SPDX-FileCopyrightText: 2016-2024 Nextcloud GmbH and Nextcloud contributors
|
||||
* SPDX-FileCopyrightText: 2012-2015 ownCloud, Inc.
|
||||
* SPDX-License-Identifier: AGPL-3.0-only
|
||||
*/
|
||||
|
||||
function print_exception(Throwable $e, \OCP\IL10N $l): void {
|
||||
print_unescaped('<pre>');
|
||||
p($e->getTraceAsString());
|
||||
print_unescaped('</pre>');
|
||||
|
||||
if ($e->getPrevious() !== null) {
|
||||
print_unescaped('<br />');
|
||||
print_unescaped('<h4>');
|
||||
p($l->t('Previous'));
|
||||
print_unescaped('</h4>');
|
||||
|
||||
print_exception($e->getPrevious(), $l);
|
||||
}
|
||||
}
|
||||
16
core/templates/print_xml_exception.php
Normal file
16
core/templates/print_xml_exception.php
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
<?php
|
||||
/**
|
||||
* SPDX-FileCopyrightText: 2016-2024 Nextcloud GmbH and Nextcloud contributors
|
||||
* SPDX-FileCopyrightText: 2012-2015 ownCloud, Inc.
|
||||
* SPDX-License-Identifier: AGPL-3.0-only
|
||||
*/
|
||||
|
||||
function print_exception(Throwable $e, \OCP\IL10N $l): void {
|
||||
p($e->getTraceAsString());
|
||||
|
||||
if ($e->getPrevious() !== null) {
|
||||
print_unescaped('<s:previous-exception>');
|
||||
print_exception($e->getPrevious(), $l);
|
||||
print_unescaped('</s:previous-exception>');
|
||||
}
|
||||
}
|
||||
|
|
@ -5,15 +5,7 @@
|
|||
* SPDX-License-Identifier: AGPL-3.0-only
|
||||
*/
|
||||
|
||||
function print_exception(Throwable $e, \OCP\IL10N $l): void {
|
||||
p($e->getTraceAsString());
|
||||
|
||||
if ($e->getPrevious() !== null) {
|
||||
print_unescaped('<s:previous-exception>');
|
||||
print_exception($e->getPrevious(), $l);
|
||||
print_unescaped('</s:previous-exception>');
|
||||
}
|
||||
}
|
||||
require_once __DIR__ . '/print_xml_exception.php';
|
||||
|
||||
print_unescaped('<?xml version="1.0" encoding="utf-8"?>' . "\n");
|
||||
?>
|
||||
|
|
|
|||
Loading…
Reference in a new issue