Skip to content
Open
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
14 changes: 13 additions & 1 deletion amber.php
Original file line number Diff line number Diff line change
Expand Up @@ -324,8 +324,15 @@ private static function build_link_attributes($summaries) {
* Lookup a URL using the AmberStorage class, while caching for the duration of the page load
*/
private static function lookup_url($url) {
$attributes = array();
$status = Amber::get_status();
return Amber::build_link_attributes($status->get_summary($url, array(Amber::get_option('amber_backend', 0))));
$url = apply_filters('amber_lookup_url', $url);

if (!empty($url)) {
$attributes = Amber::build_link_attributes($status->get_summary($url, array(Amber::get_option('amber_backend', 0))));
}

return $attributes;
}

/**
Expand Down Expand Up @@ -420,6 +427,11 @@ public static function disk_space_purge() {
}

private static function cache_link($item, $force = false) {
$item = apply_filters('amber_cache_link', item);

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
$item = apply_filters('amber_cache_link', item);
$item = apply_filters('amber_cache_link', $item);


if (empty($link)) {

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
if (empty($link)) {
if (empty($item)) {

return false;
}

$checker = Amber::get_checker();
$status = Amber::get_status();
Expand Down