Some more linting thanks to scrutinizer-ci
This commit is contained in:
parent
f72bfbb050
commit
bdf49b33cb
6 changed files with 15 additions and 9 deletions
|
@ -208,6 +208,7 @@ class DanbooruApi extends Extension {
|
||||||
|
|
||||||
// Fire off an event which should process the new file and add it to the db
|
// Fire off an event which should process the new file and add it to the db
|
||||||
$fileinfo = pathinfo($filename);
|
$fileinfo = pathinfo($filename);
|
||||||
|
$metadata = array();
|
||||||
$metadata['filename'] = $fileinfo['basename'];
|
$metadata['filename'] = $fileinfo['basename'];
|
||||||
$metadata['extension'] = $fileinfo['extension'];
|
$metadata['extension'] = $fileinfo['extension'];
|
||||||
$metadata['tags'] = $posttags;
|
$metadata['tags'] = $posttags;
|
||||||
|
|
|
@ -62,7 +62,9 @@ class XMLSitemap extends Extension {
|
||||||
private function handle_full_sitemap()
|
private function handle_full_sitemap()
|
||||||
{
|
{
|
||||||
global $database, $config;
|
global $database, $config;
|
||||||
|
|
||||||
// add index
|
// add index
|
||||||
|
$index = array();
|
||||||
$index[0] = $config->get_string("front_page");
|
$index[0] = $config->get_string("front_page");
|
||||||
$this->add_sitemap_queue($index, "weekly", "1");
|
$this->add_sitemap_queue($index, "weekly", "1");
|
||||||
|
|
||||||
|
|
|
@ -99,7 +99,7 @@ class StatsDInterface extends Extension {
|
||||||
|
|
||||||
// Wrap this in a try/catch - failures in any of this should be silently ignored
|
// Wrap this in a try/catch - failures in any of this should be silently ignored
|
||||||
try {
|
try {
|
||||||
$parts = explode(":", STATSD_HOST);
|
$parts = explode(":", STATSD_HOST);
|
||||||
$host = $parts[0];
|
$host = $parts[0];
|
||||||
$port = $parts[1];
|
$port = $parts[1];
|
||||||
$fp = fsockopen("udp://$host", $port, $errno, $errstr);
|
$fp = fsockopen("udp://$host", $port, $errno, $errstr);
|
||||||
|
@ -109,6 +109,7 @@ class StatsDInterface extends Extension {
|
||||||
}
|
}
|
||||||
fclose($fp);
|
fclose($fp);
|
||||||
} catch (Exception $e) {
|
} catch (Exception $e) {
|
||||||
|
// ignore any failures.
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -20,7 +20,7 @@ Array.prototype.editcloud_remove = function (ele) {
|
||||||
|
|
||||||
var hide_text = null;
|
var hide_text = null;
|
||||||
function tageditcloud_toggle_extra(hide) {
|
function tageditcloud_toggle_extra(hide) {
|
||||||
if (hide_text == null) {
|
if (hide_text === null) {
|
||||||
hide_text = hide.innerHTML;
|
hide_text = hide.innerHTML;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -135,13 +135,13 @@ class Tag_History extends Extension {
|
||||||
// there is no history entry with that id so either the image was deleted
|
// there is no history entry with that id so either the image was deleted
|
||||||
// while the user was viewing the history, someone is playing with form
|
// while the user was viewing the history, someone is playing with form
|
||||||
// variables or we have messed up in code somewhere.
|
// variables or we have messed up in code somewhere.
|
||||||
/* calling die() is probably not a good idea, we should throw an Exception */
|
/* FIXME: calling die() is probably not a good idea, we should throw an Exception */
|
||||||
die("Error: No tag history with specified id was found.");
|
die("Error: No tag history with specified id was found.");
|
||||||
}
|
}
|
||||||
|
|
||||||
// lets get the values out of the result
|
// lets get the values out of the result
|
||||||
$stored_result_id = $result['id'];
|
$stored_result_id = $result['id'];
|
||||||
$stored_image_id = $result['image_id'];
|
$stored_image_id = int_escape($result['image_id']);
|
||||||
$stored_tags = $result['tags'];
|
$stored_tags = $result['tags'];
|
||||||
|
|
||||||
log_debug("tag_history", 'Reverting tags of Image #'.$stored_image_id.' to ['.$stored_tags.']');
|
log_debug("tag_history", 'Reverting tags of Image #'.$stored_image_id.' to ['.$stored_tags.']');
|
||||||
|
@ -267,7 +267,7 @@ class Tag_History extends Extension {
|
||||||
|
|
||||||
log_info("tag_history", 'Attempting to revert edits where '.implode(" and ", $select_code)." (".implode(" / ", $select_args).")");
|
log_info("tag_history", 'Attempting to revert edits where '.implode(" and ", $select_code)." (".implode(" / ", $select_args).")");
|
||||||
|
|
||||||
// Get all the images that the given IP has changed tags on (within the timeframe) that were last editied by the given IP
|
// Get all the images that the given IP has changed tags on (within the timeframe) that were last edited by the given IP
|
||||||
$result = $database->get_col('
|
$result = $database->get_col('
|
||||||
SELECT t1.image_id
|
SELECT t1.image_id
|
||||||
FROM tag_histories t1
|
FROM tag_histories t1
|
||||||
|
@ -304,8 +304,8 @@ class Tag_History extends Extension {
|
||||||
}
|
}
|
||||||
|
|
||||||
// lets get the values out of the result
|
// lets get the values out of the result
|
||||||
$stored_result_id = $result['id'];
|
$stored_result_id = int_escape($result['id']);
|
||||||
$stored_image_id = $result['image_id'];
|
$stored_image_id = int_escape($result['image_id']);
|
||||||
$stored_tags = $result['tags'];
|
$stored_tags = $result['tags'];
|
||||||
|
|
||||||
log_debug("tag_history", 'Reverting tags of Image #'.$stored_image_id.' to ['.$stored_tags.']');
|
log_debug("tag_history", 'Reverting tags of Image #'.$stored_image_id.' to ['.$stored_tags.']');
|
||||||
|
@ -351,7 +351,7 @@ class Tag_History extends Extension {
|
||||||
}
|
}
|
||||||
|
|
||||||
// add a history entry
|
// add a history entry
|
||||||
$row = $database->execute("
|
$database->execute("
|
||||||
INSERT INTO tag_histories(image_id, tags, user_id, user_ip, date_set)
|
INSERT INTO tag_histories(image_id, tags, user_id, user_ip, date_set)
|
||||||
VALUES (?, ?, ?, ?, now())",
|
VALUES (?, ?, ?, ?, now())",
|
||||||
array($image->id, $new_tags, $user->id, $_SERVER['REMOTE_ADDR']));
|
array($image->id, $new_tags, $user->id, $_SERVER['REMOTE_ADDR']));
|
||||||
|
|
|
@ -277,6 +277,7 @@ class Upload extends Extension {
|
||||||
}
|
}
|
||||||
|
|
||||||
$pathinfo = pathinfo($file['name']);
|
$pathinfo = pathinfo($file['name']);
|
||||||
|
$metadata = array();
|
||||||
$metadata['filename'] = $pathinfo['basename'];
|
$metadata['filename'] = $pathinfo['basename'];
|
||||||
$metadata['extension'] = $pathinfo['extension'];
|
$metadata['extension'] = $pathinfo['extension'];
|
||||||
$metadata['tags'] = $tags;
|
$metadata['tags'] = $tags;
|
||||||
|
@ -347,6 +348,7 @@ class Upload extends Extension {
|
||||||
}else{
|
}else{
|
||||||
global $user;
|
global $user;
|
||||||
$pathinfo = pathinfo($url);
|
$pathinfo = pathinfo($url);
|
||||||
|
$metadata = array();
|
||||||
$metadata['filename'] = $filename;
|
$metadata['filename'] = $filename;
|
||||||
$metadata['extension'] = getExtension($headers['Content-Type']) ?: $pathinfo['extension'];
|
$metadata['extension'] = getExtension($headers['Content-Type']) ?: $pathinfo['extension'];
|
||||||
$metadata['tags'] = $tags;
|
$metadata['tags'] = $tags;
|
||||||
|
|
Reference in a new issue