We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 02e1a07 commit 7f93910Copy full SHA for 7f93910
cool.php
@@ -14,15 +14,9 @@
14
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
15
*/
16
17
-if ( ! empty( $_SERVER['SCRIPT_FILENAME'] ) ) {
18
- $my_path = explode( 'wp-content', $_SERVER['SCRIPT_FILENAME'] ); // phpcs:ignore WordPress.Security.ValidatedSanitizedInput
19
- if ( empty( $my_path[0] ) ) {
20
- die( 'URL error' );
21
- }
22
- require_once $my_path[0] . 'wp-load.php';
23
-} else {
24
- die( 'Can\'t load WordPress.' );
25
-}
+// This is assume the standard plugin installation on WordPress.
+// This file is in `wp-content/plugins/collabora-online-wp`.
+require_once __DIR__ . '/../../../wp-load.php';
26
27
if ( ! isset( $_GET['id'] ) ) {
28
die( 'No id passed' );
0 commit comments