File:  [mozdev] / compactheader / www / download.php
Revision 1.1: download - view: text, annotated - select for diffs - revision graph
Thu Oct 1 23:26:35 2009 UTC (9 years, 7 months ago) by joachim.herb
Branches: MAIN
CVS tags: V_2_0_6, V_2_0_4, V_2_0_3bata2, V_2_0_1, V_2_0_0beta1, V_2_0_0alpha2, V_2_0_0alpha1, V_2_0_0_beta_1, V_2_0_0, V_1_4_6beta1, V_1_4_6, V_1_4_5beta3, V_1_4_5beta2, V_1_4_5, V_1_4_3beta2, V_1_4_3beta1, V_1_4_3, V_1_4_2beta5, V_1_4_2beta4, V_1_4_2beta3, V_1_4_2beta1, V_1_4_2, V_1_4_1, V_1_4_0, V_1_3_0beta2, V_1_3_0beta1, V_1_2_5_beta1, V_1_2_4, V_1_2_3, V_1_2_2, V_1_2_1, V_1_2_0_beta1, V_1_2_0, V_1_1_8, V_1_1_7, V_1_1_6, V_1_1_5beta5, V_1_1_5, V_1_1_4, V_1_0_2, V_1_0_1, V_1_0_0_, V_1_0_0, HEAD, B_2_0, B_1_2, B_1_1_5
New way to download addon.

<?php
$xpi = substr($_SERVER['PATH_INFO'], 1);
if(preg_match('/^[a-zA-Z0-9_\-\.]+.xpi$/', $xpi) == 0)
{
  print "Illegal name: $xpi"; return;
}
header('Content-type: application/x-xpinstall');
header('Content-disposition: attachment; filename=' . $xpi);
readfile('http://downloads.mozdev.org/compactheader/' . $xpi);
?>

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>