34 $this->supportedValues = $supported;
35 $this->defaultValue = reset( $supported );
56 foreach ( $weights
as $name => &$weight ) {
59 } elseif ( substr(
$name, -2 ) ===
'/*' ) {
68 $weights = array_filter( $weights );
71 $preferences = array_reverse( array_keys( $weights ) );
92 foreach ( $this->supportedValues
as $supported ) {
120 if ( strcasecmp( $accepted, $supported ) === 0 ) {
125 if ( $accepted ===
'*' || $accepted ===
'*/*' ) {
130 if ( substr( $accepted, -2 ) ===
'/*'
131 && strncasecmp( $accepted, $supported, strlen( $accepted ) - 2 ) === 0