humanmade / shared-media-library

WordPress plugin for a multisite shared media library - Gutenberg compatible
11 stars 4 forks source link

Avoid direct access to PHP files in plugin folder #1

Open pdewouters opened 5 years ago

pdewouters commented 5 years ago

Using our own versions of async-uploads.php can cause the plugin to not work on servers where access to PHP files directly is forbidden.

can we instead use the same approach as the network media library plugin?

add_action( 'load-async-upload.php', __NAMESPACE__ . '\switch_to_media_site', 0 );
add_action( 'wp_ajax_upload-attachment', __NAMESPACE__ . '\switch_to_media_site', 0 );
joemcgill commented 5 years ago

Hi @pdewouters Could you provide more details here? What error are you seeing, specifically?

pdewouters commented 5 years ago

on the Altis platform , we don't allow using PHP files as endpoints, see https://github.com/humanmade/altis-local-chassis/issues/37