Jeremy Newman : move functions only used here from global

Jeremy Newman jnewman at winehq.org
Mon Nov 21 08:38:07 CST 2016


Module: appdb
Branch: master
Commit: a6dfba5ab4eeef5eaaa0050f7d09c398665aba79
URL:    http://source.winehq.org/git/appdb.git/?a=commit;h=a6dfba5ab4eeef5eaaa0050f7d09c398665aba79

Author: Jeremy Newman <jnewman at codeweavers.com>
Date:   Mon Nov 14 14:59:45 2016 -0600

move functions only used here from global

---

 appimage.php | 15 ++++++++++++++-
 1 file changed, 14 insertions(+), 1 deletion(-)

diff --git a/appimage.php b/appimage.php
index 00cc6c4..f4d1b58 100644
--- a/appimage.php
+++ b/appimage.php
@@ -14,6 +14,18 @@
  *  - replace iId with iScreenshotId
  */
 
+/**
+ *  parse all the date formats required by HTTP 1.1 into PHP time values
+ */
+function pHttpDate($sDate) {
+   $iDate = strtotime($sDate);
+   if ($iDate != -1) return $iDate;
+        /* the RFC also requires asctime() format... */
+   $aTs = strptime($sDate,"%a %b  %e %H:%M:%S %Y");
+   $iDate = gmmktime($aTs[2],$aTs[1],$aTs[0],$aTs[4],$aTs[3],$aTs[5],0);
+   return $iDate;
+}
+
 // application environment
 require("path.php");
 require(BASE."include/incl.php");
@@ -66,10 +78,11 @@ if (isset($_SERVER['HTTP_IF_MODIFIED_SINCE']) &&
    exit;
 }
 
-header("Last-Modified: ".fHttpDate($iModTime));
+header("Last-Modified: ".gmdate("D, d M Y H:i:s",$iModTime)." GMT");
 
 if(!$aClean['bThumbnail'])
     $oScreenshot->output_screenshot(false);
 else
     $oScreenshot->output_screenshot(true);
+
 ?>




More information about the wine-cvs mailing list