Find this useful? Enter your email to receive occasional updates for securing PHP code.
Signing you up...
Thank you for signing up!
PHP Decode
<?php namespace Widget\Metas\Category; use Typecho\Common; use Typecho\Db; use Typecho\W..
Decoded Output download
<?php
namespace Widget\Metas\Category;
use Typecho\Common;
use Typecho\Db;
use Typecho\Widget\Exception;
use Widget\Base\Metas;
use Widget\Base\TreeTrait;
if (!defined('__TYPECHO_ROOT_DIR__')) {
exit;
}
/**
* Category Admin
*/
class Admin extends Metas
{
use InitTreeRowsTrait;
use TreeTrait;
/**
* @var int Parent category
*/
private int $parentId = 0;
/**
*
*/
public function execute()
{
$this->parentId = $this->request->filter('int')->get('parent', 0);
$this->pushAll($this->getRows($this->getChildIds($this->parentId)));
}
/**
*
*
* @throws Db\Exception
*/
public function backLink()
{
if ($this->parentId) {
$category = $this->getRow($this->parentId);
if (!empty($category)) {
$parent = $this->getRow($category['parent']);
if ($parent) {
echo '<a href="'
. Common::url('manage-categories.php?parent=' . $parent['mid'], $this->options->adminUrl)
. '">';
} else {
echo '<a href="' . Common::url('manage-categories.php', $this->options->adminUrl) . '">';
}
echo '« ';
_e('');
echo '</a>';
}
}
}
/**
*
*
* @return string|null
* @throws Db\Exception|Exception
*/
public function getMenuTitle(): ?string
{
if ($this->parentId) {
$category = $this->getRow($this->parentId);
if (!empty($category)) {
return _t(' %s ', $category['name']);
}
} else {
return null;
}
throw new Exception(_t(''), 404);
}
/**
*
*
* @return string
*/
public function getAddLink(): string
{
return 'category.php' . ($this->parentId ? '?parent=' . $this->parentId : '');
}
}
?>
Did this file decode correctly?
Original Code
<?php
namespace Widget\Metas\Category;
use Typecho\Common;
use Typecho\Db;
use Typecho\Widget\Exception;
use Widget\Base\Metas;
use Widget\Base\TreeTrait;
if (!defined('__TYPECHO_ROOT_DIR__')) {
exit;
}
/**
* Category Admin
*/
class Admin extends Metas
{
use InitTreeRowsTrait;
use TreeTrait;
/**
* @var int Parent category
*/
private int $parentId = 0;
/**
*
*/
public function execute()
{
$this->parentId = $this->request->filter('int')->get('parent', 0);
$this->pushAll($this->getRows($this->getChildIds($this->parentId)));
}
/**
*
*
* @throws Db\Exception
*/
public function backLink()
{
if ($this->parentId) {
$category = $this->getRow($this->parentId);
if (!empty($category)) {
$parent = $this->getRow($category['parent']);
if ($parent) {
echo '<a href="'
. Common::url('manage-categories.php?parent=' . $parent['mid'], $this->options->adminUrl)
. '">';
} else {
echo '<a href="' . Common::url('manage-categories.php', $this->options->adminUrl) . '">';
}
echo '« ';
_e('');
echo '</a>';
}
}
}
/**
*
*
* @return string|null
* @throws Db\Exception|Exception
*/
public function getMenuTitle(): ?string
{
if ($this->parentId) {
$category = $this->getRow($this->parentId);
if (!empty($category)) {
return _t(' %s ', $category['name']);
}
} else {
return null;
}
throw new Exception(_t(''), 404);
}
/**
*
*
* @return string
*/
public function getAddLink(): string
{
return 'category.php' . ($this->parentId ? '?parent=' . $this->parentId : '');
}
}
Function Calls
None |
Stats
MD5 | b8052e366794c9e569dbaf214dd7ce42 |
Eval Count | 0 |
Decode Time | 88 ms |