Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Add deleted & required _unix2DOSTime method

  • Loading branch information...
commit 8760d63f45f46858a53d245cbf941dfb032e6f15 1 parent d50fe07
@phproberto phproberto authored
Showing with 27 additions and 0 deletions.
  1. +27 −0 libraries/joomla/archive/zip.php
View
27 libraries/joomla/archive/zip.php
@@ -539,6 +539,33 @@ private function _getFileData($key)
}
/**
+ * Converts a UNIX timestamp to a 4-byte DOS date and time format
+ * (date in high 2-bytes, time in low 2-bytes allowing magnitude
+ * comparison).
+ *
+ * @param int $unixtime The current UNIX timestamp.
+ *
+ * @return int The current date in a 4-byte DOS format.
+ * @since 11.1
+ */
+ protected function _unix2DOSTime($unixtime = null)
+ {
+ $timearray = (is_null($unixtime)) ? getdate() : getdate($unixtime);
+
+ if ($timearray['year'] < 1980)
+ {
+ $timearray['year'] = 1980;
+ $timearray['mon'] = 1;
+ $timearray['mday'] = 1;
+ $timearray['hours'] = 0;
+ $timearray['minutes'] = 0;
+ $timearray['seconds'] = 0;
+ }
+
+ return (($timearray['year'] - 1980) << 25) | ($timearray['mon'] << 21) | ($timearray['mday'] << 16) | ($timearray['hours'] << 11) | ($timearray['minutes'] << 5) | ($timearray['seconds'] >> 1);
+ }
+
+ /**
* Adds a "file" to the ZIP archive.
*
* @param array &$file File data array to add
Please sign in to comment.
Something went wrong with that request. Please try again.