Skip to content

Commit

Permalink
make sure double type is not lost when storing
Browse files Browse the repository at this point in the history
  • Loading branch information
dbu committed Jan 17, 2015
1 parent 28529be commit 51545a0
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/Jackalope/Transport/Jackrabbit/Client.php
Expand Up @@ -1245,7 +1245,14 @@ private function storeProperty(Property $property)
$this->setJsopBody('^' . $path . ' : ');
}
} else {
$this->setJsopBody('^' . $path . ' : ' . json_encode($value));
$encoded = json_encode($value);

if (PropertyType::DOUBLE == $property->getType()
&& !strpos($encoded, '.')
) {
$encoded .= '.0';
}
$this->setJsopBody('^' . $path . ' : ' . $encoded);
}
}

Expand Down

0 comments on commit 51545a0

Please sign in to comment.