Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Method for LiteralData normalization

  • Loading branch information...
commit 10ea11df4f44106d7f9e90fa20739d4795bfdc88 1 parent a3bf2db
@singpolyma singpolyma authored committed
Showing with 6 additions and 0 deletions.
  1. +6 −0 lib/openpgp.php
View
6 lib/openpgp.php
@@ -981,6 +981,12 @@ function __construct($data=NULL, $opt=array()) {
$this->timestamp = $opt['timestamp'] ? $opt['timestamp'] : time();
}
+ function normalize() {
+ if($opt['format'] == 'u' || $opt['format'] == 't') { // Normalize line endings
+ $this->data = str_replace("\n", "\r\n", str_replace("\r", "\n", str_replace("\r\n", "\n", $this->data)));
+ }
+ }
+
function read() {
$this->size = $this->length - 1 - 4;
$this->format = $this->read_byte();
Please sign in to comment.
Something went wrong with that request. Please try again.