Fix syntax errors

This commit is contained in:
Jeremy Dormitzer 2018-09-03 21:33:14 -04:00
parent e7cda74671
commit c4d8b7ad57
2 changed files with 5 additions and 5 deletions

View File

@ -1,7 +1,7 @@
<?php
namespace \activities\update;
namespace activities\update;
require_once plugin_dir_path( __FILE __ ) . '/../objects.php';
require_once plugin_dir_path( __FILE__ ) . '/../objects.php';
function handle( $actor, $activity ) {
if ( !(array_key_exists( 'type', $activity ) && $activity['type'] === 'Update') ) {
@ -14,7 +14,7 @@ function handle( $actor, $activity ) {
if ( !array_key_exists( 'object', $activity ) ) {
return new \WP_Error(
'invalid_activity',
__( 'Expecting an object', 'activitypub' )
__( 'Expecting an object', 'activitypub' ),
array( 'status' => 400 )
);
}
@ -22,7 +22,7 @@ function handle( $actor, $activity ) {
if ( !array_key_exists( 'id', $update_object ) ) {
return new \WP_Error(
'invalid_object',
__( 'Object must have an "id" parameter', 'activitypub' )
__( 'Object must have an "id" parameter', 'activitypub' ),
array( 'status' => 400 )
);
}

View File

@ -8,7 +8,7 @@ require_once plugin_dir_path( __FILE__ ) . '/activities.php';
function get_actor( $request ) {
$actor = $request['actor'];
return \actors\get_actor_by_slug( $user );
return \actors\get_actor_by_slug( $actor );
}
function handle_activity( $request ) {