remove casts

after feedback from @akirk
This commit is contained in:
Matthias Pfefferle 2023-05-11 11:02:06 +02:00
parent fc1b89561e
commit f196047901
3 changed files with 3 additions and 5 deletions

View file

@ -75,7 +75,7 @@ function init() {
Rest\Webfinger::init();
// load NodeInfo endpoints only if blog is public
if ( true === (bool) \get_option( 'blog_public', 1 ) ) {
if ( \get_option( 'blog_public', 1 ) ) {
require_once \dirname( __FILE__ ) . '/includes/rest/class-nodeinfo.php';
Rest\NodeInfo::init();
}

View file

@ -78,8 +78,7 @@ class Activitypub {
\in_array( 'application/ld+json', $accept, true ) ||
\in_array( 'application/json', $accept, true )
) {
$secure_mode = (bool) \get_option( 'activitypub_use_secure_mode', '0' );
if ( $secure_mode ) {
if ( \get_option( 'activitypub_use_secure_mode', '0' ) ) {
$verification = Signature::verify_http_signature( $_SERVER );
if ( \is_wp_error( $verification ) ) {
// fallback as template_loader can't return http headers

View file

@ -92,8 +92,7 @@ class Server {
} else {
if ( '/activitypub/1.0/webfinger' !== $route ) {
// SecureMode/Authorized fetch.
$secure_mode = (bool) \get_option( 'activitypub_use_secure_mode', '0' );
if ( $secure_mode ) {
if ( \get_option( 'activitypub_use_secure_mode', '0' ) ) {
$verified_request = Signature::verify_http_signature( $request );
if ( \is_wp_error( $verified_request ) ) {
return $verified_request;