@@ 1947-1955 (lines=9) @@ | ||
1944 | function wfNegotiateType( $cprefs, $sprefs ) { |
|
1945 | $combine = []; |
|
1946 | ||
1947 | foreach ( array_keys( $sprefs ) as $type ) { |
|
1948 | $subType = explode( '/', $type )[1]; |
|
1949 | if ( $subType != '*' ) { |
|
1950 | $ckey = mimeTypeMatch( $type, $cprefs ); |
|
1951 | if ( $ckey ) { |
|
1952 | $combine[$type] = $sprefs[$type] * $cprefs[$ckey]; |
|
1953 | } |
|
1954 | } |
|
1955 | } |
|
1956 | ||
1957 | foreach ( array_keys( $cprefs ) as $type ) { |
|
1958 | $subType = explode( '/', $type )[1]; |
|
@@ 1957-1965 (lines=9) @@ | ||
1954 | } |
|
1955 | } |
|
1956 | ||
1957 | foreach ( array_keys( $cprefs ) as $type ) { |
|
1958 | $subType = explode( '/', $type )[1]; |
|
1959 | if ( $subType != '*' && !array_key_exists( $type, $sprefs ) ) { |
|
1960 | $skey = mimeTypeMatch( $type, $sprefs ); |
|
1961 | if ( $skey ) { |
|
1962 | $combine[$type] = $sprefs[$skey] * $cprefs[$type]; |
|
1963 | } |
|
1964 | } |
|
1965 | } |
|
1966 | ||
1967 | $bestq = 0; |
|
1968 | $besttype = null; |