Open nlardev-hublot opened 1 year ago
Please help fix this problem.
PHP Deprecated: strpos(): Passing null to parameter #1 ($haystack) of type string is deprecated in /var/www/wordpress/wp-content/plugins/windows-azure-storage/vendor/microsoft/azure-storage-blob/src/Blob/Models/CopyState.php on line 77
Environment: Azure web app / Wordpress container provided by Microsoft PHP 8.2.15 (cli) (built: Jan 27 2024 04:53:38) (NTS)
Which service(blob, file, queue, table) does this issue concern?
Blob Storage
Which version of the SDK was used?
"microsoft/azure-storage-blob": "^1.5"
What's the PHP/OS version?
PHP 8.1.6
What problem was encountered?
Deprecated: substr(): Passing null to parameter https://github.com/Azure/azure-storage-common-php/issues/1 ($string) of type string is deprecated in /DIR_APP/vendor/microsoft/azure-storage-common/src/Common/Internal/Utilities.php on line 615
Steps to reproduce the issue?
Using version of PHP 8.0 or greater, try to create:
We are able to pass only BlobEndpoint, but we are not able to pass secondary Endpoing. Then in: app/code/Hublot/CryptoPayment/Model/Blob/BlobRestProxy.php
$secondaryUri = Utilities::tryAddUrlScheme( $settings->getBlobSecondaryEndpointUri() );
$secondaryUri will be null. and then in: vendor/microsoft/azure-storage-common/src/Common/Internal/Utilities.php:603haystack will be null, which will throw exception in php 8.0 or greater version, it should be string.
Have you found a mitigation/solution?
Yes.
One of the option to fix the issue is to be able to change: vendor/microsoft/azure-storage-common/src/Common/Internal/StorageServiceSettings.php:189
$blobSecondaryEndpointUri = null,
to$blobSecondaryEndpointUri = '',
or to be able to set $blobSecondaryEndpointUri thry setter.Other solution is: app/code/Hublot/CryptoPayment/Model/Blob/BlobRestProxy.php:142
Is there a failing request ID related to this problem returned by server? What is it?
No
What is the storage account name and time frame of your last reproduce? (UTC YYYY/MM/DD hh:mm:ss)
I am not able to provide that information.
(If you think some of the information should not be shared publicly, you can e-mail the main Microsoft contributors of the repository instead.)