Update signature of handler 'csrf_ignore' to include types.
This commit is contained in:
parent
57bf56f794
commit
5606e38bff
|
@ -8,7 +8,7 @@ class Feeds extends Handler_Protected {
|
|||
private $viewfeed_timestamp;
|
||||
private $viewfeed_timestamp_last;
|
||||
|
||||
function csrf_ignore($method) {
|
||||
function csrf_ignore(string $method): bool {
|
||||
$csrf_ignored = array("index");
|
||||
|
||||
return array_search($method, $csrf_ignored) !== false;
|
||||
|
|
|
@ -8,7 +8,7 @@ class Handler implements IHandler {
|
|||
$this->args = $args;
|
||||
}
|
||||
|
||||
function csrf_ignore($method) {
|
||||
function csrf_ignore(string $method): bool {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
<?php
|
||||
interface IHandler {
|
||||
function csrf_ignore($method);
|
||||
function csrf_ignore(string $method): bool;
|
||||
function before($method);
|
||||
function after();
|
||||
}
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
<?php
|
||||
class OPML extends Handler_Protected {
|
||||
|
||||
function csrf_ignore($method) {
|
||||
function csrf_ignore(string $method): bool {
|
||||
$csrf_ignored = array("export", "import");
|
||||
|
||||
return array_search($method, $csrf_ignored) !== false;
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
<?php
|
||||
class PluginHandler extends Handler_Protected {
|
||||
function csrf_ignore($method) {
|
||||
function csrf_ignore(string $method): bool {
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
|
@ -5,7 +5,7 @@ class Pref_Feeds extends Handler_Protected {
|
|||
const E_ICON_UPLOAD_FAILED = 'E_ICON_UPLOAD_FAILED';
|
||||
const E_ICON_UPLOAD_SUCCESS = 'E_ICON_UPLOAD_SUCCESS';
|
||||
|
||||
function csrf_ignore($method) {
|
||||
function csrf_ignore(string $method): bool {
|
||||
$csrf_ignored = array("index", "getfeedtree", "savefeedorder");
|
||||
|
||||
return array_search($method, $csrf_ignored) !== false;
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
<?php
|
||||
class Pref_Filters extends Handler_Protected {
|
||||
|
||||
function csrf_ignore($method) {
|
||||
function csrf_ignore(string $method): bool {
|
||||
$csrf_ignored = array("index", "getfiltertree", "savefilterorder");
|
||||
|
||||
return array_search($method, $csrf_ignored) !== false;
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
<?php
|
||||
class Pref_Labels extends Handler_Protected {
|
||||
|
||||
function csrf_ignore($method) {
|
||||
function csrf_ignore(string $method): bool {
|
||||
$csrf_ignored = array("index", "getlabeltree");
|
||||
|
||||
return array_search($method, $csrf_ignored) !== false;
|
||||
|
|
|
@ -17,7 +17,7 @@ class Pref_Prefs extends Handler_Protected {
|
|||
const PI_ERR_PLUGIN_NOT_FOUND = "PI_ERR_PLUGIN_NOT_FOUND";
|
||||
const PI_ERR_NO_WORKDIR = "PI_ERR_NO_WORKDIR";
|
||||
|
||||
function csrf_ignore($method) {
|
||||
function csrf_ignore(string $method): bool {
|
||||
$csrf_ignored = array("index", "updateself", "otpqrcode");
|
||||
|
||||
return array_search($method, $csrf_ignored) !== false;
|
||||
|
|
|
@ -4,7 +4,7 @@ class Pref_System extends Handler_Administrative {
|
|||
|
||||
private $log_page_limit = 15;
|
||||
|
||||
function csrf_ignore($method) {
|
||||
function csrf_ignore(string $method): bool {
|
||||
$csrf_ignored = array("index");
|
||||
|
||||
return array_search($method, $csrf_ignored) !== false;
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
<?php
|
||||
class Pref_Users extends Handler_Administrative {
|
||||
function csrf_ignore($method) {
|
||||
function csrf_ignore(string $method): bool {
|
||||
return $method == "index";
|
||||
}
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
<?php
|
||||
class RPC extends Handler_Protected {
|
||||
|
||||
/*function csrf_ignore($method) {
|
||||
/*function csrf_ignore(string $method): bool {
|
||||
$csrf_ignored = array("completelabels");
|
||||
|
||||
return array_search($method, $csrf_ignored) !== false;
|
||||
|
|
Loading…
Reference in New Issue