@ -2820,13 +2820,14 @@ function api_refine_encoding_id($encoding) {
* This function checks whether two $encoding are equal (same, equvalent).
* @param string/array $encoding1 The first encoding
* @param string/array $encoding2 The second encoding
* @param bool $strict When this parameter is TRUE the comparison ignores aliases of encodings. When the parameter is FALSE, aliases are taken into account.
* @return bool Returns TRUE if the encodings are equal, FALSE otherwise.
*/
function api_equal_encodings($encoding1, $encoding2) {
function api_equal_encodings($encoding1, $encoding2, $strict = false) {
static $equal_encodings = array();
if (is_array($encoding1)) {
foreach ($encoding1 as $encoding) {
if (api_equal_encodings($encoding, $encoding2)) {
if (api_equal_encodings($encoding, $encoding2, $strict)) {
return true;
}
}
@ -2834,25 +2835,29 @@ function api_equal_encodings($encoding1, $encoding2) {
}
elseif (is_array($encoding2)) {
foreach ($encoding2 as $encoding) {
if (api_equal_encodings($encoding1, $encoding)) {
if (api_equal_encodings($encoding1, $encoding, $strict)) {
return true;
}
}
return false;
}
if (!isset($equal_encodings[$encoding1][$encoding2])) {
if (!isset($equal_encodings[$encoding1][$encoding2][$strict])) {