civicrm/civicrm-core — pull request #3571 by totten (2014-06-27 04:12:00+00:00)
Title: CRM-14798 - CiviCase - Fix max_instances check

This code was using the ambiguous generic variable names ("$key", "$val")
and confusing the content of "$val" (e.g. confusing caseId with
caseTypeName).