diff options
author | Georg Ehrke <developer@georgehrke.com> | 2015-03-13 19:23:02 +0300 |
---|---|---|
committer | Georg Ehrke <developer@georgehrke.com> | 2015-03-16 14:41:53 +0300 |
commit | bc5ca788162ea66bc90d0fbe0bcaacd02d6617b9 (patch) | |
tree | a964d4c8178eb6f3738e9c0897b904a42cddc58e /lib | |
parent | 92a024b2fd354434ee7d72ac0d0e465b7c93571f (diff) |
validate resource's integrity before using it
Diffstat (limited to 'lib')
-rw-r--r-- | lib/private/image.php | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/private/image.php b/lib/private/image.php index 317b6fde160..2484aeecc63 100644 --- a/lib/private/image.php +++ b/lib/private/image.php @@ -283,9 +283,12 @@ class OC_Image { } /** - * @return string Returns the raw image data. + * @return null|string Returns the raw image data. */ function data() { + if (!$this->valid()) { + return null; + } ob_start(); switch ($this->mimeType) { case "image/png": |