From: Roland Häder Date: Mon, 18 Apr 2011 16:53:56 +0000 (+0000) Subject: Added isBase64Encoded() with a simple check on Base64-encoded messages. X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=76d80add86d84cb1933df9be7c4332693b4940b3;p=core.git Added isBase64Encoded() with a simple check on Base64-encoded messages. --- 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]