mirror of
https://github.com/FreshRSS/FreshRSS.git
synced 2026-07-20 12:03:02 -04:00
Fix memory leak when using lib_phpQuery (#3004)
* Fix memory leak when using lib_phpQuery This library keeps documents in static class, so it requires a special call to clean them. * Another unload
This commit is contained in:
committed by
GitHub
parent
a0f6e66e28
commit
e1ef88d815
@@ -401,6 +401,7 @@ class FreshRSS_Entry extends Minz_Model {
|
||||
$refresh = preg_replace('/^[0-9.; ]*\s*(url\s*=)?\s*/i', '', trim($meta->getAttribute('content')));
|
||||
$refresh = SimplePie_Misc::absolutize_url($refresh, $url);
|
||||
if ($refresh != false && $refresh !== $url) {
|
||||
phpQuery::unloadDocuments();
|
||||
return self::getContentByParsing($refresh, $path, $attributes, $maxRedirs - 1);
|
||||
}
|
||||
}
|
||||
@@ -408,7 +409,9 @@ class FreshRSS_Entry extends Minz_Model {
|
||||
}
|
||||
|
||||
$content = $doc->find($path);
|
||||
return trim(sanitizeHTML($content->__toString(), $url));
|
||||
$html = trim(sanitizeHTML($content->__toString(), $url));
|
||||
phpQuery::unloadDocuments();
|
||||
return $html;
|
||||
} else {
|
||||
throw new Exception();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user