From 76d80add86d84cb1933df9be7c4332693b4940b3 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Roland=20H=C3=A4der?= Date: Mon, 18 Apr 2011 16:53:56 +0000 Subject: [PATCH] Added isBase64Encoded() with a simple check on Base64-encoded messages. --- inc/classes/main/class_BaseFrameworkSystem.php | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/inc/classes/main/class_BaseFrameworkSystem.php b/inc/classes/main/class_BaseFrameworkSystem.php index 00ccf224..7a43629c 100644 --- a/inc/classes/main/class_BaseFrameworkSystem.php +++ b/inc/classes/main/class_BaseFrameworkSystem.php @@ -1807,6 +1807,20 @@ class BaseFrameworkSystem extends stdClass implements FrameworkInterface { // Return it return $strFinal; } + + /** + * Checks wether the given encoded data was encoded with Base64 + * + * @param $encodedData Encoded data we shall check + * @return $isBase64 Wether the encoded data is Base64 + */ + protected function isBase64Encoded ($encodedData) { + // Determine it + $isBase64 = (@base64_decode($encodedData, true) !== false); + + // Return it + return $isBase64; + } } // [EOF] -- 2.39.5