yiisoft/yii — pull request #2132 by Rupert-RR (2013-02-20 14:52:09+00:00)
Title: Enh #2131: Added Accept header parsing to CHttpRequest

Added functions getPreferredAcceptType() and getPreferredAcceptTypes() to parse the Accept header and return a list of accepted content types in order of preference, as per http://tools.ietf.org/html/rfc2616#section-14.1
NB, the specification does allow for escaping of parameters in an accept header, but this obscure case is not catered for here, since this would add an order of complexity to the regular expressions used.