mirror of
https://github.com/woocommerce/woocommerce-paypal-payments.git
synced 2025-09-05 08:59:14 +08:00
Use realpath for __FILE__ when creating url
on some sites __FILE__ contains .. which breaks url creation
This commit is contained in:
parent
5591b2806d
commit
314ba44bb9
5 changed files with 6 additions and 6 deletions
|
@ -90,7 +90,7 @@ return array(
|
|||
'button.url' => static function ( ContainerInterface $container ): string {
|
||||
return plugins_url(
|
||||
'/modules/ppcp-button/',
|
||||
dirname( __FILE__, 3 ) . '/woocommerce-paypal-payments.php'
|
||||
dirname( realpath( __FILE__ ), 3 ) . '/woocommerce-paypal-payments.php'
|
||||
);
|
||||
},
|
||||
'button.request-data' => static function ( ContainerInterface $container ): RequestData {
|
||||
|
|
|
@ -139,7 +139,7 @@ return array(
|
|||
'onboarding.url' => static function ( ContainerInterface $container ): string {
|
||||
return plugins_url(
|
||||
'/modules/ppcp-onboarding/',
|
||||
dirname( __FILE__, 3 ) . '/woocommerce-paypal-payments.php'
|
||||
dirname( realpath( __FILE__ ), 3 ) . '/woocommerce-paypal-payments.php'
|
||||
);
|
||||
},
|
||||
|
||||
|
|
|
@ -17,7 +17,7 @@ return array(
|
|||
'vaulting.module-url' => static function ( ContainerInterface $container ): string {
|
||||
return plugins_url(
|
||||
'/modules/ppcp-vaulting/',
|
||||
dirname( __FILE__, 3 ) . '/woocommerce-paypal-payments.php'
|
||||
dirname( realpath( __FILE__ ), 3 ) . '/woocommerce-paypal-payments.php'
|
||||
);
|
||||
},
|
||||
'vaulting.assets.myaccount-payments' => function( ContainerInterface $container ) : MyAccountPaymentsAssets {
|
||||
|
|
|
@ -1988,7 +1988,7 @@ return array(
|
|||
'wcgateway.url' => static function ( ContainerInterface $container ): string {
|
||||
return plugins_url(
|
||||
$container->get( 'wcgateway.relative-path' ),
|
||||
dirname( __FILE__, 3 ) . '/woocommerce-paypal-payments.php'
|
||||
dirname( realpath( __FILE__ ), 3 ) . '/woocommerce-paypal-payments.php'
|
||||
);
|
||||
},
|
||||
'wcgateway.relative-path' => static function( ContainerInterface $container ): string {
|
||||
|
@ -1996,7 +1996,7 @@ return array(
|
|||
},
|
||||
'wcgateway.absolute-path' => static function( ContainerInterface $container ): string {
|
||||
return plugin_dir_path(
|
||||
dirname( __FILE__, 3 ) . '/woocommerce-paypal-payments.php'
|
||||
dirname( realpath( __FILE__ ), 3 ) . '/woocommerce-paypal-payments.php'
|
||||
) .
|
||||
$container->get( 'wcgateway.relative-path' );
|
||||
},
|
||||
|
|
|
@ -197,7 +197,7 @@ return array(
|
|||
'webhook.module-url' => static function ( ContainerInterface $container ): string {
|
||||
return plugins_url(
|
||||
'/modules/ppcp-webhooks/',
|
||||
dirname( __FILE__, 3 ) . '/woocommerce-paypal-payments.php'
|
||||
dirname( realpath( __FILE__ ), 3 ) . '/woocommerce-paypal-payments.php'
|
||||
);
|
||||
},
|
||||
);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue