comparison includes/file.inc @ 13:8b6c45761e01 6.6

Drupal 6.6
author Franck Deroche <webmaster@defr.org>
date Tue, 23 Dec 2008 14:32:33 +0100
parents 589fb7c02327
children
comparison
equal deleted inserted replaced
12:4ca9f57cc4d4 13:8b6c45761e01
1 <?php 1 <?php
2 // $Id: file.inc,v 1.121.2.4 2008/09/17 08:13:07 goba Exp $ 2 // $Id: file.inc,v 1.121.2.5 2008/10/20 09:42:31 goba Exp $
3 3
4 /** 4 /**
5 * @file 5 * @file
6 * API for handling file uploads and server file management. 6 * API for handling file uploads and server file management.
7 */ 7 */
790 * 790 *
791 * @param $source File to transfer. 791 * @param $source File to transfer.
792 * @param $headers An array of http headers to send along with file. 792 * @param $headers An array of http headers to send along with file.
793 */ 793 */
794 function file_transfer($source, $headers) { 794 function file_transfer($source, $headers) {
795 ob_end_clean(); 795 if (ob_get_level()) {
796 ob_end_clean();
797 }
796 798
797 foreach ($headers as $header) { 799 foreach ($headers as $header) {
798 // To prevent HTTP header injection, we delete new lines that are 800 // To prevent HTTP header injection, we delete new lines that are
799 // not followed by a space or a tab. 801 // not followed by a space or a tab.
800 // See http://www.w3.org/Protocols/rfc2616/rfc2616-sec4.html#sec4.2 802 // See http://www.w3.org/Protocols/rfc2616/rfc2616-sec4.html#sec4.2