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
|
||||
$fileinfo = pathinfo($filename);
|
||||
$metadata = array();
|
||||
$metadata['filename'] = $fileinfo['basename'];
|
||||
$metadata['extension'] = $fileinfo['extension'];
|
||||
$metadata['tags'] = $posttags;
|
||||
|
|
|
@ -62,7 +62,9 @@ class XMLSitemap extends Extension {
|
|||
private function handle_full_sitemap()
|
||||
{
|
||||
global $database, $config;
|
||||
|
||||
// add index
|
||||
$index = array();
|
||||
$index[0] = $config->get_string("front_page");
|
||||
$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
|
||||
try {
|
||||
$parts = explode(":", STATSD_HOST);
|
||||
$parts = explode(":", STATSD_HOST);
|
||||
$host = $parts[0];
|
||||
$port = $parts[1];
|
||||
$fp = fsockopen("udp://$host", $port, $errno, $errstr);
|
||||
|
@ -109,6 +109,7 @@ class StatsDInterface extends Extension {
|
|||
}
|
||||
fclose($fp);
|
||||
} catch (Exception $e) {
|
||||
// ignore any failures.
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -20,7 +20,7 @@ Array.prototype.editcloud_remove = function (ele) {
|
|||
|
||||
var hide_text = null;
|
||||
function tageditcloud_toggle_extra(hide) {
|
||||
if (hide_text == null) {
|
||||
if (hide_text === null) {
|
||||
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
|
||||
// while the user was viewing the history, someone is playing with form
|
||||
// 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.");
|
||||
}
|
||||
|
||||
// lets get the values out of the result
|
||||
$stored_result_id = $result['id'];
|
||||
$stored_image_id = $result['image_id'];
|
||||
$stored_image_id = int_escape($result['image_id']);
|
||||
$stored_tags = $result['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).")");
|
||||
|
||||
// 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('
|
||||
SELECT t1.image_id
|
||||
FROM tag_histories t1
|
||||
|
@ -304,8 +304,8 @@ class Tag_History extends Extension {
|
|||
}
|
||||
|
||||
// lets get the values out of the result
|
||||
$stored_result_id = $result['id'];
|
||||
$stored_image_id = $result['image_id'];
|
||||
$stored_result_id = int_escape($result['id']);
|
||||
$stored_image_id = int_escape($result['image_id']);
|
||||
$stored_tags = $result['tags'];
|
||||
|
||||
log_debug("tag_history", 'Reverting tags of Image #'.$stored_image_id.' to ['.$stored_tags.']');
|
||||
|
@ -350,8 +350,8 @@ class Tag_History extends Extension {
|
|||
$entries++;
|
||||
}
|
||||
|
||||
// add a history entry
|
||||
$row = $database->execute("
|
||||
// add a history entry
|
||||
$database->execute("
|
||||
INSERT INTO tag_histories(image_id, tags, user_id, user_ip, date_set)
|
||||
VALUES (?, ?, ?, ?, now())",
|
||||
array($image->id, $new_tags, $user->id, $_SERVER['REMOTE_ADDR']));
|
||||
|
|
|
@ -277,6 +277,7 @@ class Upload extends Extension {
|
|||
}
|
||||
|
||||
$pathinfo = pathinfo($file['name']);
|
||||
$metadata = array();
|
||||
$metadata['filename'] = $pathinfo['basename'];
|
||||
$metadata['extension'] = $pathinfo['extension'];
|
||||
$metadata['tags'] = $tags;
|
||||
|
@ -347,6 +348,7 @@ class Upload extends Extension {
|
|||
}else{
|
||||
global $user;
|
||||
$pathinfo = pathinfo($url);
|
||||
$metadata = array();
|
||||
$metadata['filename'] = $filename;
|
||||
$metadata['extension'] = getExtension($headers['Content-Type']) ?: $pathinfo['extension'];
|
||||
$metadata['tags'] = $tags;
|
||||
|
|
Reference in a new issue