Skip to content

Commit

Permalink
Throw an exception for overlong metadata keys and values.
Browse files Browse the repository at this point in the history
The old code never worked since this is a static function.
  • Loading branch information
mss committed Aug 16, 2011
1 parent 07d6d2f commit 3121b04
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions cloudfiles_http.php
Original file line number Diff line number Diff line change
Expand Up @@ -1390,10 +1390,10 @@ private function _process_metadata(&$hdrs,$metadata)

$k = trim($k);
$v = trim($v);
if (strlen($k) > 128 || strlen($v) > 256) {
$this->error_str = "Metadata key or value exceeds maximum length: ($k: $v)";
return 0;
}
if (strlen($k) > 128 || strlen($v) > 256)
throw new SyntaxException(
sprintf("Metadata key or value exceeds maximum length: %s: %d/%d",
$k, strlen($k), strlen($v)));

if (array_key_exists(strtolower($k), $added))
continue;
Expand Down

0 comments on commit 3121b04

Please sign in to comment.