https a bunch of things

This commit is contained in:
Shish 2020-03-25 11:47:00 +00:00
parent c3b67f346b
commit 03806d0420
25 changed files with 63 additions and 63 deletions

View File

@ -30,12 +30,12 @@
Email: webmaster at shishnet.org
Issue/Bug tracker: http://github.com/shish/shimmie2/issues
Issue/Bug tracker: https://github.com/shish/shimmie2/issues
# Licence
All code is released under the [GNU GPL Version 2](http://www.gnu.org/licenses/gpl-2.0.html) unless mentioned otherwise.
All code is released under the [GNU GPL Version 2](https://www.gnu.org/licenses/gpl-2.0.html) unless mentioned otherwise.
If you give shimmie to someone else, you have to give them the source (which
should be easy, as PHP is an interpreted language...). If you want to add

View File

@ -7,7 +7,7 @@
* Also loads the theme object into $this->theme if available
*
* The original concept came from Artanis's Extension extension
* --> http://github.com/Artanis/simple-extension/tree/master
* --> https://github.com/Artanis/simple-extension/tree/master
* Then re-implemented by Shish after he broke the forum and couldn't
* find the thread where the original was posted >_<
*/
@ -115,7 +115,7 @@ abstract class ExtensionInfo
// Every credit you get costs us RAM. It stops now.
public const SHISH_NAME = "Shish";
public const SHISH_EMAIL = "webmaster@shishnet.org";
public const SHIMMIE_URL = "http://code.shishnet.org/shimmie2/";
public const SHIMMIE_URL = "https://code.shishnet.org/shimmie2/";
public const SHISH_AUTHOR = [self::SHISH_NAME=>self::SHISH_EMAIL];
public const LICENSE_GPLV2 = "GPLv2";

View File

@ -5,8 +5,8 @@
* @package Shimmie
* @copyright Copyright (c) 2007-2015, Shish et al.
* @author Shish [webmaster at shishnet.org], jgen [jeffgenovy at gmail.com]
* @link http://code.shishnet.org/shimmie2/
* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2
* @link https://code.shishnet.org/shimmie2/
* @license https://opensource.org/licenses/gpl-2.0.php GNU General Public License v2
*
* Initialise the database, check that folder
* permissions are set properly.

View File

@ -27,7 +27,7 @@ function array_iunique(array $array): array
/**
* Figure out if an IP is in a specified range
*
* from http://uk.php.net/network
* from https://uk.php.net/network
*/
function ip_in_range(string $IP, string $CIDR): bool
{
@ -86,7 +86,7 @@ function deltree(string $f): void
/**
* Copy an entire file hierarchy
*
* from a comment on http://uk.php.net/copy
* from a comment on https://uk.php.net/copy
*/
function full_copy(string $source, string $target): void
{
@ -380,7 +380,7 @@ function zglob(string $pattern): array
/**
* Figure out the path to the shimmie install directory.
*
* eg if shimmie is visible at http://foo.com/gallery, this
* eg if shimmie is visible at https://foo.com/gallery, this
* function should return /gallery
*
* PHP really, really sucks.
@ -478,7 +478,7 @@ function bool_escape($input): bool
Sometimes, I don't like PHP -- this, is one of those times...
"a boolean FALSE is not considered a valid boolean value by this function."
Yay for Got'chas!
http://php.net/manual/en/filter.filters.validate.php
https://php.net/manual/en/filter.filters.validate.php
*/
if (is_bool($input)) {
return $input;

View File

@ -101,7 +101,7 @@ function send_event(Event $event): Event
if ($tracer_enabled) {
$_tracer->begin(get_class($event));
}
// SHIT: http://bugs.php.net/bug.php?id=35106
// SHIT: https://bugs.php.net/bug.php?id=35106
$my_event_listeners = $_shm_event_listeners[get_class($event)];
ksort($my_event_listeners);

View File

@ -35,8 +35,8 @@ class UrlsTest extends TestCase
// absolute
$this->assertEquals(
"http://foo.com",
make_http("http://foo.com")
"https://foo.com",
make_http("https://foo.com")
);
}
}

View File

@ -104,7 +104,7 @@ function get_memory_limit(): int
Get PHP's configured memory limit.
Note that this is set to -1 for NO memory limit.
http://ca2.php.net/manual/en/ini.core.php#ini.memory-limit
https://ca2.php.net/manual/en/ini.core.php#ini.memory-limit
*/
$memory = parse_shorthand_int(ini_get("memory_limit"));

View File

@ -15,7 +15,7 @@ class BBCodeInfo extends ExtensionInfo
" Supported tags:
<ul>
<li>[img]url[/img]
<li>[url]<a href=\"{self::SHIMMIE_URL}\">http://code.shishnet.org/</a>[/url]
<li>[url]<a href=\"{self::SHIMMIE_URL}\">https://code.shishnet.org/</a>[/url]
<li>[email]<a href=\"mailto:{self::SHISH_EMAIL}\">webmaster@shishnet.org</a>[/email]
<li>[b]<b>bold</b>[/b]
<li>[i]<i>italic</i>[/i]

View File

@ -67,12 +67,12 @@ class BBCodeTest extends ShimmiePHPUnitTestCase
public function testURL()
{
$this->assertEquals(
$this->filter("[url]http://shishnet.org[/url]"),
"<a href=\"http://shishnet.org\">http://shishnet.org</a>"
$this->filter("[url]https://shishnet.org[/url]"),
"<a href=\"https://shishnet.org\">https://shishnet.org</a>"
);
$this->assertEquals(
$this->filter("[url=http://shishnet.org]ShishNet[/url]"),
"<a href=\"http://shishnet.org\">ShishNet</a>"
$this->filter("[url=https://shishnet.org]ShishNet[/url]"),
"<a href=\"https://shishnet.org\">ShishNet</a>"
);
$this->assertEquals(
$this->filter("[url=javascript:alert(\"owned\")]click to fail[/url]"),

View File

@ -12,5 +12,5 @@ class BlotterInfo extends ExtensionInfo
public $description = "Displays brief updates about whatever you want on every page.
Colors and positioning can be configured to match your site's design.
Development TODO at http://github.com/zshall/shimmie2/issues";
Development TODO at https://github.com/zshall/shimmie2/issues";
}

View File

@ -22,8 +22,8 @@ class DanbooruApi extends Extension
// Hackery for danbooruup 0.3.2 providing the wrong view url. This simply redirects to the proper
// Shimmie view page
// Example: danbooruup says the url is http://shimmie/api/danbooru/post/show/123
// This redirects that to http://shimmie/post/view/123
// Example: danbooruup says the url is https://shimmie/api/danbooru/post/show/123
// This redirects that to https://shimmie/post/view/123
elseif ($event->page_matches("api/danbooru/post/show")) {
$fixedlocation = make_link("post/view/" . $event->get_arg(0));
$page->set_mode(PageMode::REDIRECT);

View File

@ -20,7 +20,7 @@ class VideoFileHandlerTheme extends Themelet
if (array_key_exists($ext, $supportedExts)) {
//FLV isn't supported by <video>, but it should always fallback to the flash-based method.
if ($ext == "webm") {
//Several browsers still lack WebM support sadly: http://caniuse.com/#feat=webm
//Several browsers still lack WebM support sadly: https://caniuse.com/#feat=webm
$html .= "<!--[if IE]><p>To view webm files with IE, please <a href='https://tools.google.com/dlpage/webmmf/' target='_blank'>download this plugin</a>.</p><![endif]-->";
}

View File

@ -50,7 +50,7 @@ EOD
<div class='space' id='foot'>
<small><small>
$contact_link Serving $num_comma posts &ndash;
Running <a href='http://code.shishnet.org/shimmie2/'>Shimmie2</a>
Running <a href='https://code.shishnet.org/shimmie2/'>Shimmie2</a>
</small></small>
</div>
</div>";

View File

@ -15,7 +15,7 @@ class LinkImageTheme extends Themelet
<table><tr>
<td><fieldset>
<legend><a href='http://en.wikipedia.org/wiki/Bbcode' target='_blank'>BBCode</a></legend>
<legend><a href='https://en.wikipedia.org/wiki/Bbcode' target='_blank'>BBCode</a></legend>
<table>
".
$this->link_code("Link", $this->url($post_link, $text_link, "ubb"), "ubb_text-link").
@ -26,7 +26,7 @@ class LinkImageTheme extends Themelet
</fieldset></td>
<td><fieldset>
<legend><a href='http://en.wikipedia.org/wiki/Html' target='_blank'>HTML</a></legend>
<legend><a href='https://en.wikipedia.org/wiki/Html' target='_blank'>HTML</a></legend>
<table>
".
$this->link_code("Link", $this->url($post_link, $text_link, "html"), "html_text-link").

View File

@ -321,7 +321,7 @@ class Media extends Extension
* We need to consider the size that we are GOING TO instead.
*
* The factor of 2.5 is simply a rough guideline.
* http://stackoverflow.com/questions/527532/reasonable-php-memory-limit-for-image-resize
* https://stackoverflow.com/questions/527532/reasonable-php-memory-limit-for-image-resize
*
* @param array $info The output of getimagesize() for the source file in question.
* @return int The number of bytes an image resize operation is estimated to use.
@ -741,7 +741,7 @@ class Media extends Extension
case IMAGETYPE_PNG:
case IMAGETYPE_WEBP:
//
// More info here: http://stackoverflow.com/questions/279236/how-do-i-resize-pngs-with-transparency-in-php
// More info here: https://stackoverflow.com/questions/279236/how-do-i-resize-pngs-with-transparency-in-php
//
if (imagealphablending($image_resized, false) === false) {
throw new MediaException("Unable to disable image alpha blending");
@ -816,7 +816,7 @@ class Media extends Extension
$is_anim_gif = 0;
if (($fh = @fopen($image_filename, 'rb'))) {
try {
//check if gif is animated (via http://www.php.net/manual/en/function.imagecreatefromgif.php#104473)
//check if gif is animated (via https://www.php.net/manual/en/function.imagecreatefromgif.php#104473)
while (!feof($fh) && $is_anim_gif < 2) {
$chunk = fread($fh, 1024 * 100);
$is_anim_gif += preg_match_all('#\x00\x21\xF9\x04.{4}\x00[\x2C\x21]#s', $chunk, $matches);

View File

@ -87,7 +87,7 @@ class ResizeImage extends Extension
if ($image_obj->ext == "gif") {
$image_filename = warehouse_path(Image::IMAGE_DIR, $image_obj->hash);
if (($fh = @fopen($image_filename, 'rb'))) {
//check if gif is animated (via http://www.php.net/manual/en/function.imagecreatefromgif.php#104473)
//check if gif is animated (via https://www.php.net/manual/en/function.imagecreatefromgif.php#104473)
while (!feof($fh) && $isanigif < 2) {
$chunk = fread($fh, 1024 * 100);
$isanigif += preg_match_all('#\x00\x21\xF9\x04.{4}\x00[\x2C\x21]#s', $chunk, $matches);

View File

@ -379,7 +379,7 @@ class Setup extends Extension
$event->panel->add_block($sb);
$sb = new SetupBlock("Remote API Integration");
$sb->add_label("<a href='http://akismet.com/'>Akismet</a>");
$sb->add_label("<a href='https://akismet.com/'>Akismet</a>");
$sb->add_text_option("comment_wordpress_key", "<br>API key: ");
$sb->add_label("<br>&nbsp;<br><a href='https://www.google.com/recaptcha/admin'>ReCAPTCHA</a>");
$sb->add_text_option("api_recaptcha_privkey", "<br>Secret key: ");

View File

@ -395,8 +395,8 @@ class SourceHistory extends Extension
MySQL does NOT allow you to modify the same table which you use in the SELECT part.
Which means that these will probably have to stay as TWO separate queries...
http://dev.mysql.com/doc/refman/5.1/en/subquery-restrictions.html
http://stackoverflow.com/questions/45494/mysql-error-1093-cant-specify-target-table-for-update-in-from-clause
https://dev.mysql.com/doc/refman/5.1/en/subquery-restrictions.html
https://stackoverflow.com/questions/45494/mysql-error-1093-cant-specify-target-table-for-update-in-from-clause
*/
$min_id = $database->get_one("SELECT MIN(id) FROM source_histories WHERE image_id = :image_id", ["image_id"=>$image->id]);
$database->execute("DELETE FROM source_histories WHERE id = :id", ["id"=>$min_id]);

View File

@ -2,7 +2,7 @@
document.addEventListener('DOMContentLoaded', () => {
/** Load jQuery extensions **/
//Code via: http://stackoverflow.com/a/13106698
//Code via: https://stackoverflow.com/a/13106698
$.fn.highlight = function (fadeOut) {
fadeOut = typeof fadeOut !== 'undefined' ? fadeOut : 5000;
$(this).each(function () {

View File

@ -6,7 +6,7 @@ class TagCategoriesInfo extends ExtensionInfo
public $key = self::KEY;
public $name = "Tag Categories";
public $url = "http://code.shishnet.org/shimmie2/";
public $url = "https://code.shishnet.org/shimmie2/";
public $authors = ["Daniel Oaks"=>"danneh@danneh.net"];
public $description = "Let tags be split into 'categories', like Danbooru's tagging";
}

View File

@ -16,12 +16,12 @@ class TagEditInfo extends ExtensionInfo
<ul>
<li>source=(*, none) eg -- using this metatag will ignore anything set in the \"Source\" box
<ul>
<li>source=http://example.com -- set source to http://example.com
<li>source=https://example.com -- set source to https://example.com
<li>source=none -- set source to NULL
</ul>
</ul>
<p>Metatags can be followed by \":\" rather than \"=\" if you prefer.
<br />I.E: \"source:http://example.com\", \"source=http://example.com\" etc.
<br />I.E: \"source:https://example.com\", \"source=https://example.com\" etc.
<p>Some tagging metatags provided by extensions:
<ul>
<li>Numeric Score

View File

@ -394,8 +394,8 @@ class TagHistory extends Extension
MySQL does NOT allow you to modify the same table which you use in the SELECT part.
Which means that these will probably have to stay as TWO separate queries...
http://dev.mysql.com/doc/refman/5.1/en/subquery-restrictions.html
http://stackoverflow.com/questions/45494/mysql-error-1093-cant-specify-target-table-for-update-in-from-clause
https://dev.mysql.com/doc/refman/5.1/en/subquery-restrictions.html
https://stackoverflow.com/questions/45494/mysql-error-1093-cant-specify-target-table-for-update-in-from-clause
*/
$min_id = $database->get_one("SELECT MIN(id) FROM tag_histories WHERE image_id = :image_id", ["image_id"=>$image->id]);
$database->execute("DELETE FROM tag_histories WHERE id = :id", ["id"=>$min_id]);

View File

@ -13,7 +13,7 @@ class TagList extends Extension
$config->set_default_int(TagListConfig::LENGTH, 15);
$config->set_default_int(TagListConfig::POPULAR_TAG_LIST_LENGTH, 15);
$config->set_default_int(TagListConfig::TAGS_MIN, 3);
$config->set_default_string(TagListConfig::INFO_LINK, 'http://en.wikipedia.org/wiki/$tag');
$config->set_default_string(TagListConfig::INFO_LINK, 'https://en.wikipedia.org/wiki/$tag');
$config->set_default_string(TagListConfig::OMIT_TAGS, 'tagme*');
$config->set_default_string(TagListConfig::IMAGE_TYPE, TagListConfig::TYPE_RELATED);
$config->set_default_string(TagListConfig::RELATED_SORT, TagListConfig::SORT_ALPHABETICAL);
@ -341,7 +341,7 @@ class TagList extends Extension
/*
strtolower() vs. mb_strtolower()
( See http://www.php.net/manual/en/function.mb-strtolower.php for more info )
( See https://www.php.net/manual/en/function.mb-strtolower.php for more info )
PHP5's strtolower function does not support Unicode (UTF-8) properly, so
you have to use another function, mb_strtolower, to handle UTF-8 strings.

View File

@ -30,20 +30,20 @@ var Tagger = {
this.tag.list = null;
this.tag.suggest = null;
this.tag.image_tags();
// reveal
this.editor.container.style.display = "";
// dragging
DragHandler.attach(this.editor.titlebar);
// positioning
this.position.load();
// events
window.onunload = function () { Tagger.position.save(); };
},
alert : function (type,text,timeout) {
var id = "tagger_alert-"+type;
var t_alert = byId(id);
@ -67,9 +67,9 @@ var Tagger = {
}
}
},
editor : {},
tag : {
submit : function () {
var l = this.list.childNodes.length;
@ -82,14 +82,14 @@ var Tagger = {
this.parent.editor.tags.value = tags;
return true;
},
search : function(s,ms) {
clearTimeout(Tagger.tag.timer);
Tagger.tag.timer = setTimeout(
"Tagger.tag.ajax('"+Tagger.tag.query+"?s="+s+"',Tagger.tag.receive)",
ms);
},
receive : function (xml) {
if(xml) {
Tagger.tag.suggest = document.importNode(
@ -104,7 +104,7 @@ var Tagger = {
Tagger.alert("maxout",false);
}
},
image_tags : function(xml) {
if (!xml) {
this.ajax(this.query+"/"+this.image,this.image_tags);
@ -115,10 +115,10 @@ var Tagger = {
Tagger.tag.publish(Tagger.tag.list,byId("tagger_p-applied"));
}
},
publish : function (list, page) {
list.setAttribute("xmlns","http://www.w3.org/1999/xhtml");
var l = list.childNodes.length;
for(var i=0; i<l; i++) {
var tag = list.childNodes[i];
@ -128,11 +128,11 @@ var Tagger = {
};
tag.setAttribute("title",tag.getAttribute("count")+" uses");
}
page.innerHTML = "";
page.appendChild(list);
},
create : function (tag_name) {
if(tag_name.length > 0) {
var tag = document.createElement("tag");
@ -146,7 +146,7 @@ var Tagger = {
Tagger.tag.list.appendChild(tag);
}
},
toggle : function (tag) {
if(tag.parentNode == this.list) {
this.list.removeChild(tag);
@ -154,7 +154,7 @@ var Tagger = {
this.list.appendChild(tag);
}
},
ajax : function (url, callback) {
var http = (new XMLHttpRequest() || new ActiveXObject("Microsoft.XMLHTTP"));
http.open("GET",url,true);
@ -164,7 +164,7 @@ var Tagger = {
http.send(null);
}
},
position : {
set : function (x,y) {
if (!x || !y) {
@ -182,9 +182,9 @@ var Tagger = {
this.parent.editor.container.style.right = "";
this.parent.editor.container.style.bottom = "";
},
get : function () {
// http://www.quirksmode.org/js/findpos.html
// https://www.quirksmode.org/js/findpos.html
var left = 0;
var top = 0;
var obj = this.parent.editor.container;
@ -198,7 +198,7 @@ var Tagger = {
}
return [left,top];
},
save : function (x,y) {
if (!x || !y) {
var xy = this.get();
@ -207,7 +207,7 @@ var Tagger = {
}
Cookies.set(config.title+"_tagger-position", x+" "+y, {expires: 14});
},
load : function () {
var p = Cookies.get(config.title+"_tagger-position");
if(p) {

View File

@ -346,7 +346,7 @@ class Wiki extends Extension
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
http://www.gnu.org/licenses/gpl.html
https://www.gnu.org/licenses/gpl.html
About:
I searched a function to compare arrays and the array_diff()