Skip to content

Commit

Permalink
MDL-65750 lib: update simplepie to 1.5.2
Browse files Browse the repository at this point in the history
  • Loading branch information
lameze committed Jul 10, 2019
1 parent fac49f8 commit 4155b7a
Show file tree
Hide file tree
Showing 28 changed files with 591 additions and 877 deletions.
220 changes: 80 additions & 140 deletions lib/simplepie/library/SimplePie.php
100644 → 100755

Large diffs are not rendered by default.

19 changes: 6 additions & 13 deletions lib/simplepie/library/SimplePie/Author.php
Original file line number Diff line number Diff line change
Expand Up @@ -113,10 +113,8 @@ public function get_name()
{
return $this->name;
}
else
{
return null;
}

return null;
}

/**
Expand All @@ -130,10 +128,8 @@ public function get_link()
{
return $this->link;
}
else
{
return null;
}

return null;
}

/**
Expand All @@ -147,10 +143,7 @@ public function get_email()
{
return $this->email;
}
else
{
return null;
}

return null;
}
}

2 changes: 1 addition & 1 deletion lib/simplepie/library/SimplePie/Cache/File.php
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ public function __construct($location, $name, $type)
*/
public function save($data)
{
if (file_exists($this->name) && is_writeable($this->name) || file_exists($this->location) && is_writeable($this->location))
if (file_exists($this->name) && is_writable($this->name) || file_exists($this->location) && is_writable($this->location))
{
if ($data instanceof SimplePie)
{
Expand Down
Empty file modified lib/simplepie/library/SimplePie/Cache/Memcached.php
100644 → 100755
Empty file.
28 changes: 7 additions & 21 deletions lib/simplepie/library/SimplePie/Cache/MySQL.php
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ public function __construct($location, $name, $type)
'cache_purge_time' => 2592000
),
);

$this->options = SimplePie_Misc::array_merge_recursive($this->options, SimplePie_Cache::parse_URL($location));

// Path is prefixed with a "/"
Expand Down Expand Up @@ -395,10 +395,8 @@ public function mtime()
{
return $time;
}
else
{
return false;
}

return false;
}

/**
Expand All @@ -416,14 +414,8 @@ public function touch()
$query = $this->mysql->prepare('UPDATE `' . $this->options['extras']['prefix'] . 'cache_data` SET `mtime` = :time WHERE `id` = :id');
$query->bindValue(':time', time());
$query->bindValue(':id', $this->id);
if ($query->execute() && $query->rowCount() > 0)
{
return true;
}
else
{
return false;
}

return $query->execute() && $query->rowCount() > 0;
}

/**
Expand All @@ -442,13 +434,7 @@ public function unlink()
$query->bindValue(':id', $this->id);
$query2 = $this->mysql->prepare('DELETE FROM `' . $this->options['extras']['prefix'] . 'items` WHERE `feed_id` = :id');
$query2->bindValue(':id', $this->id);
if ($query->execute() && $query2->execute())
{
return true;
}
else
{
return false;
}

return $query->execute() && $query2->execute();
}
}
6 changes: 6 additions & 0 deletions lib/simplepie/library/SimplePie/Cache/Redis.php
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,12 @@ public function __construct($location, $name, $options = null) {
$parsed = SimplePie_Cache::parse_URL($location);
$redis = new Redis();
$redis->connect($parsed['host'], $parsed['port']);
if (isset($parsed['pass'])) {
$redis->auth($parsed['pass']);
}
if (isset($parsed['path'])) {
$redis->select((int)substr($parsed['path'], 1));
}
$this->cache = $redis;

if (!is_null($options) && is_array($options)) {
Expand Down
31 changes: 10 additions & 21 deletions lib/simplepie/library/SimplePie/Caption.php
Original file line number Diff line number Diff line change
Expand Up @@ -131,10 +131,8 @@ public function get_endtime()
{
return $this->endTime;
}
else
{
return null;
}

return null;
}

/**
Expand All @@ -149,10 +147,8 @@ public function get_language()
{
return $this->lang;
}
else
{
return null;
}

return null;
}

/**
Expand All @@ -166,10 +162,8 @@ public function get_starttime()
{
return $this->startTime;
}
else
{
return null;
}

return null;
}

/**
Expand All @@ -183,10 +177,8 @@ public function get_text()
{
return $this->text;
}
else
{
return null;
}

return null;
}

/**
Expand All @@ -200,10 +192,7 @@ public function get_type()
{
return $this->type;
}
else
{
return null;
}

return null;
}
}

37 changes: 12 additions & 25 deletions lib/simplepie/library/SimplePie/Content/Type/Sniffer.php
Original file line number Diff line number Diff line change
Expand Up @@ -120,24 +120,18 @@ public function get_type()
{
return $return;
}
else
{
return $official;
}

return $official;
}
elseif ($official === 'text/html')
{
return $this->feed_or_html();
}
else
{
return $official;
}
}
else
{
return $this->unknown();

return $official;
}

return $this->unknown();
}

/**
Expand All @@ -158,10 +152,8 @@ public function text_or_binary()
{
return 'application/octect-stream';
}
else
{
return 'text/plain';
}

return 'text/plain';
}

/**
Expand Down Expand Up @@ -207,10 +199,8 @@ public function unknown()
{
return 'image/vnd.microsoft.icon';
}
else
{
return $this->text_or_binary();
}

return $this->text_or_binary();
}

/**
Expand Down Expand Up @@ -241,10 +231,8 @@ public function image()
{
return 'image/vnd.microsoft.icon';
}
else
{
return false;
}

return false;
}

/**
Expand Down Expand Up @@ -328,4 +316,3 @@ public function feed_or_html()
return 'text/html';
}
}

13 changes: 4 additions & 9 deletions lib/simplepie/library/SimplePie/Copyright.php
Original file line number Diff line number Diff line change
Expand Up @@ -103,10 +103,8 @@ public function get_url()
{
return $this->url;
}
else
{
return null;
}

return null;
}

/**
Expand All @@ -120,10 +118,7 @@ public function get_attribution()
{
return $this->label;
}
else
{
return null;
}

return null;
}
}

19 changes: 6 additions & 13 deletions lib/simplepie/library/SimplePie/Credit.php
Original file line number Diff line number Diff line change
Expand Up @@ -112,10 +112,8 @@ public function get_role()
{
return $this->role;
}
else
{
return null;
}

return null;
}

/**
Expand All @@ -129,10 +127,8 @@ public function get_scheme()
{
return $this->scheme;
}
else
{
return null;
}

return null;
}

/**
Expand All @@ -146,10 +142,7 @@ public function get_name()
{
return $this->name;
}
else
{
return null;
}

return null;
}
}

13 changes: 4 additions & 9 deletions lib/simplepie/library/SimplePie/Decode/HTML/Entities.php
Original file line number Diff line number Diff line change
Expand Up @@ -117,10 +117,8 @@ public function consume()
$this->consumed .= $this->data[$this->position];
return $this->data[$this->position++];
}
else
{
return false;
}

return false;
}

/**
Expand All @@ -139,10 +137,8 @@ public function consume_range($chars)
$this->position += $len;
return $data;
}
else
{
return false;
}

return false;
}

/**
Expand Down Expand Up @@ -612,4 +608,3 @@ public function entity()
}
}
}

Loading

0 comments on commit 4155b7a

Please sign in to comment.