* @inheritDoc
*/
public function compare($value1, $value2) {
- // TODO: fix this
-
- // handle special case where no allowed BBCodes have been set
+ // handle special case where no disallowed BBCodes have been set
if (empty($value1)) {
if (empty($value2)) {
return 0;
$value1 = explode(',', $value1);
$value2 = explode(',', $value2);
- // handle special 'all' value
- if (in_array('all', $value1)) {
- if (in_array('all', $value2)) {
- return 0;
- }
- else {
- return 1;
- }
- }
- else if (in_array('all', $value2)) {
- return -1;
- }
-
- // check if value1 contains more BBCodes than value2
+ // check if value1 disallows more BBCodes than value2
$diff = array_diff($value1, $value2);
if (!empty($diff)) {
return 1;
}
- // check if value1 contains less BBCodes than value2
+ // check if value1 disallows less BBCodes than value2
$diff = array_diff($value2, $value1);
if (!empty($diff)) {
return -1;