Skip to content

Commit

Permalink
Merge pull request #292 from halkyon/deprecated_fixes
Browse files Browse the repository at this point in the history
Deprecated fixes
  • Loading branch information
chillu committed Apr 10, 2012
2 parents 3390ea3 + 2f1b7c1 commit 6829c15
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 10 deletions.
7 changes: 0 additions & 7 deletions core/Convert.php
Expand Up @@ -235,10 +235,6 @@ static function html2raw($data, $preserveLinks = false, $wordWrap = 60, $config
$config = $defaultConfig;
}

// sTRIp style and script
/* $data = eregi_replace("<style(^A-Za-z0-9>][^>]*)?>.*</style[^>]*>","", $data);*/
/* $data = eregi_replace("<script(^A-Za-z0-9>][^>]*)?>.*</script[^>]*>","", $data);*/

$data = preg_replace("/<style([^A-Za-z0-9>][^>]*)?>.*?<\/style[^>]*>/is","", $data);
$data = preg_replace("/<script([^A-Za-z0-9>][^>]*)?>.*?<\/script[^>]*>/is","", $data);

Expand All @@ -250,9 +246,6 @@ static function html2raw($data, $preserveLinks = false, $wordWrap = 60, $config
if(!$preserveLinks && !$config['PreserveLinks']) {
$data = preg_replace('/<a[^>]*href\s*=\s*"([^"]*)">(.*?)<\/a>/ie', "Convert::html2raw('\\2').'[\\1]'", $data);
$data = preg_replace('/<a[^>]*href\s*=\s*([^ ]*)>(.*?)<\/a>/ie', "Convert::html2raw('\\2').'[\\1]'", $data);

/* $data = eregi_replace('<a[^>]*href *= *"([^"]*)">([^<>]*)</a>', '\\2 [\\1]', $data); */
/* $data = eregi_replace('<a[^>]*href *= *([^ ]*)>([^<>]*)</a>', '\\2 [\\1]', $data); */
}

// Replace images with their alt tags
Expand Down
6 changes: 3 additions & 3 deletions thirdparty/simpletest/http.php
Expand Up @@ -316,7 +316,7 @@ function SimpleHttpHeaders($headers) {
$this->_cookies = array();
$this->_authentication = false;
$this->_realm = false;
foreach (split("\r\n", $headers) as $header_line) {
foreach (preg_split("/\r\n/", $headers) as $header_line) {
$this->_parseHeaderLine($header_line);
}
}
Expand Down Expand Up @@ -457,7 +457,7 @@ function _parseHeaderLine($header_line) {
* @access private
*/
function _parseCookie($cookie_line) {
$parts = split(";", $cookie_line);
$parts = preg_split('/;/', $cookie_line);
$cookie = array();
preg_match('/\s*(.*?)\s*=(.*)/', array_shift($parts), $cookie);
foreach ($parts as $part) {
Expand Down Expand Up @@ -521,7 +521,7 @@ function _parse($raw) {
$this->_setError('Could not split headers from content');
$this->_headers = new SimpleHttpHeaders($raw);
} else {
list($headers, $this->_content) = split("\r\n\r\n", $raw, 2);
list($headers, $this->_content) = preg_split("/\r\n\r\n/", $raw, 2);
$this->_headers = new SimpleHttpHeaders($headers);
}
}
Expand Down

0 comments on commit 6829c15

Please sign in to comment.