Azure / azure-storage-php

Microsoft Azure Storage Library for PHP
MIT License
217 stars 198 forks source link

TypeError in ServiceProperties::getCorsesArray() due to count() on null value #329

Open Relevate-Jeff-Knight opened 2 years ago

Relevate-Jeff-Knight commented 2 years ago

Which service(blob, file, queue, table) does this issue concern?

Common

Which version of the SDK was used?

1.5.2

What's the PHP/OS version?

PHP 8.1.3 / Ubuntu 21.10

What problem was encountered?

Trying to use the setBlobServiceProperties() function from the samples/AADAuthSamples.php throws an error because you can't pass count() a null value.

Steps to reproduce the issue?

Run the function setBlobServiceProperties() in the samples/AADAuthSamples.php

Have you found a mitigation/solution?

Change getCorses() to return an empty array when value is null, check for null values in the setBlobServiceProperties() before using count().

Is there a failing request ID related to this problem returned by server? What is it?

N/A

What is the storage account name and time frame of your last reproduce? (UTC YYYY/MM/DD hh:mm:ss)

N/A

(If you think some of the information should not be shared publicly, you can e-mail the main Microsoft contributors of the repository instead.)