Skip to content
This repository has been archived by the owner on May 8, 2024. It is now read-only.

Commit

Permalink
Apply fix azure-sdk-for-php v0.4.2
Browse files Browse the repository at this point in the history
  • Loading branch information
nowenL committed May 9, 2016
1 parent 158782c commit a50e9ea
Showing 1 changed file with 11 additions and 5 deletions.
16 changes: 11 additions & 5 deletions src/Blob/BlobRestProxy.php
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,10 @@ private function _getBlobUrl($container, $blob)
$encodedBlob = $container . '/' . $encodedBlob;
}

if (substr($encodedBlob, 0, 1) != '/' && substr($this->getUri(), -1, 1) != '/')
{
$encodedBlob = '/' . $encodedBlob;
}
return $this->getUri() . $encodedBlob;
}

Expand Down Expand Up @@ -1352,11 +1356,13 @@ public function createBlockBlob($container, $blob, $content, $options = null)
$content = substr_replace($content, '', 0, $blockSize);
}
}
$block = new Block();
$block->setBlockId(base64_encode(str_pad($counter++, 6, '0', STR_PAD_LEFT)));
$block->setType('Uncommitted');
array_push($blockIds, $block);
$this->createBlobBlock($container, $blob, $block->getBlockId(), $body);
if (!empty($body)) {
$block = new Block();
$block->setBlockId(base64_encode(str_pad($counter++, 6, '0', STR_PAD_LEFT)));
$block->setType('Uncommitted');
array_push($blockIds, $block);
$this->createBlobBlock($container, $blob, $block->getBlockId(), $body);
}
}
$response = $this->commitBlobBlocks($container, $blob, $blockIds, $options);
}
Expand Down

0 comments on commit a50e9ea

Please sign in to comment.