mirror of
https://gitee.com/koogua/course-tencent-cloud.git
synced 2025-07-06 17:01:11 +08:00
Merge remote-tracking branch 'gitee/xiaochong0302/I280IZ' into xiaochong0302/I280IZ
This commit is contained in:
commit
fc6e9382a0
@ -21,6 +21,17 @@ class Controller extends \Phalcon\Mvc\Controller
|
|||||||
|
|
||||||
public function beforeExecuteRoute(Dispatcher $dispatcher)
|
public function beforeExecuteRoute(Dispatcher $dispatcher)
|
||||||
{
|
{
|
||||||
|
/**
|
||||||
|
* demo分支拒绝数据提交
|
||||||
|
*/
|
||||||
|
if ($this->isNotSafeRequest()) {
|
||||||
|
$dispatcher->forward([
|
||||||
|
'controller' => 'public',
|
||||||
|
'action' => 'forbidden',
|
||||||
|
]);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
if ($this->isNotSafeRequest()) {
|
if ($this->isNotSafeRequest()) {
|
||||||
$this->checkHttpReferer();
|
$this->checkHttpReferer();
|
||||||
$this->checkCsrfToken();
|
$this->checkCsrfToken();
|
||||||
|
@ -86,8 +86,16 @@ class Setting extends Service
|
|||||||
|
|
||||||
$result = [];
|
$result = [];
|
||||||
|
|
||||||
|
/**
|
||||||
|
* demo分支过滤敏感数据
|
||||||
|
*/
|
||||||
if ($items->count() > 0) {
|
if ($items->count() > 0) {
|
||||||
foreach ($items as $item) {
|
foreach ($items as $item) {
|
||||||
|
$case1 = preg_match('/(id|auth|key|secret|password|pwd)$/', $item->item_key);
|
||||||
|
$case2 = $this->dispatcher->getControllerName() == 'setting';
|
||||||
|
if ($case1 && $case2) {
|
||||||
|
$item->item_value = '***';
|
||||||
|
}
|
||||||
$result[$item->item_key] = $item->item_value;
|
$result[$item->item_key] = $item->item_value;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -22,5 +22,12 @@
|
|||||||
|
|
||||||
{% block include_js %}{% endblock %}
|
{% block include_js %}{% endblock %}
|
||||||
{% block inline_js %}{% endblock %}
|
{% block inline_js %}{% endblock %}
|
||||||
|
|
||||||
|
{% set site = setting('site') %}
|
||||||
|
|
||||||
|
{% if site['analytics_enabled'] == 1 %}
|
||||||
|
{{ site['analytics_script'] }}
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
Loading…
x
Reference in New Issue
Block a user