Skip to content
Browse files

Merge pull request #292 from halkyon/deprecated_fixes

Deprecated fixes
  • Loading branch information...
2 parents 3390ea3 + 2f1b7c1 commit 6829c151ad556bb8d9255b8d66a991235af5814a @chillu chillu committed Apr 10, 2012
Showing with 3 additions and 10 deletions.
  1. +0 −7 core/Convert.php
  2. +3 −3 thirdparty/simpletest/http.php
View
7 core/Convert.php
@@ -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);
@@ -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
View
6 thirdparty/simpletest/http.php
@@ -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);
}
}
@@ -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) {
@@ -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);
}
}

0 comments on commit 6829c15

Please sign in to comment.
Something went wrong with that request. Please try again.