Version 3.1.4
This commit is contained in:
1 parent
1d4720f3e2
commit
ae5c01cc78
2563 files changed
+283048
-240689
No files matched your search
@@ -51,7 +51,7 @@
|
||||
* @author Matt Knapp <mdknapp[at]gmail[dot]com>
|
||||
* @author Brett Stimmerman <brettstimmerman[at]gmail[dot]com>
|
||||
* @copyright 2005 Michal Migurski
|
||||
* @version CVS: $Id: JSON.php 268 2009-05-20 13:25:22Z bfarber $
|
||||
* @version CVS: $Id: JSON.php 268 2009-05-20 13:25:45Z bfarber $
|
||||
* @license http://www.opensource.org/licenses/bsd-license.php
|
||||
* @link http://pear.php.net/pepr/pepr-proposal-show.php?id=198
|
||||
*/
|
||||
|
||||
@@ -1 +1,10 @@
|
||||
<html>␍<head><title>IP.Board - Bulletin Board System</title></head>␍<body>␍<h1>403: IP.Board -> Forbidden</h1>␍<hr>␍You have reached this page in error, please use your back button to return to the forum.␍<hr>␍<a href="http://www.invisionboard.com/">IP.Board</a>␍</body>␍</html>␍
|
||||
<html>
|
||||
<head><title>IP.Board - Bulletin Board System</title></head>
|
||||
<body>
|
||||
<h1>403: IP.Board -> Forbidden</h1>
|
||||
<hr>
|
||||
You have reached this page in error, please use your back button to return to the forum.
|
||||
<hr>
|
||||
<a href="http://www.invisionboard.com/">IP.Board</a>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,2 @@
|
||||
<?php
|
||||
class PEAR { }
|
||||
@@ -0,0 +1,10 @@
|
||||
<html>
|
||||
<head><title>IP.Board - Bulletin Board System</title></head>
|
||||
<body>
|
||||
<h1>403: IP.Board -> Forbidden</h1>
|
||||
<hr>
|
||||
You have reached this page in error, please use your back button to return to the forum.
|
||||
<hr>
|
||||
<a href="http://www.invisionboard.com/">IP.Board</a>
|
||||
</body>
|
||||
</html>
|
||||
File diff suppressed because it is too large.
Load diff
@@ -0,0 +1,865 @@
|
||||
<?php
|
||||
/**
|
||||
* The Mail_mimeDecode class is used to decode mail/mime messages
|
||||
*
|
||||
* This class will parse a raw mime email and return
|
||||
* the structure. Returned structure is similar to
|
||||
* that returned by imap_fetchstructure().
|
||||
*
|
||||
* +----------------------------- IMPORTANT ------------------------------+
|
||||
* | Usage of this class compared to native php extensions such as |
|
||||
* | mailparse or imap, is slow and may be feature deficient. If available|
|
||||
* | you are STRONGLY recommended to use the php extensions. |
|
||||
* +----------------------------------------------------------------------+
|
||||
*
|
||||
* Compatible with PHP versions 4 and 5
|
||||
*
|
||||
* LICENSE: This LICENSE is in the BSD license style.
|
||||
* Copyright (c) 2002-2003, Richard Heyes <richard@phpguru.org>
|
||||
* Copyright (c) 2003-2006, PEAR <pear-group@php.net>
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or
|
||||
* without modification, are permitted provided that the following
|
||||
* conditions are met:
|
||||
*
|
||||
* - Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* - Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* - Neither the name of the authors, nor the names of its contributors
|
||||
* may be used to endorse or promote products derived from this
|
||||
* software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
|
||||
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
|
||||
* THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
* @category Mail
|
||||
* @package Mail_Mime
|
||||
* @author Richard Heyes <richard@phpguru.org>
|
||||
* @author George Schlossnagle <george@omniti.com>
|
||||
* @author Cipriano Groenendal <cipri@php.net>
|
||||
* @author Sean Coates <sean@php.net>
|
||||
* @copyright 2003-2006 PEAR <pear-group@php.net>
|
||||
* @license http://www.opensource.org/licenses/bsd-license.php BSD License
|
||||
* @version CVS: $Id: mimeDecode.php 288500 2009-09-21 05:32:32Z alan_k $
|
||||
* @link http://pear.php.net/package/Mail_mime
|
||||
*/
|
||||
|
||||
|
||||
/**
|
||||
* require PEAR
|
||||
*
|
||||
* This package depends on PEAR to raise errors.
|
||||
*/
|
||||
require_once 'PEAR.php';
|
||||
|
||||
|
||||
/**
|
||||
* The Mail_mimeDecode class is used to decode mail/mime messages
|
||||
*
|
||||
* This class will parse a raw mime email and return the structure.
|
||||
* Returned structure is similar to that returned by imap_fetchstructure().
|
||||
*
|
||||
* +----------------------------- IMPORTANT ------------------------------+
|
||||
* | Usage of this class compared to native php extensions such as |
|
||||
* | mailparse or imap, is slow and may be feature deficient. If available|
|
||||
* | you are STRONGLY recommended to use the php extensions. |
|
||||
* +----------------------------------------------------------------------+
|
||||
*
|
||||
* @category Mail
|
||||
* @package Mail_Mime
|
||||
* @author Richard Heyes <richard@phpguru.org>
|
||||
* @author George Schlossnagle <george@omniti.com>
|
||||
* @author Cipriano Groenendal <cipri@php.net>
|
||||
* @author Sean Coates <sean@php.net>
|
||||
* @copyright 2003-2006 PEAR <pear-group@php.net>
|
||||
* @license http://www.opensource.org/licenses/bsd-license.php BSD License
|
||||
* @version Release: @package_version@
|
||||
* @link http://pear.php.net/package/Mail_mime
|
||||
*/
|
||||
class Mail_mimeDecode extends PEAR
|
||||
{
|
||||
/**
|
||||
* The raw email to decode
|
||||
*
|
||||
* @var string
|
||||
* @access private
|
||||
*/
|
||||
var $_input;
|
||||
|
||||
/**
|
||||
* The header part of the input
|
||||
*
|
||||
* @var string
|
||||
* @access private
|
||||
*/
|
||||
var $_header;
|
||||
|
||||
/**
|
||||
* The body part of the input
|
||||
*
|
||||
* @var string
|
||||
* @access private
|
||||
*/
|
||||
var $_body;
|
||||
|
||||
/**
|
||||
* If an error occurs, this is used to store the message
|
||||
*
|
||||
* @var string
|
||||
* @access private
|
||||
*/
|
||||
var $_error;
|
||||
|
||||
/**
|
||||
* Flag to determine whether to include bodies in the
|
||||
* returned object.
|
||||
*
|
||||
* @var boolean
|
||||
* @access private
|
||||
*/
|
||||
var $_include_bodies;
|
||||
|
||||
/**
|
||||
* Flag to determine whether to decode bodies
|
||||
*
|
||||
* @var boolean
|
||||
* @access private
|
||||
*/
|
||||
var $_decode_bodies;
|
||||
|
||||
/**
|
||||
* Flag to determine whether to decode headers
|
||||
*
|
||||
* @var boolean
|
||||
* @access private
|
||||
*/
|
||||
var $_decode_headers;
|
||||
|
||||
/**
|
||||
* Flag to determine whether to include attached messages
|
||||
* as body in the returned object. Depends on $_include_bodies
|
||||
*
|
||||
* @var boolean
|
||||
* @access private
|
||||
*/
|
||||
var $_rfc822_bodies;
|
||||
|
||||
/**
|
||||
* Constructor.
|
||||
*
|
||||
* Sets up the object, initialise the variables, and splits and
|
||||
* stores the header and body of the input.
|
||||
*
|
||||
* @param string The input to decode
|
||||
* @access public
|
||||
*/
|
||||
function Mail_mimeDecode($input)
|
||||
{
|
||||
list($header, $body) = $this->_splitBodyHeader($input);
|
||||
|
||||
$this->_input = $input;
|
||||
$this->_header = $header;
|
||||
$this->_body = $body;
|
||||
$this->_decode_bodies = false;
|
||||
$this->_include_bodies = true;
|
||||
$this->_rfc822_bodies = false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Begins the decoding process. If called statically
|
||||
* it will create an object and call the decode() method
|
||||
* of it.
|
||||
*
|
||||
* @param array An array of various parameters that determine
|
||||
* various things:
|
||||
* include_bodies - Whether to include the body in the returned
|
||||
* object.
|
||||
* decode_bodies - Whether to decode the bodies
|
||||
* of the parts. (Transfer encoding)
|
||||
* decode_headers - Whether to decode headers
|
||||
* input - If called statically, this will be treated
|
||||
* as the input
|
||||
* @return object Decoded results
|
||||
* @access public
|
||||
*/
|
||||
function decode($params = null)
|
||||
{
|
||||
// determine if this method has been called statically
|
||||
$isStatic = !(isset($this) && get_class($this) == __CLASS__);
|
||||
|
||||
// Have we been called statically?
|
||||
// If so, create an object and pass details to that.
|
||||
if ($isStatic AND isset($params['input'])) {
|
||||
|
||||
$obj = new Mail_mimeDecode($params['input']);
|
||||
$structure = $obj->decode($params);
|
||||
|
||||
// Called statically but no input
|
||||
} elseif ($isStatic) {
|
||||
return PEAR::raiseError('Called statically and no input given');
|
||||
|
||||
// Called via an object
|
||||
} else {
|
||||
$this->_include_bodies = isset($params['include_bodies']) ?
|
||||
$params['include_bodies'] : false;
|
||||
$this->_decode_bodies = isset($params['decode_bodies']) ?
|
||||
$params['decode_bodies'] : false;
|
||||
$this->_decode_headers = isset($params['decode_headers']) ?
|
||||
$params['decode_headers'] : false;
|
||||
$this->_rfc822_bodies = isset($params['rfc_822bodies']) ?
|
||||
$params['rfc_822bodies'] : false;
|
||||
|
||||
$structure = $this->_decode($this->_header, $this->_body);
|
||||
if ($structure === false) {
|
||||
$structure = $this->raiseError($this->_error);
|
||||
}
|
||||
}
|
||||
|
||||
return $structure;
|
||||
}
|
||||
|
||||
/**
|
||||
* Performs the decoding. Decodes the body string passed to it
|
||||
* If it finds certain content-types it will call itself in a
|
||||
* recursive fashion
|
||||
*
|
||||
* @param string Header section
|
||||
* @param string Body section
|
||||
* @return object Results of decoding process
|
||||
* @access private
|
||||
*/
|
||||
function _decode($headers, $body, $default_ctype = 'text/plain')
|
||||
{
|
||||
$return = new stdClass;
|
||||
$return->headers = array();
|
||||
$headers = $this->_parseHeaders($headers);
|
||||
|
||||
foreach ($headers as $value) {
|
||||
if (isset($return->headers[strtolower($value['name'])]) AND !is_array($return->headers[strtolower($value['name'])])) {
|
||||
$return->headers[strtolower($value['name'])] = array($return->headers[strtolower($value['name'])]);
|
||||
$return->headers[strtolower($value['name'])][] = $value['value'];
|
||||
|
||||
} elseif (isset($return->headers[strtolower($value['name'])])) {
|
||||
$return->headers[strtolower($value['name'])][] = $value['value'];
|
||||
|
||||
} else {
|
||||
$return->headers[strtolower($value['name'])] = $value['value'];
|
||||
}
|
||||
}
|
||||
|
||||
reset($headers);
|
||||
while (list($key, $value) = each($headers)) {
|
||||
$headers[$key]['name'] = strtolower($headers[$key]['name']);
|
||||
switch ($headers[$key]['name']) {
|
||||
|
||||
case 'content-type':
|
||||
$content_type = $this->_parseHeaderValue($headers[$key]['value']);
|
||||
|
||||
if (preg_match('/([0-9a-z+.-]+)\/([0-9a-z+.-]+)/i', $content_type['value'], $regs)) {
|
||||
$return->ctype_primary = $regs[1];
|
||||
$return->ctype_secondary = $regs[2];
|
||||
}
|
||||
|
||||
if (isset($content_type['other'])) {
|
||||
while (list($p_name, $p_value) = each($content_type['other'])) {
|
||||
$return->ctype_parameters[$p_name] = $p_value;
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
case 'content-disposition':
|
||||
$content_disposition = $this->_parseHeaderValue($headers[$key]['value']);
|
||||
$return->disposition = $content_disposition['value'];
|
||||
if (isset($content_disposition['other'])) {
|
||||
while (list($p_name, $p_value) = each($content_disposition['other'])) {
|
||||
$return->d_parameters[$p_name] = $p_value;
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
case 'content-transfer-encoding':
|
||||
$content_transfer_encoding = $this->_parseHeaderValue($headers[$key]['value']);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (isset($content_type)) {
|
||||
switch (strtolower($content_type['value'])) {
|
||||
case 'text/plain':
|
||||
$encoding = isset($content_transfer_encoding) ? $content_transfer_encoding['value'] : '7bit';
|
||||
$this->_include_bodies ? $return->body = ($this->_decode_bodies ? $this->_decodeBody($body, $encoding) : $body) : null;
|
||||
break;
|
||||
|
||||
case 'text/html':
|
||||
$encoding = isset($content_transfer_encoding) ? $content_transfer_encoding['value'] : '7bit';
|
||||
$this->_include_bodies ? $return->body = ($this->_decode_bodies ? $this->_decodeBody($body, $encoding) : $body) : null;
|
||||
break;
|
||||
|
||||
case 'multipart/parallel':
|
||||
case 'multipart/appledouble': // Appledouble mail
|
||||
case 'multipart/report': // RFC1892
|
||||
case 'multipart/signed': // PGP
|
||||
case 'multipart/digest':
|
||||
case 'multipart/alternative':
|
||||
case 'multipart/related':
|
||||
case 'multipart/mixed':
|
||||
if(!isset($content_type['other']['boundary'])){
|
||||
$this->_error = 'No boundary found for ' . $content_type['value'] . ' part';
|
||||
return false;
|
||||
}
|
||||
|
||||
$default_ctype = (strtolower($content_type['value']) === 'multipart/digest') ? 'message/rfc822' : 'text/plain';
|
||||
|
||||
$parts = $this->_boundarySplit($body, $content_type['other']['boundary']);
|
||||
for ($i = 0; $i < count($parts); $i++) {
|
||||
list($part_header, $part_body) = $this->_splitBodyHeader($parts[$i]);
|
||||
$part = $this->_decode($part_header, $part_body, $default_ctype);
|
||||
if($part === false)
|
||||
$part = $this->raiseError($this->_error);
|
||||
$return->parts[] = $part;
|
||||
}
|
||||
break;
|
||||
|
||||
case 'message/rfc822':
|
||||
if ($this->_rfc822_bodies) {
|
||||
$encoding = isset($content_transfer_encoding) ? $content_transfer_encoding['value'] : '7bit';
|
||||
$return->body = ($this->_decode_bodies ? $this->_decodeBody($body, $encoding) : $body);
|
||||
}
|
||||
$obj = &new Mail_mimeDecode($body);
|
||||
$return->parts[] = $obj->decode(array('include_bodies' => $this->_include_bodies,
|
||||
'decode_bodies' => $this->_decode_bodies,
|
||||
'decode_headers' => $this->_decode_headers));
|
||||
unset($obj);
|
||||
break;
|
||||
|
||||
default:
|
||||
if(!isset($content_transfer_encoding['value']))
|
||||
$content_transfer_encoding['value'] = '7bit';
|
||||
$this->_include_bodies ? $return->body = ($this->_decode_bodies ? $this->_decodeBody($body, $content_transfer_encoding['value']) : $body) : null;
|
||||
break;
|
||||
}
|
||||
|
||||
} else {
|
||||
$ctype = explode('/', $default_ctype);
|
||||
$return->ctype_primary = $ctype[0];
|
||||
$return->ctype_secondary = $ctype[1];
|
||||
$this->_include_bodies ? $return->body = ($this->_decode_bodies ? $this->_decodeBody($body) : $body) : null;
|
||||
}
|
||||
|
||||
return $return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Given the output of the above function, this will return an
|
||||
* array of references to the parts, indexed by mime number.
|
||||
*
|
||||
* @param object $structure The structure to go through
|
||||
* @param string $mime_number Internal use only.
|
||||
* @return array Mime numbers
|
||||
*/
|
||||
function &getMimeNumbers(&$structure, $no_refs = false, $mime_number = '', $prepend = '')
|
||||
{
|
||||
$return = array();
|
||||
if (!empty($structure->parts)) {
|
||||
if ($mime_number != '') {
|
||||
$structure->mime_id = $prepend . $mime_number;
|
||||
$return[$prepend . $mime_number] = &$structure;
|
||||
}
|
||||
for ($i = 0; $i < count($structure->parts); $i++) {
|
||||
|
||||
|
||||
if (!empty($structure->headers['content-type']) AND substr(strtolower($structure->headers['content-type']), 0, 8) == 'message/') {
|
||||
$prepend = $prepend . $mime_number . '.';
|
||||
$_mime_number = '';
|
||||
} else {
|
||||
$_mime_number = ($mime_number == '' ? $i + 1 : sprintf('%s.%s', $mime_number, $i + 1));
|
||||
}
|
||||
|
||||
$arr = &Mail_mimeDecode::getMimeNumbers($structure->parts[$i], $no_refs, $_mime_number, $prepend);
|
||||
foreach ($arr as $key => $val) {
|
||||
$no_refs ? $return[$key] = '' : $return[$key] = &$arr[$key];
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if ($mime_number == '') {
|
||||
$mime_number = '1';
|
||||
}
|
||||
$structure->mime_id = $prepend . $mime_number;
|
||||
$no_refs ? $return[$prepend . $mime_number] = '' : $return[$prepend . $mime_number] = &$structure;
|
||||
}
|
||||
|
||||
return $return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Given a string containing a header and body
|
||||
* section, this function will split them (at the first
|
||||
* blank line) and return them.
|
||||
*
|
||||
* @param string Input to split apart
|
||||
* @return array Contains header and body section
|
||||
* @access private
|
||||
*/
|
||||
function _splitBodyHeader($input)
|
||||
{
|
||||
if (preg_match("/^(.*?)\r?\n\r?\n(.*)/s", $input, $match)) {
|
||||
return array($match[1], $match[2]);
|
||||
}
|
||||
$this->_error = 'Could not split header and body';
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Parse headers given in $input and return
|
||||
* as assoc array.
|
||||
*
|
||||
* @param string Headers to parse
|
||||
* @return array Contains parsed headers
|
||||
* @access private
|
||||
*/
|
||||
function _parseHeaders($input)
|
||||
{
|
||||
|
||||
if ($input !== '') {
|
||||
// Unfold the input
|
||||
$input = preg_replace("/\r?\n/", "\r\n", $input);
|
||||
$input = preg_replace("/\r\n(\t| )+/", ' ', $input);
|
||||
$headers = explode("\r\n", trim($input));
|
||||
|
||||
foreach ($headers as $value) {
|
||||
$hdr_name = substr($value, 0, $pos = strpos($value, ':'));
|
||||
$hdr_value = substr($value, $pos+1);
|
||||
if($hdr_value[0] == ' ')
|
||||
$hdr_value = substr($hdr_value, 1);
|
||||
|
||||
$return[] = array(
|
||||
'name' => $hdr_name,
|
||||
'value' => $this->_decode_headers ? $this->_decodeHeader($hdr_value) : $hdr_value
|
||||
);
|
||||
}
|
||||
} else {
|
||||
$return = array();
|
||||
}
|
||||
|
||||
return $return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Function to parse a header value,
|
||||
* extract first part, and any secondary
|
||||
* parts (after ;) This function is not as
|
||||
* robust as it could be. Eg. header comments
|
||||
* in the wrong place will probably break it.
|
||||
*
|
||||
* @param string Header value to parse
|
||||
* @return array Contains parsed result
|
||||
* @access private
|
||||
*/
|
||||
function _parseHeaderValue($input)
|
||||
{
|
||||
|
||||
if (($pos = strpos($input, ';')) !== false) {
|
||||
|
||||
$return['value'] = trim(substr($input, 0, $pos));
|
||||
$input = trim(substr($input, $pos+1));
|
||||
|
||||
if (strlen($input) > 0) {
|
||||
|
||||
// This splits on a semi-colon, if there's no preceeding backslash
|
||||
// Now works with quoted values; had to glue the \; breaks in PHP
|
||||
// the regex is already bordering on incomprehensible
|
||||
$splitRegex = '/([^;\'"]*[\'"]([^\'"]*([^\'"]*)*)[\'"][^;\'"]*|([^;]+))(;|$)/';
|
||||
preg_match_all($splitRegex, $input, $matches);
|
||||
$parameters = array();
|
||||
for ($i=0; $i<count($matches[0]); $i++) {
|
||||
$param = $matches[0][$i];
|
||||
while (substr($param, -2) == '\;') {
|
||||
$param .= $matches[0][++$i];
|
||||
}
|
||||
$parameters[] = $param;
|
||||
}
|
||||
|
||||
for ($i = 0; $i < count($parameters); $i++) {
|
||||
$param_name = trim(substr($parameters[$i], 0, $pos = strpos($parameters[$i], '=')), "'\";\t\\ ");
|
||||
$param_value = trim(str_replace('\;', ';', substr($parameters[$i], $pos + 1)), "'\";\t\\ ");
|
||||
if (!empty($param_value[0]) && $param_value[0] == '"') {
|
||||
$param_value = substr($param_value, 1, -1);
|
||||
}
|
||||
$return['other'][$param_name] = $param_value;
|
||||
$return['other'][strtolower($param_name)] = $param_value;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
$return['value'] = trim($input);
|
||||
}
|
||||
|
||||
return $return;
|
||||
}
|
||||
|
||||
/**
|
||||
* This function splits the input based
|
||||
* on the given boundary
|
||||
*
|
||||
* @param string Input to parse
|
||||
* @return array Contains array of resulting mime parts
|
||||
* @access private
|
||||
*/
|
||||
function _boundarySplit($input, $boundary)
|
||||
{
|
||||
$parts = array();
|
||||
|
||||
$bs_possible = substr($boundary, 2, -2);
|
||||
$bs_check = '\"' . $bs_possible . '\"';
|
||||
|
||||
if ($boundary == $bs_check) {
|
||||
$boundary = $bs_possible;
|
||||
}
|
||||
|
||||
$tmp = explode('--' . $boundary, $input);
|
||||
|
||||
for ($i = 1; $i < count($tmp) - 1; $i++) {
|
||||
$parts[] = $tmp[$i];
|
||||
}
|
||||
|
||||
return $parts;
|
||||
}
|
||||
|
||||
/**
|
||||
* Given a header, this function will decode it
|
||||
* according to RFC2047. Probably not *exactly*
|
||||
* conformant, but it does pass all the given
|
||||
* examples (in RFC2047).
|
||||
*
|
||||
* @param string Input header value to decode
|
||||
* @return string Decoded header value
|
||||
* @access private
|
||||
*/
|
||||
function _decodeHeader($input)
|
||||
{
|
||||
// Remove white space between encoded-words
|
||||
$input = preg_replace('/(=\?[^?]+\?(q|b)\?[^?]*\?=)(\s)+=\?/i', '\1=?', $input);
|
||||
|
||||
// For each encoded-word...
|
||||
while (preg_match('/(=\?([^?]+)\?(q|b)\?([^?]*)\?=)/i', $input, $matches)) {
|
||||
|
||||
$encoded = $matches[1];
|
||||
$charset = $matches[2];
|
||||
$encoding = $matches[3];
|
||||
$text = $matches[4];
|
||||
|
||||
switch (strtolower($encoding)) {
|
||||
case 'b':
|
||||
$text = base64_decode($text);
|
||||
break;
|
||||
|
||||
case 'q':
|
||||
$text = str_replace('_', ' ', $text);
|
||||
preg_match_all('/=([a-f0-9]{2})/i', $text, $matches);
|
||||
foreach($matches[1] as $value)
|
||||
$text = str_replace('='.$value, chr(hexdec($value)), $text);
|
||||
break;
|
||||
}
|
||||
|
||||
$input = str_replace($encoded, $text, $input);
|
||||
}
|
||||
|
||||
return $input;
|
||||
}
|
||||
|
||||
/**
|
||||
* Given a body string and an encoding type,
|
||||
* this function will decode and return it.
|
||||
*
|
||||
* @param string Input body to decode
|
||||
* @param string Encoding type to use.
|
||||
* @return string Decoded body
|
||||
* @access private
|
||||
*/
|
||||
function _decodeBody($input, $encoding = '7bit')
|
||||
{
|
||||
switch (strtolower($encoding)) {
|
||||
case '7bit':
|
||||
return $input;
|
||||
break;
|
||||
|
||||
case 'quoted-printable':
|
||||
return $this->_quotedPrintableDecode($input);
|
||||
break;
|
||||
|
||||
case 'base64':
|
||||
return base64_decode($input);
|
||||
break;
|
||||
|
||||
default:
|
||||
return $input;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Given a quoted-printable string, this
|
||||
* function will decode and return it.
|
||||
*
|
||||
* @param string Input body to decode
|
||||
* @return string Decoded body
|
||||
* @access private
|
||||
*/
|
||||
function _quotedPrintableDecode($input)
|
||||
{
|
||||
// Remove soft line breaks
|
||||
$input = preg_replace("/=\r?\n/", '', $input);
|
||||
|
||||
// Replace encoded characters
|
||||
$input = preg_replace('/=([a-f0-9]{2})/ie', "chr(hexdec('\\1'))", $input);
|
||||
|
||||
return $input;
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks the input for uuencoded files and returns
|
||||
* an array of them. Can be called statically, eg:
|
||||
*
|
||||
* $files =& Mail_mimeDecode::uudecode($some_text);
|
||||
*
|
||||
* It will check for the begin 666 ... end syntax
|
||||
* however and won't just blindly decode whatever you
|
||||
* pass it.
|
||||
*
|
||||
* @param string Input body to look for attahcments in
|
||||
* @return array Decoded bodies, filenames and permissions
|
||||
* @access public
|
||||
* @author Unknown
|
||||
*/
|
||||
function &uudecode($input)
|
||||
{
|
||||
// Find all uuencoded sections
|
||||
preg_match_all("/begin ([0-7]{3}) (.+)\r?\n(.+)\r?\nend/Us", $input, $matches);
|
||||
|
||||
for ($j = 0; $j < count($matches[3]); $j++) {
|
||||
|
||||
$str = $matches[3][$j];
|
||||
$filename = $matches[2][$j];
|
||||
$fileperm = $matches[1][$j];
|
||||
|
||||
$file = '';
|
||||
$str = preg_split("/\r?\n/", trim($str));
|
||||
$strlen = count($str);
|
||||
|
||||
for ($i = 0; $i < $strlen; $i++) {
|
||||
$pos = 1;
|
||||
$d = 0;
|
||||
$len=(int)(((ord(substr($str[$i],0,1)) -32) - ' ') & 077);
|
||||
|
||||
while (($d + 3 <= $len) AND ($pos + 4 <= strlen($str[$i]))) {
|
||||
$c0 = (ord(substr($str[$i],$pos,1)) ^ 0x20);
|
||||
$c1 = (ord(substr($str[$i],$pos+1,1)) ^ 0x20);
|
||||
$c2 = (ord(substr($str[$i],$pos+2,1)) ^ 0x20);
|
||||
$c3 = (ord(substr($str[$i],$pos+3,1)) ^ 0x20);
|
||||
$file .= chr(((($c0 - ' ') & 077) << 2) | ((($c1 - ' ') & 077) >> 4));
|
||||
|
||||
$file .= chr(((($c1 - ' ') & 077) << 4) | ((($c2 - ' ') & 077) >> 2));
|
||||
|
||||
$file .= chr(((($c2 - ' ') & 077) << 6) | (($c3 - ' ') & 077));
|
||||
|
||||
$pos += 4;
|
||||
$d += 3;
|
||||
}
|
||||
|
||||
if (($d + 2 <= $len) && ($pos + 3 <= strlen($str[$i]))) {
|
||||
$c0 = (ord(substr($str[$i],$pos,1)) ^ 0x20);
|
||||
$c1 = (ord(substr($str[$i],$pos+1,1)) ^ 0x20);
|
||||
$c2 = (ord(substr($str[$i],$pos+2,1)) ^ 0x20);
|
||||
$file .= chr(((($c0 - ' ') & 077) << 2) | ((($c1 - ' ') & 077) >> 4));
|
||||
|
||||
$file .= chr(((($c1 - ' ') & 077) << 4) | ((($c2 - ' ') & 077) >> 2));
|
||||
|
||||
$pos += 3;
|
||||
$d += 2;
|
||||
}
|
||||
|
||||
if (($d + 1 <= $len) && ($pos + 2 <= strlen($str[$i]))) {
|
||||
$c0 = (ord(substr($str[$i],$pos,1)) ^ 0x20);
|
||||
$c1 = (ord(substr($str[$i],$pos+1,1)) ^ 0x20);
|
||||
$file .= chr(((($c0 - ' ') & 077) << 2) | ((($c1 - ' ') & 077) >> 4));
|
||||
|
||||
}
|
||||
}
|
||||
$files[] = array('filename' => $filename, 'fileperm' => $fileperm, 'filedata' => $file);
|
||||
}
|
||||
|
||||
return $files;
|
||||
}
|
||||
|
||||
/**
|
||||
* getSendArray() returns the arguments required for Mail::send()
|
||||
* used to build the arguments for a mail::send() call
|
||||
*
|
||||
* Usage:
|
||||
* $mailtext = Full email (for example generated by a template)
|
||||
* $decoder = new Mail_mimeDecode($mailtext);
|
||||
* $parts = $decoder->getSendArray();
|
||||
* if (!PEAR::isError($parts) {
|
||||
* list($recipents,$headers,$body) = $parts;
|
||||
* $mail = Mail::factory('smtp');
|
||||
* $mail->send($recipents,$headers,$body);
|
||||
* } else {
|
||||
* echo $parts->message;
|
||||
* }
|
||||
* @return mixed array of recipeint, headers,body or Pear_Error
|
||||
* @access public
|
||||
* @author Alan Knowles <alan@akbkhome.com>
|
||||
*/
|
||||
function getSendArray()
|
||||
{
|
||||
// prevent warning if this is not set
|
||||
$this->_decode_headers = FALSE;
|
||||
$headerlist =$this->_parseHeaders($this->_header);
|
||||
$to = "";
|
||||
if (!$headerlist) {
|
||||
return $this->raiseError("Message did not contain headers");
|
||||
}
|
||||
foreach($headerlist as $item) {
|
||||
$header[$item['name']] = $item['value'];
|
||||
switch (strtolower($item['name'])) {
|
||||
case "to":
|
||||
case "cc":
|
||||
case "bcc":
|
||||
$to .= ",".$item['value'];
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
if ($to == "") {
|
||||
return $this->raiseError("Message did not contain any recipents");
|
||||
}
|
||||
$to = substr($to,1);
|
||||
return array($to,$header,$this->_body);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a xml copy of the output of
|
||||
* Mail_mimeDecode::decode. Pass the output in as the
|
||||
* argument. This function can be called statically. Eg:
|
||||
*
|
||||
* $output = $obj->decode();
|
||||
* $xml = Mail_mimeDecode::getXML($output);
|
||||
*
|
||||
* The DTD used for this should have been in the package. Or
|
||||
* alternatively you can get it from cvs, or here:
|
||||
* http://www.phpguru.org/xmail/xmail.dtd.
|
||||
*
|
||||
* @param object Input to convert to xml. This should be the
|
||||
* output of the Mail_mimeDecode::decode function
|
||||
* @return string XML version of input
|
||||
* @access public
|
||||
*/
|
||||
function getXML($input)
|
||||
{
|
||||
$crlf = "\r\n";
|
||||
$output = '<?xml version=\'1.0\'?>' . $crlf .
|
||||
'<!DOCTYPE email SYSTEM "http://www.phpguru.org/xmail/xmail.dtd">' . $crlf .
|
||||
'<email>' . $crlf .
|
||||
Mail_mimeDecode::_getXML($input) .
|
||||
'</email>';
|
||||
|
||||
return $output;
|
||||
}
|
||||
|
||||
/**
|
||||
* Function that does the actual conversion to xml. Does a single
|
||||
* mimepart at a time.
|
||||
*
|
||||
* @param object Input to convert to xml. This is a mimepart object.
|
||||
* It may or may not contain subparts.
|
||||
* @param integer Number of tabs to indent
|
||||
* @return string XML version of input
|
||||
* @access private
|
||||
*/
|
||||
function _getXML($input, $indent = 1)
|
||||
{
|
||||
$htab = "\t";
|
||||
$crlf = "\r\n";
|
||||
$output = '';
|
||||
$headers = @(array)$input->headers;
|
||||
|
||||
foreach ($headers as $hdr_name => $hdr_value) {
|
||||
|
||||
// Multiple headers with this name
|
||||
if (is_array($headers[$hdr_name])) {
|
||||
for ($i = 0; $i < count($hdr_value); $i++) {
|
||||
$output .= Mail_mimeDecode::_getXML_helper($hdr_name, $hdr_value[$i], $indent);
|
||||
}
|
||||
|
||||
// Only one header of this sort
|
||||
} else {
|
||||
$output .= Mail_mimeDecode::_getXML_helper($hdr_name, $hdr_value, $indent);
|
||||
}
|
||||
}
|
||||
|
||||
if (!empty($input->parts)) {
|
||||
for ($i = 0; $i < count($input->parts); $i++) {
|
||||
$output .= $crlf . str_repeat($htab, $indent) . '<mimepart>' . $crlf .
|
||||
Mail_mimeDecode::_getXML($input->parts[$i], $indent+1) .
|
||||
str_repeat($htab, $indent) . '</mimepart>' . $crlf;
|
||||
}
|
||||
} elseif (isset($input->body)) {
|
||||
$output .= $crlf . str_repeat($htab, $indent) . '<body><![CDATA[' .
|
||||
$input->body . ']]></body>' . $crlf;
|
||||
}
|
||||
|
||||
return $output;
|
||||
}
|
||||
|
||||
/**
|
||||
* Helper function to _getXML(). Returns xml of a header.
|
||||
*
|
||||
* @param string Name of header
|
||||
* @param string Value of header
|
||||
* @param integer Number of tabs to indent
|
||||
* @return string XML version of input
|
||||
* @access private
|
||||
*/
|
||||
function _getXML_helper($hdr_name, $hdr_value, $indent)
|
||||
{
|
||||
$htab = "\t";
|
||||
$crlf = "\r\n";
|
||||
$return = '';
|
||||
|
||||
$new_hdr_value = ($hdr_name != 'received') ? Mail_mimeDecode::_parseHeaderValue($hdr_value) : array('value' => $hdr_value);
|
||||
$new_hdr_name = str_replace(' ', '-', ucwords(str_replace('-', ' ', $hdr_name)));
|
||||
|
||||
// Sort out any parameters
|
||||
if (!empty($new_hdr_value['other'])) {
|
||||
foreach ($new_hdr_value['other'] as $paramname => $paramvalue) {
|
||||
$params[] = str_repeat($htab, $indent) . $htab . '<parameter>' . $crlf .
|
||||
str_repeat($htab, $indent) . $htab . $htab . '<paramname>' . htmlspecialchars($paramname) . '</paramname>' . $crlf .
|
||||
str_repeat($htab, $indent) . $htab . $htab . '<paramvalue>' . htmlspecialchars($paramvalue) . '</paramvalue>' . $crlf .
|
||||
str_repeat($htab, $indent) . $htab . '</parameter>' . $crlf;
|
||||
}
|
||||
|
||||
$params = implode('', $params);
|
||||
} else {
|
||||
$params = '';
|
||||
}
|
||||
|
||||
$return = str_repeat($htab, $indent) . '<header>' . $crlf .
|
||||
str_repeat($htab, $indent) . $htab . '<headername>' . htmlspecialchars($new_hdr_name) . '</headername>' . $crlf .
|
||||
str_repeat($htab, $indent) . $htab . '<headervalue>' . htmlspecialchars($new_hdr_value['value']) . '</headervalue>' . $crlf .
|
||||
$params .
|
||||
str_repeat($htab, $indent) . '</header>' . $crlf;
|
||||
|
||||
return $return;
|
||||
}
|
||||
|
||||
} // End of class
|
||||
File diff suppressed because it is too large.
Load diff
@@ -0,0 +1,19 @@
|
||||
<?xml version="1.0" encoding="ISO-8859-1"?>
|
||||
|
||||
<!ENTITY lt "&#60;">
|
||||
<!ENTITY gt ">">
|
||||
<!ENTITY amp "&#38;">
|
||||
<!ENTITY apos "'">
|
||||
<!ENTITY quot """>
|
||||
<!ENTITY crlf " ">
|
||||
|
||||
<!ELEMENT email (header+, (body | mimepart+))>
|
||||
<!ELEMENT mimepart (header+, (body | mimepart+))>
|
||||
<!ELEMENT body (#PCDATA)>
|
||||
<!ELEMENT header ((headername|headervalue|parameter)*)>
|
||||
<!ELEMENT headername (#PCDATA)>
|
||||
<!ELEMENT headervalue (#PCDATA)>
|
||||
<!ELEMENT parameter ((paramname|paramvalue)+)>
|
||||
<!ELEMENT paramvalue (#PCDATA)>
|
||||
<!ELEMENT paramname (#PCDATA)>
|
||||
|
||||
@@ -0,0 +1,70 @@
|
||||
<?xml version="1.0" encoding="ISO-8859-1"?>
|
||||
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:fo="http://www.w3.org/1999/XSL/Format">
|
||||
<xsl:output method="text" omit-xml-declaration="yes" indent="no"/>
|
||||
<xsl:preserve-space elements="headervalue paramvalue body"/>
|
||||
|
||||
<xsl:template name="mimepart">
|
||||
|
||||
<xsl:variable name="boundary">
|
||||
<xsl:for-each select="./header">
|
||||
<xsl:if test="string(./headername) = 'Content-Type'">
|
||||
<xsl:for-each select="./parameter">
|
||||
<xsl:if test="string(./paramname) = 'boundary'">
|
||||
<xsl:value-of select="paramvalue"/>
|
||||
</xsl:if>
|
||||
</xsl:for-each>
|
||||
</xsl:if>
|
||||
</xsl:for-each>
|
||||
</xsl:variable>
|
||||
|
||||
<xsl:for-each select="header">
|
||||
|
||||
<xsl:value-of select="headername"/>
|
||||
<xsl:text>: </xsl:text>
|
||||
<xsl:value-of select="headervalue"/>
|
||||
|
||||
<xsl:if test="count(./parameter) = 0">
|
||||
<xsl:text> </xsl:text>
|
||||
</xsl:if>
|
||||
|
||||
<xsl:for-each select="parameter">
|
||||
<xsl:text>; 	</xsl:text>
|
||||
<xsl:value-of select="paramname"/>
|
||||
<xsl:text>="</xsl:text>
|
||||
<xsl:value-of select="paramvalue"/>
|
||||
<xsl:text>"</xsl:text>
|
||||
</xsl:for-each>
|
||||
|
||||
<xsl:if test="count(./parameter) > 0">
|
||||
<xsl:text> </xsl:text>
|
||||
</xsl:if>
|
||||
|
||||
</xsl:for-each>
|
||||
|
||||
<xsl:text> </xsl:text>
|
||||
|
||||
<!-- Which to do, print a body or process subparts? -->
|
||||
<xsl:choose>
|
||||
<xsl:when test="count(./mimepart) = 0">
|
||||
<xsl:value-of select="body"/>
|
||||
<xsl:text> </xsl:text>
|
||||
</xsl:when>
|
||||
|
||||
<xsl:otherwise>
|
||||
<xsl:for-each select="mimepart">
|
||||
<xsl:text>--</xsl:text><xsl:value-of select="$boundary"/><xsl:text> </xsl:text>
|
||||
<xsl:call-template name="mimepart"/>
|
||||
</xsl:for-each>
|
||||
|
||||
<xsl:text>--</xsl:text><xsl:value-of select="$boundary"/><xsl:text>-- </xsl:text>
|
||||
|
||||
</xsl:otherwise>
|
||||
</xsl:choose>
|
||||
</xsl:template>
|
||||
|
||||
<!-- This is where the stylesheet really starts, matching the top level email element -->
|
||||
<xsl:template match="email">
|
||||
<xsl:call-template name="mimepart"/>
|
||||
</xsl:template>
|
||||
|
||||
</xsl:stylesheet>
|
||||
@@ -6,10 +6,10 @@
|
||||
* The original PHP version of this code was written by Geoffrey T. Dairiki
|
||||
* <dairiki@dairiki.org>, and is used/adapted with his permission.
|
||||
*
|
||||
* $Horde: framework/Text_Diff/Diff.php,v 1.11.2.11 2008/02/24 10:57:46 jan Exp $
|
||||
* $Horde: framework/Text_Diff/Diff.php,v 1.11.2.12 2009/01/06 15:23:41 jan Exp $
|
||||
*
|
||||
* Copyright 2004 Geoffrey T. Dairiki <dairiki@dairiki.org>
|
||||
* Copyright 2004-2008 The Horde Project (http://www.horde.org/)
|
||||
* Copyright 2004-2009 The Horde Project (http://www.horde.org/)
|
||||
*
|
||||
* See the enclosed file COPYING for license information (LGPL). If you did
|
||||
* not receive this file, see http://opensource.org/licenses/lgpl-license.php.
|
||||
@@ -208,7 +208,7 @@ class Text_Diff {
|
||||
* @param string $line The line to trim.
|
||||
* @param integer $key The index of the line in the array. Not used.
|
||||
*/
|
||||
function trimNewlines(&$line, $key)
|
||||
function trimNewlines(&$line, $key='')
|
||||
{
|
||||
$line = str_replace(array("\n", "\r"), '', $line);
|
||||
}
|
||||
@@ -380,7 +380,7 @@ class Text_Diff_Op_copy extends Text_Diff_Op {
|
||||
|
||||
function &reverse()
|
||||
{
|
||||
$reverse = new Text_Diff_Op_copy($this->final, $this->orig);
|
||||
$reverse = &new Text_Diff_Op_copy($this->final, $this->orig);
|
||||
return $reverse;
|
||||
}
|
||||
|
||||
@@ -402,7 +402,7 @@ class Text_Diff_Op_delete extends Text_Diff_Op {
|
||||
|
||||
function &reverse()
|
||||
{
|
||||
$reverse = new Text_Diff_Op_add($this->orig);
|
||||
$reverse = &new Text_Diff_Op_add($this->orig);
|
||||
return $reverse;
|
||||
}
|
||||
|
||||
@@ -424,7 +424,7 @@ class Text_Diff_Op_add extends Text_Diff_Op {
|
||||
|
||||
function &reverse()
|
||||
{
|
||||
$reverse = new Text_Diff_Op_delete($this->final);
|
||||
$reverse = &new Text_Diff_Op_delete($this->final);
|
||||
return $reverse;
|
||||
}
|
||||
|
||||
@@ -446,7 +446,7 @@ class Text_Diff_Op_change extends Text_Diff_Op {
|
||||
|
||||
function &reverse()
|
||||
{
|
||||
$reverse = new Text_Diff_Op_change($this->final, $this->orig);
|
||||
$reverse = &new Text_Diff_Op_change($this->final, $this->orig);
|
||||
return $reverse;
|
||||
}
|
||||
|
||||
|
||||
@@ -1 +1,10 @@
|
||||
<html>␍<head><title>IP.Board - Bulletin Board System</title></head>␍<body>␍<h1>403: IP.Board -> Forbidden</h1>␍<hr>␍You have reached this page in error, please use your back button to return to the forum.␍<hr>␍<a href="http://www.invisionboard.com/">IP.Board</a>␍</body>␍</html>␍
|
||||
<html>
|
||||
<head><title>IP.Board - Bulletin Board System</title></head>
|
||||
<body>
|
||||
<h1>403: IP.Board -> Forbidden</h1>
|
||||
<hr>
|
||||
You have reached this page in error, please use your back button to return to the forum.
|
||||
<hr>
|
||||
<a href="http://www.invisionboard.com/">IP.Board</a>
|
||||
</body>
|
||||
</html>
|
||||
@@ -18,9 +18,9 @@
|
||||
* Geoffrey T. Dairiki <dairiki@dairiki.org>. The original PHP version of this
|
||||
* code was written by him, and is used/adapted with his permission.
|
||||
*
|
||||
* $Horde: framework/Text_Diff/Diff/Engine/native.php,v 1.7.2.4 2008/01/04 10:38:10 jan Exp $
|
||||
* $Horde: framework/Text_Diff/Diff/Engine/native.php,v 1.7.2.5 2009/01/06 15:23:41 jan Exp $
|
||||
*
|
||||
* Copyright 2004-2008 The Horde Project (http://www.horde.org/)
|
||||
* Copyright 2004-2009 The Horde Project (http://www.horde.org/)
|
||||
*
|
||||
* See the enclosed file COPYING for license information (LGPL). If you did
|
||||
* not receive this file, see http://opensource.org/licenses/lgpl-license.php.
|
||||
@@ -32,9 +32,22 @@ class Text_Diff_Engine_native {
|
||||
|
||||
function diff($from_lines, $to_lines)
|
||||
{
|
||||
array_walk($from_lines, array('Text_Diff', 'trimNewlines'));
|
||||
array_walk($to_lines, array('Text_Diff', 'trimNewlines'));
|
||||
|
||||
$_f = array();
|
||||
$_t = array();
|
||||
|
||||
foreach( $from_lines as $l )
|
||||
{
|
||||
$_f[] = str_replace(array("\n", "\r"), '', $l);
|
||||
}
|
||||
|
||||
foreach( $to_lines as $l )
|
||||
{
|
||||
$_t[] = str_replace(array("\n", "\r"), '', $l);
|
||||
}
|
||||
|
||||
$from_lines = $_f;
|
||||
$to_lines = $_t;
|
||||
|
||||
$n_from = count($from_lines);
|
||||
$n_to = count($to_lines);
|
||||
|
||||
@@ -106,7 +119,7 @@ class Text_Diff_Engine_native {
|
||||
++$yi;
|
||||
}
|
||||
if ($copy) {
|
||||
$edits[] = new Text_Diff_Op_copy($copy);
|
||||
$edits[] = &new Text_Diff_Op_copy($copy);
|
||||
}
|
||||
|
||||
// Find deletes & adds.
|
||||
@@ -121,11 +134,11 @@ class Text_Diff_Engine_native {
|
||||
}
|
||||
|
||||
if ($delete && $add) {
|
||||
$edits[] = new Text_Diff_Op_change($delete, $add);
|
||||
$edits[] = &new Text_Diff_Op_change($delete, $add);
|
||||
} elseif ($delete) {
|
||||
$edits[] = new Text_Diff_Op_delete($delete);
|
||||
$edits[] = &new Text_Diff_Op_delete($delete);
|
||||
} elseif ($add) {
|
||||
$edits[] = new Text_Diff_Op_add($add);
|
||||
$edits[] = &new Text_Diff_Op_add($add);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -5,9 +5,9 @@
|
||||
* This class uses the Unix `diff` program via shell_exec to compute the
|
||||
* differences between the two input arrays.
|
||||
*
|
||||
* $Horde: framework/Text_Diff/Diff/Engine/shell.php,v 1.6.2.3 2008/01/04 10:37:27 jan Exp $
|
||||
* $Horde: framework/Text_Diff/Diff/Engine/shell.php,v 1.6.2.4 2009/01/06 15:23:41 jan Exp $
|
||||
*
|
||||
* Copyright 2007-2008 The Horde Project (http://www.horde.org/)
|
||||
* Copyright 2007-2009 The Horde Project (http://www.horde.org/)
|
||||
*
|
||||
* See the enclosed file COPYING for license information (LGPL). If you did
|
||||
* not receive this file, see http://opensource.org/licenses/lgpl-license.php.
|
||||
|
||||
@@ -10,10 +10,10 @@
|
||||
* echo $renderer->render($diff);
|
||||
* </code>
|
||||
*
|
||||
* $Horde: framework/Text_Diff/Diff/Engine/string.php,v 1.5.2.5 2008/09/10 08:31:58 jan Exp $
|
||||
* $Horde: framework/Text_Diff/Diff/Engine/string.php,v 1.5.2.7 2009/07/24 13:04:43 jan Exp $
|
||||
*
|
||||
* Copyright 2005 Örjan Persson <o@42mm.org>
|
||||
* Copyright 2005-2008 The Horde Project (http://www.horde.org/)
|
||||
* Copyright 2005-2009 The Horde Project (http://www.horde.org/)
|
||||
*
|
||||
* See the enclosed file COPYING for license information (LGPL). If you did
|
||||
* not receive this file, see http://opensource.org/licenses/lgpl-license.php.
|
||||
@@ -39,6 +39,19 @@ class Text_Diff_Engine_string {
|
||||
*/
|
||||
function diff($diff, $mode = 'autodetect')
|
||||
{
|
||||
// Detect line breaks.
|
||||
$lnbr = "\n";
|
||||
if (strpos($diff, "\r\n") !== false) {
|
||||
$lnbr = "\r\n";
|
||||
} elseif (strpos($diff, "\r") !== false) {
|
||||
$lnbr = "\r";
|
||||
}
|
||||
|
||||
// Make sure we have a line break at the EOF.
|
||||
if (substr($diff, -strlen($lnbr)) != $lnbr) {
|
||||
$diff .= $lnbr;
|
||||
}
|
||||
|
||||
if ($mode != 'autodetect' && $mode != 'context' && $mode != 'unified') {
|
||||
return PEAR::raiseError('Type of diff is unsupported');
|
||||
}
|
||||
@@ -56,7 +69,7 @@ class Text_Diff_Engine_string {
|
||||
}
|
||||
|
||||
// Split by new line and remove the diff header, if there is one.
|
||||
$diff = explode("\n", $diff);
|
||||
$diff = explode($lnbr, $diff);
|
||||
if (($mode == 'context' && strpos($diff[0], '***') === 0) ||
|
||||
($mode == 'unified' && strpos($diff[0], '---') === 0)) {
|
||||
array_shift($diff);
|
||||
|
||||
@@ -5,9 +5,9 @@
|
||||
* This class uses the xdiff PECL package (http://pecl.php.net/package/xdiff)
|
||||
* to compute the differences between the two input arrays.
|
||||
*
|
||||
* $Horde: framework/Text_Diff/Diff/Engine/xdiff.php,v 1.4.2.3 2008/01/04 10:37:27 jan Exp $
|
||||
* $Horde: framework/Text_Diff/Diff/Engine/xdiff.php,v 1.4.2.5 2009/07/24 13:06:24 jan Exp $
|
||||
*
|
||||
* Copyright 2004-2008 The Horde Project (http://www.horde.org/)
|
||||
* Copyright 2004-2009 The Horde Project (http://www.horde.org/)
|
||||
*
|
||||
* See the enclosed file COPYING for license information (LGPL). If you did
|
||||
* not receive this file, see http://opensource.org/licenses/lgpl-license.php.
|
||||
@@ -42,17 +42,20 @@ class Text_Diff_Engine_xdiff {
|
||||
* valid, albeit a little less descriptive and efficient. */
|
||||
$edits = array();
|
||||
foreach ($diff as $line) {
|
||||
if (!strlen($line)) {
|
||||
continue;
|
||||
}
|
||||
switch ($line[0]) {
|
||||
case ' ':
|
||||
$edits[] = new Text_Diff_Op_copy(array(substr($line, 1)));
|
||||
$edits[] = &new Text_Diff_Op_copy(array(substr($line, 1)));
|
||||
break;
|
||||
|
||||
case '+':
|
||||
$edits[] = new Text_Diff_Op_add(array(substr($line, 1)));
|
||||
$edits[] = &new Text_Diff_Op_add(array(substr($line, 1)));
|
||||
break;
|
||||
|
||||
case '-':
|
||||
$edits[] = new Text_Diff_Op_delete(array(substr($line, 1)));
|
||||
$edits[] = &new Text_Diff_Op_delete(array(substr($line, 1)));
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
<?php
|
||||
/**
|
||||
* $Horde: framework/Text_Diff/Diff/Mapped.php,v 1.3.2.3 2008/01/04 10:37:27 jan Exp $
|
||||
* $Horde: framework/Text_Diff/Diff/Mapped.php,v 1.3.2.4 2009/01/06 15:23:41 jan Exp $
|
||||
*
|
||||
* Copyright 2007-2008 The Horde Project (http://www.horde.org/)
|
||||
* Copyright 2007-2009 The Horde Project (http://www.horde.org/)
|
||||
*
|
||||
* See the enclosed file COPYING for license information (LGPL). If you did
|
||||
* not receive this file, see http://opensource.org/licenses/lgpl-license.php.
|
||||
|
||||
@@ -5,9 +5,9 @@
|
||||
* This class renders the diff in classic diff format. It is intended that
|
||||
* this class be customized via inheritance, to obtain fancier outputs.
|
||||
*
|
||||
* $Horde: framework/Text_Diff/Diff/Renderer.php,v 1.5.10.10 2008/01/04 10:37:27 jan Exp $
|
||||
* $Horde: framework/Text_Diff/Diff/Renderer.php,v 1.5.10.12 2009/07/24 13:26:40 jan Exp $
|
||||
*
|
||||
* Copyright 2004-2008 The Horde Project (http://www.horde.org/)
|
||||
* Copyright 2004-2009 The Horde Project (http://www.horde.org/)
|
||||
*
|
||||
* See the enclosed file COPYING for license information (LGPL). If you did
|
||||
* not receive this file, see http://opensource.org/licenses/lgpl-license.php.
|
||||
@@ -81,6 +81,7 @@ class Text_Diff_Renderer {
|
||||
$output = $this->_startDiff();
|
||||
|
||||
$diffs = $diff->getDiff();
|
||||
|
||||
foreach ($diffs as $i => $edit) {
|
||||
/* If these are unchanged (copied) lines, and we want to keep
|
||||
* leading or trailing context lines, extract them from the copy
|
||||
@@ -100,9 +101,10 @@ class Text_Diff_Renderer {
|
||||
/* Create a new block with as many lines as we need
|
||||
* for the trailing context. */
|
||||
$context = array_slice($edit->orig, 0, $ntrail);
|
||||
|
||||
$block[] = new Text_Diff_Op_copy($context);
|
||||
}
|
||||
/* @todo */
|
||||
|
||||
$output .= $this->_block($x0, $ntrail + $xi - $x0,
|
||||
$y0, $ntrail + $yi - $y0,
|
||||
$block);
|
||||
@@ -148,6 +150,7 @@ class Text_Diff_Renderer {
|
||||
$output = $this->_startBlock($this->_blockHeader($xbeg, $xlen, $ybeg, $ylen));
|
||||
|
||||
foreach ($edits as $edit) {
|
||||
|
||||
switch (strtolower(get_class($edit))) {
|
||||
case 'text_diff_op_copy':
|
||||
$output .= $this->_context($edit->orig);
|
||||
@@ -201,7 +204,7 @@ class Text_Diff_Renderer {
|
||||
|
||||
function _startBlock($header)
|
||||
{
|
||||
return $header . "\n";
|
||||
return ( $header ) ? $header . "\n" : '';
|
||||
}
|
||||
|
||||
function _endBlock()
|
||||
|
||||
@@ -4,9 +4,9 @@
|
||||
*
|
||||
* This class renders the diff in classic "context diff" format.
|
||||
*
|
||||
* $Horde: framework/Text_Diff/Diff/Renderer/context.php,v 1.3.2.3 2008/01/04 10:37:27 jan Exp $
|
||||
* $Horde: framework/Text_Diff/Diff/Renderer/context.php,v 1.3.2.4 2009/01/06 15:23:42 jan Exp $
|
||||
*
|
||||
* Copyright 2004-2008 The Horde Project (http://www.horde.org/)
|
||||
* Copyright 2004-2009 The Horde Project (http://www.horde.org/)
|
||||
*
|
||||
* See the enclosed file COPYING for license information (LGPL). If you did
|
||||
* not receive this file, see http://opensource.org/licenses/lgpl-license.php.
|
||||
|
||||
@@ -1 +1,10 @@
|
||||
<html>␍<head><title>IP.Board - Bulletin Board System</title></head>␍<body>␍<h1>403: IP.Board -> Forbidden</h1>␍<hr>␍You have reached this page in error, please use your back button to return to the forum.␍<hr>␍<a href="http://www.invisionboard.com/">IP.Board</a>␍</body>␍</html>␍
|
||||
<html>
|
||||
<head><title>IP.Board - Bulletin Board System</title></head>
|
||||
<body>
|
||||
<h1>403: IP.Board -> Forbidden</h1>
|
||||
<hr>
|
||||
You have reached this page in error, please use your back button to return to the forum.
|
||||
<hr>
|
||||
<a href="http://www.invisionboard.com/">IP.Board</a>
|
||||
</body>
|
||||
</html>
|
||||
@@ -2,9 +2,9 @@
|
||||
/**
|
||||
* "Inline" diff renderer.
|
||||
*
|
||||
* $Horde: framework/Text_Diff/Diff/Renderer/inline.php,v 1.4.10.14 2008/01/04 10:37:27 jan Exp $
|
||||
* $Horde: framework/Text_Diff/Diff/Renderer/inline.php,v 1.4.10.16 2009/07/24 13:25:29 jan Exp $
|
||||
*
|
||||
* Copyright 2004-2008 The Horde Project (http://www.horde.org/)
|
||||
* Copyright 2004-2009 The Horde Project (http://www.horde.org/)
|
||||
*
|
||||
* See the enclosed file COPYING for license information (LGPL). If you did
|
||||
* not receive this file, see http://opensource.org/licenses/lgpl-license.php.
|
||||
@@ -131,12 +131,14 @@ class Text_Diff_Renderer_inline extends Text_Diff_Renderer {
|
||||
/* We want to split on word boundaries, but we need to
|
||||
* preserve whitespace as well. Therefore we split on words,
|
||||
* but include all blocks of whitespace in the wordlist. */
|
||||
$diff = new Text_Diff($this->_splitOnWords($text1, $nl),
|
||||
$this->_splitOnWords($text2, $nl));
|
||||
$diff = new Text_Diff('native',
|
||||
array($this->_splitOnWords($text1, $nl),
|
||||
$this->_splitOnWords($text2, $nl)));
|
||||
|
||||
/* Get the diff in inline format. */
|
||||
$renderer = new Text_Diff_Renderer_inline(array_merge($this->getParams(),
|
||||
array('split_level' => 'words')));
|
||||
$renderer = new Text_Diff_Renderer_inline
|
||||
(array_merge($this->getParams(),
|
||||
array('split_level' => 'words')));
|
||||
|
||||
/* Run the diff and get the output. */
|
||||
return str_replace($nl, "\n", $renderer->render($diff)) . "\n";
|
||||
|
||||
@@ -0,0 +1,68 @@
|
||||
<?php
|
||||
/**
|
||||
* "Unified" diff renderer.
|
||||
*
|
||||
* This class renders the diff in classic "unified diff" format.
|
||||
*
|
||||
* $Horde: framework/Text_Diff/Diff/Renderer/unified.php,v 1.3.10.7 2009/01/06 15:23:42 jan Exp $
|
||||
*
|
||||
* Copyright 2004-2009 The Horde Project (http://www.horde.org/)
|
||||
*
|
||||
* See the enclosed file COPYING for license information (LGPL). If you did
|
||||
* not receive this file, see http://opensource.org/licenses/lgpl-license.php.
|
||||
*
|
||||
* @author Ciprian Popovici
|
||||
* @package Text_Diff
|
||||
*/
|
||||
|
||||
/** Text_Diff_Renderer */
|
||||
require_once 'Text/Diff/Renderer.php';
|
||||
|
||||
/**
|
||||
* @package Text_Diff
|
||||
*/
|
||||
class Text_Diff_Renderer_ips3waymerge extends Text_Diff_Renderer {
|
||||
|
||||
/**
|
||||
* Number of leading context "lines" to preserve.
|
||||
*/
|
||||
var $_leading_context_lines = 10000;
|
||||
|
||||
/**
|
||||
* Number of trailing context "lines" to preserve.
|
||||
*/
|
||||
var $_trailing_context_lines = 10000;
|
||||
|
||||
function _blockHeader($xbeg, $xlen, $ybeg, $ylen)
|
||||
{
|
||||
if ($xlen != 1) {
|
||||
$xbeg .= ',' . $xlen;
|
||||
}
|
||||
if ($ylen != 1) {
|
||||
$ybeg .= ',' . $ylen;
|
||||
}
|
||||
|
||||
//return "@@ -$xbeg +$ybeg @@";
|
||||
}
|
||||
|
||||
function _context($lines)
|
||||
{
|
||||
return $this->_lines($lines, ' ');
|
||||
}
|
||||
|
||||
function _added($lines)
|
||||
{
|
||||
return $this->_lines($lines, '+');
|
||||
}
|
||||
|
||||
function _deleted($lines)
|
||||
{
|
||||
return $this->_lines($lines, '-');
|
||||
}
|
||||
|
||||
function _changed($orig, $final)
|
||||
{
|
||||
return $this->_deleted($orig) . $this->_added($final);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,115 @@
|
||||
<?php
|
||||
/**
|
||||
* "Inline" diff renderer.
|
||||
*
|
||||
* $Horde: framework/Text_Diff/Diff/Renderer/inline.php,v 1.4.10.16 2009/07/24 13:25:29 jan Exp $
|
||||
*
|
||||
* Copyright 2004-2009 The Horde Project (http://www.horde.org/)
|
||||
*
|
||||
* See the enclosed file COPYING for license information (LGPL). If you did
|
||||
* not receive this file, see http://opensource.org/licenses/lgpl-license.php.
|
||||
*
|
||||
* @author Ciprian Popovici
|
||||
* @package Text_Diff
|
||||
*/
|
||||
|
||||
/** Text_Diff_Renderer */
|
||||
require_once 'Text/Diff/Renderer.php';
|
||||
|
||||
/**
|
||||
* "Inline" diff renderer.
|
||||
*
|
||||
* This class renders diffs in the Wiki-style "inline" format.
|
||||
*
|
||||
* @author Ciprian Popovici
|
||||
* @package Text_Diff
|
||||
*/
|
||||
class Text_Diff_Renderer_ipsunified extends Text_Diff_Renderer {
|
||||
|
||||
/**
|
||||
* Number of leading context "lines" to preserve.
|
||||
*/
|
||||
var $_leading_context_lines = 10000;
|
||||
|
||||
/**
|
||||
* Number of trailing context "lines" to preserve.
|
||||
*/
|
||||
var $_trailing_context_lines = 10000;
|
||||
|
||||
/**
|
||||
* Prefix for inserted text.
|
||||
*/
|
||||
var $_ins_prefix = '<ins>';
|
||||
|
||||
/**
|
||||
* Suffix for inserted text.
|
||||
*/
|
||||
var $_ins_suffix = '</ins>';
|
||||
|
||||
/**
|
||||
* Prefix for deleted text.
|
||||
*/
|
||||
var $_del_prefix = '<del>';
|
||||
|
||||
/**
|
||||
* Suffix for deleted text.
|
||||
*/
|
||||
var $_del_suffix = '</del>';
|
||||
|
||||
/**
|
||||
* Header for each change block.
|
||||
*/
|
||||
var $_block_header = '';
|
||||
|
||||
/**
|
||||
* What are we currently splitting on? Used to recurse to show word-level
|
||||
* changes.
|
||||
*/
|
||||
var $_split_level = 'lines';
|
||||
|
||||
function _blockHeader($xbeg, $xlen, $ybeg, $ylen)
|
||||
{
|
||||
return $this->_block_header;
|
||||
}
|
||||
|
||||
function _startBlock($header)
|
||||
{
|
||||
return $header;
|
||||
}
|
||||
|
||||
function _lines($lines, $prefix = ' ', $encode = true)
|
||||
{
|
||||
if ($encode) {
|
||||
array_walk($lines, array(&$this, '_encode'));
|
||||
}
|
||||
|
||||
return implode("\n", $lines) . "\n";
|
||||
}
|
||||
|
||||
function _added($lines)
|
||||
{
|
||||
array_walk($lines, array(&$this, '_encode'));
|
||||
$lines[0] = $this->_ins_prefix . $lines[0];
|
||||
$lines[count($lines) - 1] .= $this->_ins_suffix;
|
||||
return $this->_lines($lines, ' ', false);
|
||||
}
|
||||
|
||||
function _deleted($lines, $words = false)
|
||||
{
|
||||
array_walk($lines, array(&$this, '_encode'));
|
||||
$lines[0] = $this->_del_prefix . $lines[0];
|
||||
$lines[count($lines) - 1] .= $this->_del_suffix;
|
||||
return $this->_lines($lines, ' ', false);
|
||||
}
|
||||
|
||||
function _changed($orig, $final)
|
||||
{
|
||||
return $this->_deleted($orig) . $this->_added($final);
|
||||
}
|
||||
|
||||
function _encode(&$string)
|
||||
{
|
||||
$string = htmlspecialchars($string);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -4,9 +4,9 @@
|
||||
*
|
||||
* This class renders the diff in classic "unified diff" format.
|
||||
*
|
||||
* $Horde: framework/Text_Diff/Diff/Renderer/unified.php,v 1.3.10.6 2008/01/04 10:37:27 jan Exp $
|
||||
* $Horde: framework/Text_Diff/Diff/Renderer/unified.php,v 1.3.10.7 2009/01/06 15:23:42 jan Exp $
|
||||
*
|
||||
* Copyright 2004-2008 The Horde Project (http://www.horde.org/)
|
||||
* Copyright 2004-2009 The Horde Project (http://www.horde.org/)
|
||||
*
|
||||
* See the enclosed file COPYING for license information (LGPL). If you did
|
||||
* not receive this file, see http://opensource.org/licenses/lgpl-license.php.
|
||||
|
||||
@@ -2,9 +2,9 @@
|
||||
/**
|
||||
* A class for computing three way diffs.
|
||||
*
|
||||
* $Horde: framework/Text_Diff/Diff/ThreeWay.php,v 1.3.2.3 2008/01/04 10:37:27 jan Exp $
|
||||
* $Horde: framework/Text_Diff/Diff/ThreeWay.php,v 1.3.2.4 2009/01/06 15:23:41 jan Exp $
|
||||
*
|
||||
* Copyright 2007-2008 The Horde Project (http://www.horde.org/)
|
||||
* Copyright 2007-2009 The Horde Project (http://www.horde.org/)
|
||||
*
|
||||
* See the enclosed file COPYING for license information (LGPL). If you did
|
||||
* not receive this file, see http://opensource.org/licenses/lgpl-license.php.
|
||||
@@ -57,7 +57,7 @@ class Text_Diff_ThreeWay extends Text_Diff {
|
||||
$lines = array();
|
||||
foreach ($this->_edits as $edit) {
|
||||
if ($edit->isConflict()) {
|
||||
/* FIXME: this should probably be moved somewhere else. */
|
||||
|
||||
$lines = array_merge($lines,
|
||||
array('<<<<<<<' . ($label1 ? ' ' . $label1 : '')),
|
||||
$edit->final1,
|
||||
|
||||
@@ -1 +1,10 @@
|
||||
<html>␍<head><title>IP.Board - Bulletin Board System</title></head>␍<body>␍<h1>403: IP.Board -> Forbidden</h1>␍<hr>␍You have reached this page in error, please use your back button to return to the forum.␍<hr>␍<a href="http://www.invisionboard.com/">IP.Board</a>␍</body>␍</html>␍
|
||||
<html>
|
||||
<head><title>IP.Board - Bulletin Board System</title></head>
|
||||
<body>
|
||||
<h1>403: IP.Board -> Forbidden</h1>
|
||||
<hr>
|
||||
You have reached this page in error, please use your back button to return to the forum.
|
||||
<hr>
|
||||
<a href="http://www.invisionboard.com/">IP.Board</a>
|
||||
</body>
|
||||
</html>
|
||||
@@ -2,9 +2,9 @@
|
||||
/**
|
||||
* A class for computing three way diffs.
|
||||
*
|
||||
* $Horde: framework/Text_Diff/Diff3.php,v 1.2.10.6 2008/01/04 10:37:26 jan Exp $
|
||||
* $Horde: framework/Text_Diff/Diff3.php,v 1.2.10.7 2009/01/06 15:23:41 jan Exp $
|
||||
*
|
||||
* Copyright 2007-2008 The Horde Project (http://www.horde.org/)
|
||||
* Copyright 2007-2009 The Horde Project (http://www.horde.org/)
|
||||
*
|
||||
* See the enclosed file COPYING for license information (LGPL). If you did
|
||||
* not receive this file, see http://opensource.org/licenses/lgpl-license.php.
|
||||
@@ -41,11 +41,13 @@ class Text_Diff3 extends Text_Diff {
|
||||
function Text_Diff3($orig, $final1, $final2)
|
||||
{
|
||||
if (extension_loaded('xdiff')) {
|
||||
require_once 'Text/Diff/Engine/xdiff.php';
|
||||
$engine = new Text_Diff_Engine_xdiff();
|
||||
} else {
|
||||
require_once 'Text/Diff/Engine/native.php';
|
||||
$engine = new Text_Diff_Engine_native();
|
||||
}
|
||||
|
||||
|
||||
$this->_edits = $this->_diff3($engine->diff($orig, $final1),
|
||||
$engine->diff($orig, $final2));
|
||||
}
|
||||
@@ -57,7 +59,7 @@ class Text_Diff3 extends Text_Diff {
|
||||
$lines = array();
|
||||
foreach ($this->_edits as $edit) {
|
||||
if ($edit->isConflict()) {
|
||||
/* FIXME: this should probably be moved somewhere else. */
|
||||
|
||||
$lines = array_merge($lines,
|
||||
array('<<<<<<<' . ($label1 ? ' ' . $label1 : '')),
|
||||
$edit->final1,
|
||||
|
||||
@@ -1 +1,10 @@
|
||||
<html>␍<head><title>IP.Board - Bulletin Board System</title></head>␍<body>␍<h1>403: IP.Board -> Forbidden</h1>␍<hr>␍You have reached this page in error, please use your back button to return to the forum.␍<hr>␍<a href="http://www.invisionboard.com/">IP.Board</a>␍</body>␍</html>␍
|
||||
<html>
|
||||
<head><title>IP.Board - Bulletin Board System</title></head>
|
||||
<body>
|
||||
<h1>403: IP.Board -> Forbidden</h1>
|
||||
<hr>
|
||||
You have reached this page in error, please use your back button to return to the forum.
|
||||
<hr>
|
||||
<a href="http://www.invisionboard.com/">IP.Board</a>
|
||||
</body>
|
||||
</html>
|
||||
@@ -1,5 +1,5 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<package packagerversion="1.7.2" version="2.0" xmlns="http://pear.php.net/dtd/package-2.0" xmlns:tasks="http://pear.php.net/dtd/tasks-1.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://pear.php.net/dtd/tasks-1.0 http://pear.php.net/dtd/tasks-1.0.xsd http://pear.php.net/dtd/package-2.0 http://pear.php.net/dtd/package-2.0.xsd">
|
||||
<?xml version="1.0" encoding="ISO-8859-1"?>
|
||||
<package packagerversion="1.8.2" version="2.0" xmlns="http://pear.php.net/dtd/package-2.0" xmlns:tasks="http://pear.php.net/dtd/tasks-1.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://pear.php.net/dtd/tasks-1.0 http://pear.php.net/dtd/tasks-1.0.xsd http://pear.php.net/dtd/package-2.0 http://pear.php.net/dtd/package-2.0.xsd">
|
||||
<name>Text_Diff</name>
|
||||
<channel>pear.php.net</channel>
|
||||
<summary>Engine for performing and rendering text diffs</summary>
|
||||
@@ -22,10 +22,10 @@
|
||||
<email>pmjones@memphis.edu</email>
|
||||
<active>no</active>
|
||||
</lead>
|
||||
<date>2008-09-10</date>
|
||||
<time>10:52:52</time>
|
||||
<date>2009-07-24</date>
|
||||
<time>15:35:25</time>
|
||||
<version>
|
||||
<release>1.1.0</release>
|
||||
<release>1.1.1</release>
|
||||
<api>1.1.0</api>
|
||||
</version>
|
||||
<stability>
|
||||
@@ -33,21 +33,23 @@
|
||||
<api>stable</api>
|
||||
</stability>
|
||||
<license uri="http://opensource.org/licenses/lgpl-license.php">LGPL</license>
|
||||
<notes>* Add countAddedLines() and countDeletedLines() methods (Christian King, PEAR Request #13183).
|
||||
* Improve string engine if patch data has no header (PEAR Bug #14533).
|
||||
* Fix autodetection of diff type in string engine (PEAR Bug #14625).</notes>
|
||||
<notes>
|
||||
* Make sure that the diff string ends with a line break (PEAR Bug #14533).
|
||||
* Fix notices if xdiff engine creates empty lines (PEAR Bug #16240).
|
||||
* Fix inline renderer if xdiff extension is installed.
|
||||
</notes>
|
||||
<contents>
|
||||
<dir name="/">
|
||||
<file baseinstalldir="/Text" md5sum="b30ce3240eed85e2114b93e28095af90" name="Diff/Engine/native.php" role="php" />
|
||||
<file baseinstalldir="/Text" md5sum="4ccb7b5ea80041fcd6e5c5cd958931fa" name="Diff/Engine/shell.php" role="php" />
|
||||
<file baseinstalldir="/Text" md5sum="1daaca651ed46e5711b43e47e91e077f" name="Diff/Engine/string.php" role="php" />
|
||||
<file baseinstalldir="/Text" md5sum="05f00fc5c59664199eb533ff825a386c" name="Diff/Engine/xdiff.php" role="php" />
|
||||
<file baseinstalldir="/Text" md5sum="1263babf64df086001944b699014e59d" name="Diff/Renderer/context.php" role="php" />
|
||||
<file baseinstalldir="/Text" md5sum="e001548ef0b37702633a421cf7eed83d" name="Diff/Renderer/inline.php" role="php" />
|
||||
<file baseinstalldir="/Text" md5sum="c4dbae31ce515995100f6ad27a8c9c4e" name="Diff/Renderer/unified.php" role="php" />
|
||||
<file baseinstalldir="/Text" md5sum="96b1dc3ba33aba32a4b5662b22d8b58a" name="Diff/Mapped.php" role="php" />
|
||||
<file baseinstalldir="/Text" md5sum="d5ac2cccaacad465caa41fae23eae8ad" name="Diff/Renderer.php" role="php" />
|
||||
<file baseinstalldir="/Text" md5sum="abf74995fef0ba23d50dfc6a5652b5e1" name="Diff/ThreeWay.php" role="php" />
|
||||
<file baseinstalldir="/Text" md5sum="07b505d89a268efb62e4ea69a8817d56" name="Diff/Engine/native.php" role="php" />
|
||||
<file baseinstalldir="/Text" md5sum="79d9fc2603418ba25753b1e035696e90" name="Diff/Engine/shell.php" role="php" />
|
||||
<file baseinstalldir="/Text" md5sum="746c18001d2e7968f693faa73521d650" name="Diff/Engine/string.php" role="php" />
|
||||
<file baseinstalldir="/Text" md5sum="b597d4f5e0ba0f743d0a60a7de99fe50" name="Diff/Engine/xdiff.php" role="php" />
|
||||
<file baseinstalldir="/Text" md5sum="c73de903cd1e0026e4edfc766d2e65ac" name="Diff/Renderer/context.php" role="php" />
|
||||
<file baseinstalldir="/Text" md5sum="15f8e4e1d9661e73812281b010ad76ac" name="Diff/Renderer/inline.php" role="php" />
|
||||
<file baseinstalldir="/Text" md5sum="fb409e01619612671a6011d60f8017ed" name="Diff/Renderer/unified.php" role="php" />
|
||||
<file baseinstalldir="/Text" md5sum="8d3c0a7cc6bfd629b06b689809296a90" name="Diff/Mapped.php" role="php" />
|
||||
<file baseinstalldir="/Text" md5sum="26048a82f49161c82cc92922c7d7a8aa" name="Diff/Renderer.php" role="php" />
|
||||
<file baseinstalldir="/Text" md5sum="6d967016ce09fca862199d41719c06d8" name="Diff/ThreeWay.php" role="php" />
|
||||
<file baseinstalldir="/Text" md5sum="5fbdf5388905ed07026b876126aeee5a" name="docs/examples/1.txt" role="doc" />
|
||||
<file baseinstalldir="/Text" md5sum="011c4dad4506a4843ded1f12cab69909" name="docs/examples/2.txt" role="doc" />
|
||||
<file baseinstalldir="/Text" md5sum="6082891c438ee1ba70fd89b9b4e241e8" name="docs/examples/diff.php" role="doc" />
|
||||
@@ -58,21 +60,22 @@
|
||||
<file baseinstalldir="/Text" md5sum="ea33106f5d970bf5dc318b752c95e343" name="tests/5.txt" role="test" />
|
||||
<file baseinstalldir="/Text" md5sum="38f7931505de496d7312a830b2880f2c" name="tests/6.txt" role="test" />
|
||||
<file baseinstalldir="/Text" md5sum="aa40a9c049e89eb8c6f5b0f47e1aabd9" name="tests/context.patch" role="test" />
|
||||
<file baseinstalldir="/Text" md5sum="b0143ef7d5e9a1ace0ff747165f27c1f" name="tests/context.phpt" role="test" />
|
||||
<file baseinstalldir="/Text" md5sum="2a88e4c49d51bbdced9a4bd8a8a657c5" name="tests/context2.phpt" role="test" />
|
||||
<file baseinstalldir="/Text" md5sum="43e8b69ff75bc0e7ecab5b4e87827d19" name="tests/diff.phpt" role="test" />
|
||||
<file baseinstalldir="/Text" md5sum="2c2f13e357f691f3922d07f6e70fa43d" name="tests/inline.phpt" role="test" />
|
||||
<file baseinstalldir="/Text" md5sum="05e94365c047905009b1913a3600036f" name="tests/inline2.phpt" role="test" />
|
||||
<file baseinstalldir="/Text" md5sum="e05b5cf54cfaf541663fa802724e9549" name="tests/pear_bug12740.phpt" role="test" />
|
||||
<file baseinstalldir="/Text" md5sum="7949426acc1e64d6c10338bf6382257d" name="tests/pear_bug4879.phpt" role="test" />
|
||||
<file baseinstalldir="/Text" md5sum="7fb3cda23ca78409f72ac233784ff1a1" name="tests/pear_bug6251.phpt" role="test" />
|
||||
<file baseinstalldir="/Text" md5sum="c4d40a654a584d3f939dca33fff0a5c4" name="tests/pear_bug6428.phpt" role="test" />
|
||||
<file baseinstalldir="/Text" md5sum="01f878ee632292a12de6c0facec486b0" name="tests/context.phpt" role="test" />
|
||||
<file baseinstalldir="/Text" md5sum="2e9288b5ef4a7804b40470bdd4bc64f5" name="tests/context2.phpt" role="test" />
|
||||
<file baseinstalldir="/Text" md5sum="7f694063eaddfb3eeb9c1adef929a70e" name="tests/diff.phpt" role="test" />
|
||||
<file baseinstalldir="/Text" md5sum="2b4e2bcd033ca9a6098c6672a21c1f2f" name="tests/inline.phpt" role="test" />
|
||||
<file baseinstalldir="/Text" md5sum="fa7a6ac0ceacf68c1d7e6a121f23f275" name="tests/inline2.phpt" role="test" />
|
||||
<file baseinstalldir="/Text" md5sum="e70ad292ff86d2173d002945a3c7c706" name="tests/pear_bug12740.phpt" role="test" />
|
||||
<file baseinstalldir="/Text" md5sum="3bf51765e10607c7bcfc5ee6a898ff9f" name="tests/pear_bug4879.phpt" role="test" />
|
||||
<file baseinstalldir="/Text" md5sum="81a86e4b7950ad48b47dc681a8c13fe4" name="tests/pear_bug6251.phpt" role="test" />
|
||||
<file baseinstalldir="/Text" md5sum="c11639b0af5c2967294648d9bfb4ed6d" name="tests/pear_bug6428.phpt" role="test" />
|
||||
<file baseinstalldir="/Text" md5sum="e7011d4030f4a020d24efb6f1673a1bc" name="tests/string.phpt" role="test" />
|
||||
<file baseinstalldir="/Text" md5sum="359096964862ff26e28cc44609ca237f" name="tests/unified.patch" role="test" />
|
||||
<file baseinstalldir="/Text" md5sum="77977a033a539c5ccadaf728b95a1a2c" name="tests/unified.phpt" role="test" />
|
||||
<file baseinstalldir="/Text" md5sum="dab2830cf62f341f1046b883948c1851" name="tests/unified2.phpt" role="test" />
|
||||
<file baseinstalldir="/Text" md5sum="3f715ec0e86162bddc1ea794a04aa4d3" name="Diff.php" role="php" />
|
||||
<file baseinstalldir="/Text" md5sum="7b57773de584d2408214cb2c7a0d0a2e" name="Diff3.php" role="php" />
|
||||
<file baseinstalldir="/Text" md5sum="42e165a1069c23cedb08ac9161dd5872" name="tests/unified.phpt" role="test" />
|
||||
<file baseinstalldir="/Text" md5sum="f634a746992d4202584f0ec4b92712d1" name="tests/unified2.phpt" role="test" />
|
||||
<file baseinstalldir="/Text" md5sum="e28b61e4a41681a1fd11fc539c99feff" name="tests/xdiff.phpt" role="test" />
|
||||
<file baseinstalldir="/Text" md5sum="456537f75ca3421a08e1407d014774de" name="Diff.php" role="php" />
|
||||
<file baseinstalldir="/Text" md5sum="7bc9fb4108713e94bbeaea940f134bd0" name="Diff3.php" role="php" />
|
||||
</dir>
|
||||
</contents>
|
||||
<dependencies>
|
||||
@@ -92,6 +95,23 @@
|
||||
</dependencies>
|
||||
<phprelease />
|
||||
<changelog>
|
||||
<release>
|
||||
<date>2008-09-10</date>
|
||||
<version>
|
||||
<release>1.1.0</release>
|
||||
<api>1.1.0</api>
|
||||
</version>
|
||||
<stability>
|
||||
<release>stable</release>
|
||||
<api>stable</api>
|
||||
</stability>
|
||||
<license uri="http://opensource.org/licenses/lgpl-license.php">LGPL</license>
|
||||
<notes>
|
||||
* Add countAddedLines() and countDeletedLines() methods (Christian King, PEAR Request #13183).
|
||||
* Improve string engine if patch data has no header (PEAR Bug #14533).
|
||||
* Fix autodetection of diff type in string engine (PEAR Bug #14625).
|
||||
</notes>
|
||||
</release>
|
||||
<release>
|
||||
<version>
|
||||
<release>1.0.0</release>
|
||||
@@ -103,7 +123,9 @@
|
||||
</stability>
|
||||
<date>2008-01-31</date>
|
||||
<license uri="http://opensource.org/licenses/lgpl-license.php">LGPL</license>
|
||||
<notes>* Stable release; final non-bugfix PHP 4 release.</notes>
|
||||
<notes>
|
||||
* Stable release; final non-bugfix PHP 4 release.
|
||||
</notes>
|
||||
</release>
|
||||
<release>
|
||||
<version>
|
||||
@@ -116,7 +138,9 @@
|
||||
</stability>
|
||||
<date>2007-01-04</date>
|
||||
<license uri="http://opensource.org/licenses/lgpl-license.php">LGPL</license>
|
||||
<notes>* Fixed assertion in the native engine with PHP 5 (PEAR Bug #12740).</notes>
|
||||
<notes>
|
||||
* Fixed assertion in the native engine with PHP 5 (PEAR Bug #12740).
|
||||
</notes>
|
||||
</release>
|
||||
<release>
|
||||
<version>
|
||||
@@ -129,8 +153,10 @@
|
||||
</stability>
|
||||
<date>2007-10-28</date>
|
||||
<license uri="http://opensource.org/licenses/lgpl-license.php">LGPL</license>
|
||||
<notes>* Fixed off-by-one errors with line numbers in default renderer output (Milian Wolff, PEAR Bugs #7839, #12111).
|
||||
* Restore compatibility with PHP 4 in the shell diff engine.</notes>
|
||||
<notes>
|
||||
* Fixed off-by-one errors with line numbers in default renderer output (Milian Wolff, PEAR Bugs #7839, #12111).
|
||||
* Restore compatibility with PHP 4 in the shell diff engine.
|
||||
</notes>
|
||||
</release>
|
||||
<release>
|
||||
<version>
|
||||
@@ -143,11 +169,13 @@
|
||||
</stability>
|
||||
<date>2007-09-20</date>
|
||||
<license uri="http://opensource.org/licenses/lgpl-license.php">LGPL</license>
|
||||
<notes>* Converted to package.xml 2.0.
|
||||
<notes>
|
||||
* Converted to package.xml 2.0.
|
||||
* Added context diff renderer.
|
||||
* Stripped nul characters to avoid infinite loops (PEAR Bug #7921).
|
||||
* Fix assertion with PHP 5 (PEAR Bug #10423).
|
||||
* Add shell diff engine (Milian Wolff, PEAR Request #12051).</notes>
|
||||
* Add shell diff engine (Milian Wolff, PEAR Request #12051).
|
||||
</notes>
|
||||
</release>
|
||||
<release>
|
||||
<version>
|
||||
@@ -160,7 +188,9 @@
|
||||
</stability>
|
||||
<date>2006-02-06</date>
|
||||
<license uri="http://opensource.org/licenses/lgpl-license.php">LGPL</license>
|
||||
<notes>* Fix Text_Diff::reverse() method with PHP 5 (PEAR Bug #6699).</notes>
|
||||
<notes>
|
||||
* Fix Text_Diff::reverse() method with PHP 5 (PEAR Bug #6699).
|
||||
</notes>
|
||||
</release>
|
||||
<release>
|
||||
<version>
|
||||
@@ -173,10 +203,12 @@
|
||||
</stability>
|
||||
<date>2006-01-06</date>
|
||||
<license uri="http://opensource.org/licenses/lgpl-license.php">LGPL</license>
|
||||
<notes>* Fix reference warnings with PHP 4.4 and PHP 5.1.
|
||||
<notes>
|
||||
* Fix reference warnings with PHP 4.4 and PHP 5.1.
|
||||
* Fix too many trailing context lines for the last diff chunk. (PEAR Bug #6251).
|
||||
* Add diff engine for existing diffs/patches (Örjan Persson, PEAR Request #5373).
|
||||
* Fix problems with numbers, whitespace-only changes and the inline renderer (PEAR Bug #6428.</notes>
|
||||
* Add diff engine for existing diffs/patches (Örjan Persson, PEAR Request #5373).
|
||||
* Fix problems with numbers, whitespace-only changes and the inline renderer (PEAR Bug #6428.
|
||||
</notes>
|
||||
</release>
|
||||
<release>
|
||||
<version>
|
||||
@@ -189,7 +221,9 @@
|
||||
</stability>
|
||||
<date>2005-08-19</date>
|
||||
<license uri="http://opensource.org/licenses/lgpl-license.php">LGPL</license>
|
||||
<notes>* Restore compatibility with PHP 4.2.0 (PEAR Bug #5152).</notes>
|
||||
<notes>
|
||||
* Restore compatibility with PHP 4.2.0 (PEAR Bug #5152).
|
||||
</notes>
|
||||
</release>
|
||||
<release>
|
||||
<version>
|
||||
@@ -202,9 +236,11 @@
|
||||
</stability>
|
||||
<date>2005-08-16</date>
|
||||
<license uri="http://opensource.org/licenses/lgpl-license.php">LGPL</license>
|
||||
<notes>* Fix Renderer::getParams() (PEAR Bug #4549)
|
||||
<notes>
|
||||
* Fix Renderer::getParams() (PEAR Bug #4549)
|
||||
* Encode HTML entities in the inline renderer (Horde Bug #2181)
|
||||
* Fix endless loop in inline renderer with certain whitespaces (PEAR Bug #4879)</notes>
|
||||
* Fix endless loop in inline renderer with certain whitespaces (PEAR Bug #4879)
|
||||
</notes>
|
||||
</release>
|
||||
<release>
|
||||
<version>
|
||||
@@ -217,10 +253,12 @@
|
||||
</stability>
|
||||
<date>2005-05-04</date>
|
||||
<license uri="http://opensource.org/licenses/lgpl-license.php">LGPL</license>
|
||||
<notes>* Fixed variable name in Text_MappedDiff.
|
||||
<notes>
|
||||
* Fixed variable name in Text_MappedDiff.
|
||||
* Removed output buffering code.
|
||||
* Fixed additional empty lines being added with the inline renderer (Bug 3730).
|
||||
* Fixed multiple calls to _endBlock per block (Bug 4065).</notes>
|
||||
* Fixed multiple calls to _endBlock per block (Bug 4065).
|
||||
</notes>
|
||||
</release>
|
||||
<release>
|
||||
<version>
|
||||
@@ -233,10 +271,12 @@
|
||||
</stability>
|
||||
<date>2004-10-13</date>
|
||||
<license uri="http://opensource.org/licenses/lgpl-license.php">LGPL</license>
|
||||
<notes>* Generalized Diff Renderer parameter handling.
|
||||
<notes>
|
||||
* Generalized Diff Renderer parameter handling.
|
||||
* Added an inline renderer contributed by Ciprian Popovici (ciprian@zuavra.net).
|
||||
* Fixed PHPDoc.
|
||||
* Fixed a PHP 5 incompatibility.</notes>
|
||||
* Fixed a PHP 5 incompatibility.
|
||||
</notes>
|
||||
</release>
|
||||
<release>
|
||||
<version>
|
||||
@@ -249,7 +289,9 @@
|
||||
</stability>
|
||||
<date>2004-05-13</date>
|
||||
<license uri="http://opensource.org/licenses/lgpl-license.php">LGPL</license>
|
||||
<notes>Renamed final() and orig() methods to avoid conflict with final keyword in PHP5</notes>
|
||||
<notes>
|
||||
Renamed final() and orig() methods to avoid conflict with final keyword in PHP5
|
||||
</notes>
|
||||
</release>
|
||||
<release>
|
||||
<version>
|
||||
@@ -262,7 +304,9 @@
|
||||
</stability>
|
||||
<date>2004-03-16</date>
|
||||
<license uri="http://opensource.org/licenses/lgpl-license.php">LGPL</license>
|
||||
<notes>Added optional xdiff support</notes>
|
||||
<notes>
|
||||
Added optional xdiff support
|
||||
</notes>
|
||||
</release>
|
||||
<release>
|
||||
<version>
|
||||
@@ -275,7 +319,9 @@
|
||||
</stability>
|
||||
<date>2004-01-09</date>
|
||||
<license uri="http://opensource.org/licenses/lgpl-license.php">LGPL</license>
|
||||
<notes>Initial package release</notes>
|
||||
<notes>
|
||||
Initial package release
|
||||
</notes>
|
||||
</release>
|
||||
</changelog>
|
||||
</package>
|
||||
@@ -1 +1,10 @@
|
||||
<html>␍<head><title>IP.Board - Bulletin Board System</title></head>␍<body>␍<h1>403: IP.Board -> Forbidden</h1>␍<hr>␍You have reached this page in error, please use your back button to return to the forum.␍<hr>␍<a href="http://www.invisionboard.com/">IP.Board</a>␍</body>␍</html>␍
|
||||
<html>
|
||||
<head><title>IP.Board - Bulletin Board System</title></head>
|
||||
<body>
|
||||
<h1>403: IP.Board -> Forbidden</h1>
|
||||
<hr>
|
||||
You have reached this page in error, please use your back button to return to the forum.
|
||||
<hr>
|
||||
<a href="http://www.invisionboard.com/">IP.Board</a>
|
||||
</body>
|
||||
</html>
|
||||
Reference in new issue
Block a user