|
85 | 85 | * @author Azure Storage PHP SDK <dmsh@microsoft.com> |
86 | 86 | * @copyright 2016 Microsoft Corporation |
87 | 87 | * @license https://github.com/azure/azure-storage-php/LICENSE |
88 | | - * @version Release: 0.10.0 |
| 88 | + * @version Release: 0.10.1 |
89 | 89 | * @link https://github.com/azure/azure-storage-php |
90 | 90 | */ |
91 | 91 | class BlobRestProxy extends ServiceRestProxy implements IBlob |
@@ -195,6 +195,10 @@ private function _getBlobUrl($container, $blob) |
195 | 195 | $encodedBlob = $container . '/' . $encodedBlob; |
196 | 196 | } |
197 | 197 |
|
| 198 | + if (substr($encodedBlob, 0, 1) != '/' && substr($this->getUri(), -1, 1) != '/') |
| 199 | + { |
| 200 | + $encodedBlob = '/' . $encodedBlob; |
| 201 | + } |
198 | 202 | return $this->getUri() . $encodedBlob; |
199 | 203 | } |
200 | 204 |
|
@@ -1352,11 +1356,13 @@ public function createBlockBlob($container, $blob, $content, $options = null) |
1352 | 1356 | $content = substr_replace($content, '', 0, $blockSize); |
1353 | 1357 | } |
1354 | 1358 | } |
1355 | | - $block = new Block(); |
1356 | | - $block->setBlockId(base64_encode(str_pad($counter++, 6, '0', STR_PAD_LEFT))); |
1357 | | - $block->setType('Uncommitted'); |
1358 | | - array_push($blockIds, $block); |
1359 | | - $this->createBlobBlock($container, $blob, $block->getBlockId(), $body); |
| 1359 | + if (!empty($body)) { |
| 1360 | + $block = new Block(); |
| 1361 | + $block->setBlockId(base64_encode(str_pad($counter++, 6, '0', STR_PAD_LEFT))); |
| 1362 | + $block->setType('Uncommitted'); |
| 1363 | + array_push($blockIds, $block); |
| 1364 | + $this->createBlobBlock($container, $blob, $block->getBlockId(), $body); |
| 1365 | + } |
1360 | 1366 | } |
1361 | 1367 | $response = $this->commitBlobBlocks($container, $blob, $blockIds, $options); |
1362 | 1368 | } |
|
0 commit comments