Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,14 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

### Deprecated

- The following `SimplePie\Misc` methods are deprecated without replacement:
- `SimplePie\Misc::element_implode()`
- `SimplePie\Misc::parse_str()`
- `SimplePie\Misc::percent_encoding_normalization()`
- `SimplePie\Misc::strip_comments()`
- `SimplePie\Misc::uncomment_rfc822()`

If you need any of them, consider copying the function to your codebase. (by @jtojnar in [#899](https://github.com/simplepie/simplepie/pull/899))
- The method `SimplePie\SimplePie::set_file()` is deprecated, use `SimplePie\SimplePie::set_http_client()` or `SimplePie\SimplePie::set_raw_data()` instead
- The method `SimplePie\Sanitize::pass_file_data()` is deprecated, use `SimplePie\Sanitize::set_http_client()` instead
- Passing multiple URLs to `SimplePie\SimplePie::set_feed_url()` is deprecated. You can create separate `SimplePie` instance per feed and then use `SimplePie::merge_items()` to get a single list of items. ([#795](https://github.com/simplepie/simplepie/pull/795))
Expand Down
13 changes: 13 additions & 0 deletions src/Misc.php
Original file line number Diff line number Diff line change
Expand Up @@ -105,11 +105,14 @@ public static function get_element(string $realname, string $string)
}

/**
* @deprecated since SimplePie 1.9.0. If you need it, you can copy the function to your codebase. But you should consider using `DOMDocument` for any DOM wrangling.
* @param array{tag: string, self_closing: bool, attribs: array<string, array{data: string}>, content: string} $element
* @return string
*/
public static function element_implode(array $element)
{
// trigger_error(sprintf('Using method "' . __METHOD__ . '" is deprecated since SimplePie 1.9.'), \E_USER_DEPRECATED);

$full = "<{$element['tag']}";
foreach ($element['attribs'] as $key => $value) {
$key = strtolower($key);
Expand Down Expand Up @@ -250,6 +253,7 @@ public static function normalize_url(string $url)
}

/**
* @deprecated since SimplePie 1.9.0. This functionality is part of `IRI` – if you need it standalone, consider copying the function to your codebase.
* @param array<int, string> $match
* @return string
*/
Expand Down Expand Up @@ -1712,11 +1716,14 @@ public static function get_curl_version()
/**
* Strip HTML comments
*
* @deprecated since SimplePie 1.9.0. If you need it, you can copy the function to your codebase. But you should consider using `DOMDocument` for any DOM wrangling.
* @param string $data Data to strip comments from
* @return string Comment stripped string
*/
public static function strip_comments(string $data)
{
// trigger_error(sprintf('Using method "' . __METHOD__ . '" is deprecated since SimplePie 1.9.'), \E_USER_DEPRECATED);

$output = '';
while (($start = strpos($data, '<!--')) !== false) {
$output .= substr($data, 0, $start);
Expand Down Expand Up @@ -1756,11 +1763,14 @@ public static function entities_decode(string $data)
/**
* Remove RFC822 comments
*
* @deprecated since SimplePie 1.9.0. If you need it, consider copying the function to your codebase.
* @param string $string Data to strip comments from
* @return string Comment stripped string
*/
public static function uncomment_rfc822(string $string)
{
// trigger_error(sprintf('Using method "' . __METHOD__ . '" is deprecated since SimplePie 1.9.'), \E_USER_DEPRECATED);

$position = 0;
$length = strlen($string);
$depth = 0;
Expand Down Expand Up @@ -1958,12 +1968,15 @@ public static function codepoint_to_utf8(int $codepoint)
* Returns an associative array of name/value pairs, where the value is an
* array of values that have used the same name
*
* @deprecated since SimplePie 1.9.0. If you need it, consider copying the function to your codebase.
* @static
* @param string $str The input string.
* @return array<string, array<string|null>>
*/
public static function parse_str(string $str)
{
// trigger_error(sprintf('Using method "' . __METHOD__ . '" is deprecated since SimplePie 1.9.'), \E_USER_DEPRECATED);

$return = [];
$str = explode('&', $str);

Expand Down