From c71fce062869285d6d493ed7b5fd3323d9ca2198 Mon Sep 17 00:00:00 2001 From: Shish Date: Sun, 4 Feb 2024 00:33:40 +0000 Subject: [PATCH 01/13] home page lacks base-href --- ext/autocomplete/script.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ext/autocomplete/script.js b/ext/autocomplete/script.js index ecb9fdd4..35eb01f4 100644 --- a/ext/autocomplete/script.js +++ b/ext/autocomplete/script.js @@ -42,7 +42,7 @@ function updateCompletions(element) { } else { element.completer_timeout = setTimeout(() => { - fetch(document.body.getAttribute("data-base-href") + '/api/internal/autocomplete?s=' + word).then( + fetch((document.body.getAttribute("data-base-href") ?? "") + '/api/internal/autocomplete?s=' + word).then( (response) => response.json() ).then((json) => { if(element.selected_completion !== -1) { From 0588f9af3e17c1845c4e9016470f9fb35afa0bd1 Mon Sep 17 00:00:00 2001 From: Shish Date: Sun, 4 Feb 2024 00:43:47 +0000 Subject: [PATCH 02/13] bump --- core/sys_config.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/sys_config.php b/core/sys_config.php index 64d55b33..0ae42119 100644 --- a/core/sys_config.php +++ b/core/sys_config.php @@ -31,7 +31,7 @@ _d("DEBUG", false); // boolean print various debugging details _d("COOKIE_PREFIX", 'shm'); // string if you run multiple galleries with non-shared logins, give them different prefixes _d("SPEED_HAX", false); // boolean do some questionable things in the name of performance _d("WH_SPLITS", 1); // int how many levels of subfolders to put in the warehouse -_d("VERSION", "2.10.1"); // string shimmie version +_d("VERSION", "2.10.2"); // string shimmie version _d("TIMEZONE", null); // string timezone _d("EXTRA_EXTS", ""); // string optional extra extensions _d("BASE_HREF", null); // string force a specific base URL (default is auto-detect) From 88530f5f67a18ec490ac58cf5995b3055a835734 Mon Sep 17 00:00:00 2001 From: Shish Date: Mon, 5 Feb 2024 23:01:22 +0000 Subject: [PATCH 03/13] [ext manager] interpret 'off' as 'turn off extension' --- ext/ext_manager/main.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ext/ext_manager/main.php b/ext/ext_manager/main.php index 73b176d1..8d58c83a 100644 --- a/ext/ext_manager/main.php +++ b/ext/ext_manager/main.php @@ -117,7 +117,7 @@ class ExtManager extends Extension } /** - * @param array $settings + * @param array $settings */ private function set_things(array $settings): void { @@ -125,7 +125,7 @@ class ExtManager extends Extension $extras = []; foreach (ExtensionInfo::get_all_keys() as $key) { - if (!in_array($key, $core) && isset($settings["ext_$key"])) { + if (!in_array($key, $core) && isset($settings["ext_$key"]) && $settings["ext_$key"] === "on") { $extras[] = $key; } } From 4cd0419b0398e99949acac0cced75250257aedf5 Mon Sep 17 00:00:00 2001 From: Shish Date: Mon, 5 Feb 2024 23:04:13 +0000 Subject: [PATCH 04/13] bump --- core/sys_config.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/sys_config.php b/core/sys_config.php index 0ae42119..9ee7e518 100644 --- a/core/sys_config.php +++ b/core/sys_config.php @@ -31,7 +31,7 @@ _d("DEBUG", false); // boolean print various debugging details _d("COOKIE_PREFIX", 'shm'); // string if you run multiple galleries with non-shared logins, give them different prefixes _d("SPEED_HAX", false); // boolean do some questionable things in the name of performance _d("WH_SPLITS", 1); // int how many levels of subfolders to put in the warehouse -_d("VERSION", "2.10.2"); // string shimmie version +_d("VERSION", "2.10.3"); // string shimmie version _d("TIMEZONE", null); // string timezone _d("EXTRA_EXTS", ""); // string optional extra extensions _d("BASE_HREF", null); // string force a specific base URL (default is auto-detect) From 5059520935d78ec40d8941d61ff3a6fcc68f7648 Mon Sep 17 00:00:00 2001 From: Shish Date: Mon, 5 Feb 2024 23:16:31 +0000 Subject: [PATCH 05/13] a little clarity --- ext/ext_manager/main.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/ext/ext_manager/main.php b/ext/ext_manager/main.php index 8d58c83a..55f21024 100644 --- a/ext/ext_manager/main.php +++ b/ext/ext_manager/main.php @@ -125,7 +125,10 @@ class ExtManager extends Extension $extras = []; foreach (ExtensionInfo::get_all_keys() as $key) { - if (!in_array($key, $core) && isset($settings["ext_$key"]) && $settings["ext_$key"] === "on") { + if (in_array($key, $core)) { + continue; // core extensions are always enabled + } + if (isset($settings["ext_$key"]) && $settings["ext_$key"] === "on") { $extras[] = $key; } } From c64c796398bc56a98764051c1ee83dd8b826491b Mon Sep 17 00:00:00 2001 From: Shish Date: Tue, 6 Feb 2024 10:31:47 +0000 Subject: [PATCH 06/13] [core] fix --user CLI flag, fixes #1022 --- core/cli_app.php | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/core/cli_app.php b/core/cli_app.php index 3867f7b0..47fec20b 100644 --- a/core/cli_app.php +++ b/core/cli_app.php @@ -21,7 +21,7 @@ class CliApp extends \Symfony\Component\Console\Application $definition->addOption(new InputOption( '--user', '-u', - InputOption::VALUE_NONE, + InputOption::VALUE_REQUIRED, 'Log in as the given user' )); @@ -36,9 +36,10 @@ class CliApp extends \Symfony\Component\Console\Application $output ??= new ConsoleOutput(); if ($input->hasParameterOption(['--user', '-u'])) { - $user = User::by_name($input->getOption('user')); + $name = $input->getParameterOption(['--user', '-u']); + $user = User::by_name($name); if (is_null($user)) { - die("Unknown user"); + die("Unknown user '$name'\n"); } else { send_event(new UserLoginEvent($user)); } From db902d6d2600768045ddffdc9a15096c5aa5c51a Mon Sep 17 00:00:00 2001 From: Shish Date: Tue, 6 Feb 2024 20:53:55 +0000 Subject: [PATCH 07/13] [r34] remove custom parts --- ext/rule34/info.php | 21 -- ext/rule34/main.php | 123 -------- ext/rule34/script.js | 39 --- ext/rule34/style.css | 35 --- themes/rule34v2/.gitignore | 8 - themes/rule34v2/flags/china-flag.png | Bin 239 -> 0 bytes themes/rule34v2/flags/dutch-flag.png | Bin 227 -> 0 bytes themes/rule34v2/flags/english-flag.png | Bin 371 -> 0 bytes themes/rule34v2/flags/finnish-flag.png | Bin 218 -> 0 bytes themes/rule34v2/flags/german-flag.png | Bin 154 -> 0 bytes themes/rule34v2/flags/italian-flag.png | Bin 240 -> 0 bytes themes/rule34v2/flags/norway-flag.png | Bin 231 -> 0 bytes themes/rule34v2/flags/port-flag.png | Bin 328 -> 0 bytes themes/rule34v2/flags/russian-flag.png | Bin 220 -> 0 bytes themes/rule34v2/flags/spain-flag.png | Bin 275 -> 0 bytes themes/rule34v2/flags/swedish-flag.png | Bin 152 -> 0 bytes themes/rule34v2/header.inc | 100 ------- themes/rule34v2/index.theme.php | 50 ---- themes/rule34v2/menuh.css | 121 -------- themes/rule34v2/page.class.php | 136 --------- themes/rule34v2/prebid-ads.js | 1 - themes/rule34v2/rule34_logo_top.png | Bin 17886 -> 0 bytes themes/rule34v2/script.js | 48 ---- themes/rule34v2/static/favicon.ico | Bin 1406 -> 0 bytes themes/rule34v2/style.css | 379 ------------------------- themes/rule34v2/themelet.class.php | 53 ---- themes/rule34v2/upload.theme.php | 44 --- themes/rule34v2/user.theme.php | 59 ---- 28 files changed, 1217 deletions(-) delete mode 100644 ext/rule34/info.php delete mode 100644 ext/rule34/main.php delete mode 100644 ext/rule34/script.js delete mode 100644 ext/rule34/style.css delete mode 100644 themes/rule34v2/.gitignore delete mode 100644 themes/rule34v2/flags/china-flag.png delete mode 100644 themes/rule34v2/flags/dutch-flag.png delete mode 100644 themes/rule34v2/flags/english-flag.png delete mode 100644 themes/rule34v2/flags/finnish-flag.png delete mode 100644 themes/rule34v2/flags/german-flag.png delete mode 100644 themes/rule34v2/flags/italian-flag.png delete mode 100644 themes/rule34v2/flags/norway-flag.png delete mode 100644 themes/rule34v2/flags/port-flag.png delete mode 100644 themes/rule34v2/flags/russian-flag.png delete mode 100644 themes/rule34v2/flags/spain-flag.png delete mode 100644 themes/rule34v2/flags/swedish-flag.png delete mode 100644 themes/rule34v2/header.inc delete mode 100644 themes/rule34v2/index.theme.php delete mode 100644 themes/rule34v2/menuh.css delete mode 100644 themes/rule34v2/page.class.php delete mode 100644 themes/rule34v2/prebid-ads.js delete mode 100644 themes/rule34v2/rule34_logo_top.png delete mode 100644 themes/rule34v2/script.js delete mode 100644 themes/rule34v2/static/favicon.ico delete mode 100644 themes/rule34v2/style.css delete mode 100644 themes/rule34v2/themelet.class.php delete mode 100644 themes/rule34v2/upload.theme.php delete mode 100644 themes/rule34v2/user.theme.php diff --git a/ext/rule34/info.php b/ext/rule34/info.php deleted file mode 100644 index e2c9a4f6..00000000 --- a/ext/rule34/info.php +++ /dev/null @@ -1,21 +0,0 @@ -notify("shm_image_bans", $event->image->hash); - } - - public function onImageInfoSet(ImageInfoSetEvent $event): void - { - global $cache; - $cache->delete("thumb-block:{$event->image->id}"); - } - - public function onAdminBuilding(AdminBuildingEvent $event): void - { - global $page; - $html = make_form(make_link("admin/cache_purge"), "POST"); - $html .= ""; - $html .= "
"; - $html .= "\n"; - $page->add_block(new Block("Cache Purger", $html)); - } - - public function onCliGen(CliGenEvent $event): void - { - $event->app->register('wipe-thumb-cache') - ->addArgument('tags', InputArgument::REQUIRED) - ->setDescription('Delete cached thumbnails for images matching the given tags') - ->setCode(function (InputInterface $input, OutputInterface $output): int { - global $cache; - $tags = Tag::explode($input->getArgument('tags')); - foreach (Search::find_images_iterable(0, null, $tags) as $image) { - $output->writeln((string)$image->id); - $cache->delete("thumb-block:{$image->id}"); - } - return Command::SUCCESS; - }); - } - - public function onSourceSet(SourceSetEvent $event): void - { - // Maybe check for 404? - if (empty($event->source)) { - return; - } - if (!preg_match("/^(https?:\/\/)?[a-zA-Z0-9\.\-]+(\/.*)?$/", $event->source)) { - throw new SCoreException("Invalid source URL"); - } - } - - public function onRobotsBuilding(RobotsBuildingEvent $event): void - { - // robots should only check the canonical site, not mirrors - if ($_SERVER['HTTP_HOST'] != "rule34.paheal.net") { - $event->add_disallow(""); - } - } - - public function onPageRequest(PageRequestEvent $event): void - { - global $database, $page, $user; - - # Database might not be connected at this point... - #$database->set_timeout(null); // deleting users can take a while - - $page->add_html_header(""); - $page->add_html_header(""); - - if ($event->page_matches("tnc_agreed")) { - setcookie("ui-tnc-agreed", "true", 0, "/"); - $page->set_mode(PageMode::REDIRECT); - $page->set_redirect(referer_or("/")); - } - - if ($event->page_matches("admin/cache_purge")) { - if (!$user->can(Permissions::MANAGE_ADMINTOOLS)) { - $this->theme->display_permission_denied(); - } else { - if ($user->check_auth_token()) { - $all = $_POST["hash"]; - $matches = []; - if (preg_match_all("/([a-fA-F0-9]{32})/", $all, $matches)) { - $matches = $matches[0]; - foreach ($matches as $hash) { - $page->flash("Cleaning {$hash}"); - if (strlen($hash) != 32) { - continue; - } - log_info("admin", "Cleaning {$hash}"); - @unlink(warehouse_path(Image::IMAGE_DIR, $hash)); - @unlink(warehouse_path(Image::THUMBNAIL_DIR, $hash)); - $database->notify("shm_image_bans", $hash); - } - } - } - - $page->set_mode(PageMode::REDIRECT); - $page->set_redirect(make_link("admin")); - } - } - } -} diff --git a/ext/rule34/script.js b/ext/rule34/script.js deleted file mode 100644 index 6c41f30e..00000000 --- a/ext/rule34/script.js +++ /dev/null @@ -1,39 +0,0 @@ -let tnc_div = document.createElement('div'); -tnc_div.innerHTML = ` -
-
-

Cookies may be used. Please read our privacy policy for more information. -

By accepting to enter you agree to our rules and terms of service. -

Agree / Disagree -

-`; - - -document.addEventListener('DOMContentLoaded', () => { - if(shm_cookie_get("ui-tnc-agreed") !== "true" && window.location.href.indexOf("/wiki/") == -1) { - document.body.classList.add('censored'); - document.body.appendChild(tnc_div); - } -}); - -function tnc_agree() { - shm_cookie_set("ui-tnc-agreed", "true"); - document.body.classList.remove('censored'); - tnc_div.remove(); -} - -function image_hash_ban(id) { - var reason = prompt("WHY?", "DNP"); - if(reason) { - $.post( - "/image_hash_ban/add", - { - "image_id": id, - "reason": reason, - }, - function() { - $("#thumb_" + id).parent().parent().hide(); - } - ); - } -} diff --git a/ext/rule34/style.css b/ext/rule34/style.css deleted file mode 100644 index 13aca22b..00000000 --- a/ext/rule34/style.css +++ /dev/null @@ -1,35 +0,0 @@ -BODY.censored #header, -BODY.censored NAV, -BODY.censored ARTICLE, -BODY.censored FOOTER { - filter: blur(10px); -} -.tnc_bg { - position: fixed; - top: 0; - left: 0; - right: 0; - bottom: 0; - background: #ACE4A3; - opacity: 0.75; - z-index: 999999999999999999999; -} -.tnc { - position: fixed; - top: 20%; - left: 20%; - right: 20%; - text-align: center; - font-size: 2rem; - background: #ACE4A3; - border: 1px solid #7EB977; - z-index: 9999999999999999999999; -} -@media (max-width: 1024px) { - .tnc { - top: 5%; - left: 5%; - right: 5%; - font-size: 3vw; - } -} diff --git a/themes/rule34v2/.gitignore b/themes/rule34v2/.gitignore deleted file mode 100644 index 13c95f72..00000000 --- a/themes/rule34v2/.gitignore +++ /dev/null @@ -1,8 +0,0 @@ -*.png -*.jpg -*.gif -*.mp3 -*.html -ad* -ads* -random* diff --git a/themes/rule34v2/flags/china-flag.png b/themes/rule34v2/flags/china-flag.png deleted file mode 100644 index b54e1c73fe42c367a13f40fbdc7f9ae38dc6550f..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 239 zcmeAS@N?(olHy`uVBq!ia0vp^l0YoL!VDw@Pn?_qr1%4TLR|kdF#P||@P94C|4xSg zw-{!z7IgxpI14-?i-EKU7`vU!wgWO$JY5_^IIbrr9AIG5uu)^S2o9Lg$f|gzovz1_n=8KbLh*2~7Y=7(qG! diff --git a/themes/rule34v2/flags/dutch-flag.png b/themes/rule34v2/flags/dutch-flag.png deleted file mode 100644 index 99d69fde982aa639806fa09b5fd178ac3554edf6..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 227 zcmeAS@N?(olHy`uVBq!ia0vp^l0YoL#0(_ob=X({DV_kI5Z8SS>i_@$&uQLe9kp1c zpBW_1S>O>_45U54*zIJt9grdI>Eal|aXmRfL8zsvk=e0IRKmpI4|_9nO9n&Q6vNPm zqQ?_~%2Z2SBT7;dOH!?pi&B9UgOP!up{}8ku8~QIk)f5bnU#s5wt<0_fx)+JS8kwa c$jwj5OsmALq5XAE3Qz-sr>mdKI;Vst01x*&{Qv*} diff --git a/themes/rule34v2/flags/english-flag.png b/themes/rule34v2/flags/english-flag.png deleted file mode 100644 index c171928ba104ce51ccb0d84fd805af5882a205a1..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 371 zcmeAS@N?(olHy`uVBq!ia0vp^l0YoL!3-p?Sg6bdQZ@lTA+G-!82J>RsP0cA&rkqn$obvtq_y6zT|KGd!`Sb7pH8qbNd%kw2C2JN#=5iW=uj&fgEW- zn^j9(BT7;dOH!?pi&B9UgOP!uk*)y{nTHq}SQ(jEnHp;w7+4t?WISmB1_P3Y-29Zx ov`UZ$LtUUABa;v#Ln~u5D-%PAhW6JvAP+Nmy85}Sb4q9e0J*G*%K!iX diff --git a/themes/rule34v2/flags/finnish-flag.png b/themes/rule34v2/flags/finnish-flag.png deleted file mode 100644 index eddfdba4fa597b4d9ae4f637109c9e84b33cb737..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 218 zcmeAS@N?(olHy`uVBq!ia0vp^l0YoL$P6TJYPh`sQfvV}A+G=b|F@1>TvR@<87RV8 z;1O92q&>jc?PRtckRjpe;uyklJvpJ~z<~n|lYjjGU(amS7|zac=cGiV`B(Kapc>T@ z*NBpo#FA92_-ZK4Jg> diff --git a/themes/rule34v2/flags/german-flag.png b/themes/rule34v2/flags/german-flag.png deleted file mode 100644 index 1b9d04f685937b76edff91a1951643ca31db2251..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 154 zcmeAS@N?(olHy`uVBq!ia0vp^l0YoL#0(_ob=X({DaPU;cPEB*=VV?2Ih+ALA+Cx% z4F7}~{-0&&3`*Js5-jkDEM{Qf76xHPhFNnYfP(BLp1!W^cbM3@R86|x?^y{H68Cg* s4B@z*oS-1o($vU&@r#y0hJp(-gOaxL!#c^$oIoWEp00i_>zopr0KlIlYXATM diff --git a/themes/rule34v2/flags/italian-flag.png b/themes/rule34v2/flags/italian-flag.png deleted file mode 100644 index c687ea2bf33486baa572d339ef9b76138a7d9a52..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 240 zcmeAS@N?(olHy`uVBq!ia0vp^l0YoL!VDw@Pn?_qr1%4TLR=YoUH||8|LfoXKmY$< zQqrDRt78R}VodUOcVYa`q+YZQ(@N{tu;kcfhz`&%as;Vk1 zE-udAmUx_*VVA3PqrCd=2%s9(64!{5l*E!$tK_0oAjM#0U}&goXryao5@KX%Wo%|; qVyJCkU}a$NZQGR_C>nC}Q!>*kacgLQos$C8z~JfX=d#Wzp$PyFr9lq> diff --git a/themes/rule34v2/flags/norway-flag.png b/themes/rule34v2/flags/norway-flag.png deleted file mode 100644 index 0e9bb5a87224ab431459f708de5dfa9fff153007..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 231 zcmeAS@N?(olHy`uVBq!ia0vp^l0YoL#0(_ob=X({Db4_&5Z8YUO#lD?S5hh8rz`s$ zBv{}PSq!8-z}W3%wjGe6o=I4RsBTbd5|xj0~-e&8$oewG9lc3=F<) hyK)0XLvDUbW?Cg~4ehUUQh*v5JYD@<);T3K0RU0pJ-Pq@ diff --git a/themes/rule34v2/flags/port-flag.png b/themes/rule34v2/flags/port-flag.png deleted file mode 100644 index b883e280bca1827615b1f035c831f34cbdb13bbf..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 328 zcmeAS@N?(olHy`uVBq!ia0vp^l0YoL!3-p?Sg6bdQpN#3A+8Js3_pNu4Tc{-7#b=V z7(5snIv5xN7;Z2CMSi?sU??bHV5neFFkq07kZ=Gp1sEis9*_cRVNCLNcVXyYmGuB} zI14-?i-9zV?ZM!7GTRQw@bPqU43W6J^@1f|gMk3EgLJW_%)|fddzD-mZ?-Arxo1am z+dNc%q10^BW^{G7<%Fm2qM|3}sIQ#L`)!`Y3C3H?i#9lj|I~Z^rP)4+q2egx&7}2{ zfsSKPEpd$~Nl7e8wMs5Z1yT$~28M>ZhDN$ZCLuo#lCWhJu237_J-?m)=dIU*B cZhlH;S|x4`?XPoEfEpM)UHx3vIVCg!0EI|jbpQYW diff --git a/themes/rule34v2/flags/russian-flag.png b/themes/rule34v2/flags/russian-flag.png deleted file mode 100644 index 95333f6f0561059a312feba17fe99a1ab812c743..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 220 zcmeAS@N?(olHy`uVBq!ia0vp^l0YoL#0(_ob=X({Db4_&5ZC|z|MNJ``VZu$>V5(V z7I;J!18EO1b~~AE2V{tQx;Tb#Tu)9=5Nc^^WWM-C%OFF+g_%J~Tlry~FVdQ&MBb@0N=GZ-v9sr diff --git a/themes/rule34v2/flags/spain-flag.png b/themes/rule34v2/flags/spain-flag.png deleted file mode 100644 index 4c2921f04434c5ee280f2b395e5de25f184cdc68..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 275 zcmeAS@N?(olHy`uVBq!ia0vp^l0YoL!VDw@Pn?_qq|^g^LR`-=GyfJmH(ck1GR7#ctjQhX%8@VJDF_f9Rag8WRNi0dVN-jzTQVd20hK9O^M!H5OAx4H)#%5L~hS~-ORt5&&wq3b_ dq9HdwB{QuOw}$rDIVnI544$rjF6*2UngG`FRK@@R diff --git a/themes/rule34v2/flags/swedish-flag.png b/themes/rule34v2/flags/swedish-flag.png deleted file mode 100644 index b0e4a76018bac866127035bfd6d633b93173f17b..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 152 zcmeAS@N?(olHy`uVBq!ia0vp^l0YoL$P6TJYPh`sQjEnx?oJHr&dIz4a@YcVLR|SG zm)*UlZW`|73l!lj@Q5sCU=SAqVaD|Nmq3QFmw5WRvfp81=TcReV486SC?w(O;uykl rJvpJ`00Ya8j{pDvn=cTqC}m){bzP!##VzrEpc)2GS3j3^P6 - - - logo - - - - -
- -  Sidebar  - - - logo - - - - - - - -
- - - - - - - - - diff --git a/themes/rule34v2/index.theme.php b/themes/rule34v2/index.theme.php deleted file mode 100644 index 02602f56..00000000 --- a/themes/rule34v2/index.theme.php +++ /dev/null @@ -1,50 +0,0 @@ -can("delete_image") ? "can-del" : ""; - $h_query = html_escape($query); - - $table = "
"; - foreach ($images as $image) { - $table .= $this->build_thumb_html($image); - } - $table .= "
"; - return $table; - } - - // Override to add a custom error message - public function display_page(Page $page, $images): void - { - $this->display_page_header($page, $images); - - $nav = $this->build_navigation($this->page_number, $this->total_pages, $this->search_terms); - if (!empty($this->search_terms)) { - static::$_search_query = $this->search_terms; - } - $page->add_block(new Block("Navigation", $nav, "left", 0)); - - if (count($images) > 0) { - $this->display_page_images($page, $images); - } else { - $this->display_error( - 404, - "No Posts Found", - "No images were found to match the search criteria. Try looking up a character/series/artist by another name if they go by more than one. Remember to use underscores in place of spaces and not to use commas. If you came to this page by following a link, try using the search box directly instead. See the FAQ for more information." - ); - } - } -} diff --git a/themes/rule34v2/menuh.css b/themes/rule34v2/menuh.css deleted file mode 100644 index 1fb96d80..00000000 --- a/themes/rule34v2/menuh.css +++ /dev/null @@ -1,121 +0,0 @@ -/* Begin CSS Drop Down Menu */ - -a:link.menu { color:#FF0000; text-decoration: none; } - -a:visited.menu { color: #FF0000; text-decoration: none; } - -a:hover.menu { color: #FF0000; text-decoration: none; } - -a:active.menu { color: #FF0000; text-decoration: none; } - -#menuh-container - { - font-size: 1rem; - float: left; - top:0; - left: 5%; - width: 100%; - margin: 0; - } - -#menuh - { - font-size: small; - font-family: arial, helvetica, sans-serif; - width:100%; - margin-top: 0; - } - -#menuh a.sub_option - { - border: 1px solid #555; - /*background-image:url(topban.jpg);*/ - } - -#menuh a - { - text-align: center; - background: #ACE4A3; - display:block; - white-space:nowrap; - margin: 0; - padding: 0.2em; - } - -#menuh a, #menuh a:visited /* menu at rest */ - { - color: #000099; - text-decoration:none; - } - -#menuh a:hover /* menu at mouse-over */ - { - color: #000000; - } - -#menuh a.top_parent, #menuh a.top_parent:hover /* attaches down-arrow to all top-parents */ - { - /*background-image: url(navdown_white.gif);*/ - background-position: right center; - background-repeat: no-repeat; - } - -#menuh a.parent, #menuh a.parent:hover /* attaches side-arrow to all parents */ - { - /*background-image: url(nav_white.gif);*/ - background-position: right center; - border: 1px solid #555; - background-repeat: no-repeat; - } - -#menuh ul - { - list-style:none; - margin:0; - padding:0; - float:left; - width:10em; /* width of all menu boxes */ - } - -#menuh li - { - position:relative; - min-height: 1px; /* Sophie Dennis contribution for IE7 */ - vertical-align: bottom; /* Sophie Dennis contribution for IE7 */ - } - -#menuh ul ul - { - position:absolute; - z-index:500; - top:auto; - display:none; - padding: 1em; - margin:-1em 0 0 -1em; - } - -#menuh ul ul ul - { - top:0; - left:100%; - } - -div#menuh li:hover - { - cursor:pointer; - z-index:100; - } - -div#menuh li:hover ul ul, -div#menuh li li:hover ul ul, -div#menuh li li li:hover ul ul, -div#menuh li li li li:hover ul ul -{display:none;} - -div#menuh li:hover ul, -div#menuh li li:hover ul, -div#menuh li li li:hover ul, -div#menuh li li li li:hover ul -{display:block;} - -/* End CSS Drop Down Menu */ diff --git a/themes/rule34v2/page.class.php b/themes/rule34v2/page.class.php deleted file mode 100644 index e11cd76c..00000000 --- a/themes/rule34v2/page.class.php +++ /dev/null @@ -1,136 +0,0 @@ -get_string('theme', 'default'); - $header_html = $this->get_all_html_headers(); - $data_href = get_base_href(); - - return <<{$this->title} - - - - -$header_html - - - - - -EOD; - } - - public function body_html(): string - { - global $config, $user; - - $left_block_html = ""; - $right_block_html = ""; - $main_block_html = ""; - $head_block_html = ""; - $sub_block_html = ""; - - $main_headings = 0; - foreach ($this->blocks as $block) { - if ($block->section == "main" && !empty($block->header) && $block->header != "Comments") { - $main_headings++; - } - } - - foreach ($this->blocks as $block) { - switch ($block->section) { - case "left": - $left_block_html .= $block->get_html(true); - break; - case "right": - $right_block_html .= $block->get_html(true); - break; - case "head": - $head_block_html .= "".$block->get_html(false).""; - break; - case "main": - if ($main_headings == 1) { - $block->header = null; - } - $main_block_html .= $block->get_html(false); - break; - case "subheading": - $sub_block_html .= $block->body; // $block->get_html(true); - break; - default: - print "

error: {$block->header} using an unknown section ({$block->section})"; - break; - } - } - - $query = !empty(CustomIndexTheme::$_search_query) ? html_escape(Tag::implode(CustomIndexTheme::$_search_query)) : ""; - // @phpstan-ignore-next-line - yes this is deliberately asserting a constant - assert(!is_null($query)); # used in header.inc, do not remove :P - $flash_html = $this->flash ? "".nl2br(html_escape(implode("\n", $this->flash)))."" : ""; - $generated = autodate(date('c')); - $footer_html = $this->footer_html(); - - $header_inc = file_get_contents_ex("themes/rule34v2/header.inc"); - assert($header_inc !== false); - $header_inc = str_replace('$QUERY', $query, $header_inc); - return << - - $header_inc - $head_block_html - - - $sub_block_html - -

- -
- $flash_html - - $main_block_html -
- - - - - - -EOD; - } -} diff --git a/themes/rule34v2/prebid-ads.js b/themes/rule34v2/prebid-ads.js deleted file mode 100644 index 59a38482..00000000 --- a/themes/rule34v2/prebid-ads.js +++ /dev/null @@ -1 +0,0 @@ -var canRunAds = true; diff --git a/themes/rule34v2/rule34_logo_top.png b/themes/rule34v2/rule34_logo_top.png deleted file mode 100644 index 98298cb0353771dcf5d3f65610762fba08e3d007..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 17886 zcmV)RK(oJzP)_rK@Oo6YQIW_C9O1zf)GegU#GJLR2w&#liwL>5c4DsFMhl_oc_)L?mo z*ezG4v}ZYC2V8rJm)6(~U^jr>as|nYESV0#tBOC%?QQ_O0qmA5L#nZCb`rd*{LE6` z4PZBb-SY2CN0xKCKy6ad2*CN$YP$jKUO-o^zyej#$kiC7y@Mr852PN=ucJpld4?>F zD;R-zElW8!fZag2+VZ0fSiWc3#&TRnY+;eSCADnLa?e$AKi}$tvylhA(DfBsuyP^Y z@$P;6@A5_w6DZ(-KlS*j zH(45Zi2v8Q&pj;Hy8-N$D_z>Lq`DaB$z%EM3cjZay4U@xg_`zxjXXU)$?t$4t>3bN zYJBoEgV>^XkLOuFbpzNfSF$wIDQs{>zP!SG_9t0BW=St`t&Pi5wbr-Ll!em-cz5sK zO#wdsG+^Q&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DFXtwxmqXSVsv~1T3da}!N&I~Oqyb|LV*9w5u*0eLGAm(Zr zqPx)Is+IN@ldV3>^MJcsF^judRhd$(>d5EqdL`cHwFF?t zEr?B(sws@Z=`ra`nzwBsH5=GkDNZ*Y=XsAC3|FPRV%)H=**d0)Q(NSAy;ASaxmRPOvgmZedE~ZCA^^UCRJgrMc-q0R26Gdb$_=H7D5ew4JO)_Lu#_8FEqw zM%?~jQMQXIe>L6Le*wVi%fkx_F=d$Io~ { - document.querySelectorAll("input[type='date']").forEach(e => e.setAttribute('type', 'text')); -}); - -// Navbar controls -var navHidden = false; -function toggleNav() { - if(navHidden) { - document.body.classList.remove('navHidden'); - shm_cookie_set("ui-shownav", "true"); - } - else { - document.body.classList.add('navHidden'); - shm_cookie_set("ui-shownav", "false"); - } - navHidden = !navHidden; -} - -document.addEventListener('DOMContentLoaded', () => { - if(shm_cookie_get("ui-shownav") === "false") { - toggleNav(); - } -}); - -// Desktop mode toggle -var forceDesktop = false; -function toggleDesktop() { - if(forceDesktop) { - let viewport = document.querySelector("meta[name=viewport]"); - viewport.setAttribute('content', 'width=512'); - shm_cookie_set("ui-desktop", "false"); - } - else { - let viewport = document.querySelector("meta[name=viewport]"); - viewport.setAttribute('content', 'width=1024, initial-scale=0.4'); - shm_cookie_set("ui-desktop", "true"); - navHidden = true; - toggleNav(); - } - forceDesktop = !forceDesktop; -} - -document.addEventListener('DOMContentLoaded', () => { - if(shm_cookie_get("ui-desktop") === "true") { - toggleDesktop(); - } -}); diff --git a/themes/rule34v2/static/favicon.ico b/themes/rule34v2/static/favicon.ico deleted file mode 100644 index 2ec940d8ab3c44d4a5ff81bc44e8a8f6be50881b..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1406 zcmeHGJ8#-h6#gI(9w7+{N&0Tncj%kG=_@ULQ_jLxZxu@`M%2mb=BctWRE$=KO3n}o z1|%~enFYxiBEf)UhDz>`!9xcR9Xxb!&rO0l^#@eSvA+AAdwlPAJ{`+Ih@W&CyvFf9 z3M>IwVQ>k{3{f9PW(pAC;!aqb7VMD?|CbNX^Uxpk5&RC|e0R{_>cbw|Fgqs9t_iDW z!TI69_kA>)4Y;lgqirDHQ{isA$ahqfTPl=}j`C1Lt);dQ(T`T?Iw% zWw1teLq@hOqxeCB&ECt~>~Z9vvL?e}ef3+Ndl`_{RaCwzP`;>;-b#=@R#9*3$gxkQ z%l$u9kz*}oO@+3hL;75U&iZ|xh4<4#5Cr3K?(_Zx{_6=)G?osPCK3q>r$Q4%Gz}^d zr4B|pza5(-nw(9A>0Tnca{Tg15+~wUmg!XF!il+a7cZSAie5c(VDZetvE13EI}Z;N zy?Jr-#?#DP=KNyu*(0LaWa0knLkmYA%-khbo=;D+#C(F6WLSt@drV;pr$x%msC4T| zGXH#Liqpt6FLZr1^y;NBL!!nJ-zAC(FB}oJD=4%>A`>4Zwp$(7{>gyEr>hK|A@8x+ Si(K8?*O*O)&F~n1|NlSi%-hKT diff --git a/themes/rule34v2/style.css b/themes/rule34v2/style.css deleted file mode 100644 index 3376c912..00000000 --- a/themes/rule34v2/style.css +++ /dev/null @@ -1,379 +0,0 @@ - -/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * -* things common to all pages * -* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ - -:root { - font-family: "Arial", sans-serif; - font-size: 14px; -} -BODY { - background: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAA8AAAAPBAMAAADJ+Ih5AAAAFVBMVEV8und+uXeo5aKo5qOq5aOr46Ks5KN5+6UZAAAAN0lEQVQImWNIc2FLcUhzYWBIczRLEU5zNGBwEQlxdHURCWBwdEkRcXN0SWBgVkswSgMSDDRTDADa2B2AhUf94AAAAABJRU5ErkJggg=='); - margin: 0; -} -#header { - border-bottom: 1px solid #7EB977; - margin-top: 0; - margin-bottom: 16px; - padding: 8px; - background: #ACE4A3; - text-align: center; -} -H1 { - font-size: 5rem; - margin: 0; - padding: 0; -} -H1 A { - color: black; -} -H3 { - text-align: center; - margin: 0; -} -THEAD { - font-weight: bold; -} -TD { - vertical-align: top; - text-align: center; -} - -#flash { - background: #FF7; - display: block; - padding: 8px; - margin: 8px; - border: 1px solid #882; -} - -TABLE.zebra {background: #ACE4A3; border-collapse: collapse; border: 1px solid #7EB977;} -TABLE.zebra TD {font-size: 0.8rem;margin: 0; border-top: 1px solid #7EB977; padding: 2px;} -TABLE.zebra TR:nth-child(odd) {background: #9CD493;} -TABLE.zebra TR:nth-child(even) {background: #ACE4A3;} - -FOOTER { - clear: both; - padding: 8px; - font-size: 0.7rem; - text-align: center; - border-top: 1px solid #7EB977; - background: #ACE4A3; -} - - -A {color: #000099; text-decoration: none; font-weight: bold;} -A:hover {color: #000099; text-decoration: underline;} -A:visited {color: #000099; text-decoration: none} -A:active {color: #000099; text-decoration: underline;} - -UL { - text-align: left; -} - -.ad1{ - display:flex; - justify-content:center; -} - -/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * -* the navigation bar, and all its blocks * -* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ - -NAV { - width: 250px; - float: left; - text-align: center; - margin-left: 16px; -} -NAV .blockbody { - font-size: 0.85rem; - text-align: center; -} -NAV TABLE { - width: 100%; -} -NAV TD { - vertical-align: middle; -} -NAV INPUT { - width: 100%; - padding: 0; -} -NAV SELECT { - width: 100%; - padding: 0; -} - -#Friends_of_Pahealleft { - z-index: 0; - position: relative; -} - -.comment .info { - background: #ACE4A3; - border: 1px solid #7EB977; -} - -.more:after { - content: " >>>"; -} - -.tag_count:before { - content: "("; -} -.tag_count:after { - content: ")"; -} - -#imagelist .blockbody, -#paginator .blockbody { - background: none; - border: none; - box-shadow: none; -} - -#commentlistimage .blockbody, -#commentlistrecent .blockbody { - background: none; - border: none; - box-shadow: none; - padding: 0; -} - -#commentlistimage .blockbody .comment, -#commentlistrecent .blockbody .comment { - margin-left: 0; - margin-right: 0; -} - - -/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * -* the main part of each page * -* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ - -ARTICLE { - margin-left: 276px; - margin-right: 16px; - text-align: center; - height: 1%; - margin-top: 16px; -} -ARTICLE TABLE { - width: 90%; - margin: auto; -} -NAV SECTION:first-child H3 { - margin-top: 0; -} - - -/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * -* specific page types * -* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ - -#pagelist { - margin-top: 32px; -} - -#tagmap A { - padding: 8px 4px 8px 4px; -} - -SECTION>.blockbody, .comment, .setupblock { - background: #ACE4A3; - margin: 8px; - border: 1px solid #7EB977; - padding: 8px; -} - -SECTION>H3 { - text-align: center; - background: #9CD493; - margin: 8px; - border: 1px solid #7EB977; - padding: 8px; -} - -.shm-image-list { - justify-items: center; - align-items: end; -} -.thumb { - text-align: center; -} -.thumb IMG { - border: 1px solid #7EB977; - background: #ACE4A3; - padding: 4px; -} - -.username { - font-weight: bold; -} - -#bans TD, .image_info TD { - vertical-align: middle; -} -#bans INPUT { - font-size: 0.85rem; -} - -.need-del { - display: none; -} -.can-del .need-del { - display: inline; -} - - -.unread { - color: red; -} - -[data-tags~="ai-generated"]>A>IMG { background: #BC8F8F; } -[data-tags~="animated"]>A>IMG { background: #CC00CC; } -[data-ext="mp4"]>A>IMG, -[data-ext="webm"]>A>IMG { background: #0000FF; } - -#menuh-container { - float: none; - width: 650px; - margin: auto; -} - -/* - * Image info - show both edit and view modes at the same time, - * except for Tags, Locked, and the Edit button. - */ -.image_info.infomode-view .edit, -.image_info.infomode-view .view { - display: block; -} -.image_info.infomode-view TR[data-row="Tags"] .view, -.image_info.infomode-view TR[data-row="Locked"] .view, -.image_info INPUT[type="button"][value="Edit"] { - display: none; -} - - - -/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * -* responsive overrides * -* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ - -@media (max-width: 750px) { - .atoz, #paginator { - font-size: 2rem; - } - .header-sites { - display: none; - } - SECTION>.blockbody { - overflow-x: auto; - } -} - -/* responsive padding */ -@media (max-width: 1024px) { - NAV {margin-left: 0;} - ARTICLE {margin-right: 0; margin-left: 242px;} -} -@media (max-width: 750px) { - NAV {margin-left: 0;} - ARTICLE {margin-right: 0; margin-left: 250px;} -} - -/* responsive navbar */ -#nav-toggle {display: none;} -@media (max-width: 750px) { - TD#nav-toggle {display: table-cell; width: 40px;} - #nav-toggle A {border: 1px solid black; border-radius: 8px;} - #nav-toggle A:hover {text-decoration: none;} - - NAV>SECTION>.blockbody, - NAV>SECTION>.blockbody>.comment { - margin: 0; - } - NAV>SECTION>H3 { - margin: 0; - } - - BODY.navHidden #menuh-container {display: none;} - BODY.navHidden NAV {display: none;} - BODY.navHidden ARTICLE {margin-left: 0;} - -/* - NAV { - position: fixed; - top: 6.5em; - bottom: 0px; - overflow-y: scroll; - } - */ -} - -/* sticky header */ -@media (max-width: 750px) { - BODY.navHidden {padding-top: 5.4em} -} -@media (max-width: 750px) { - #header {position: fixed; top: 0; left: 0; z-index: 99999999999;} - .ui-autocomplete {z-index: 999999999999;} - BODY {padding-top: 7em} -} - -/* responsive header */ -#Uploadleft {display: none;} -#Uploadhead {display: block;} -#UserBlockleft {display: none;} -#UserBlockhead {display: block;} -#Loginleft {display: none;} -#Loginhead {display: block;} -.headcol {width: 250px; font-size: 0.85rem;} -.headbox {width: 80%; margin: auto;} -.headbox INPUT {width: 100%;} -#big-logo {display: table-cell;} -#mini-logo {display: none;} -@media (max-width: 1024px) { - #Uploadleft {display: block;} - #Uploadhead {display: none;} - #UserBlockleft {display: block;} - #UserBlockhead {display: none;} - #Loginleft {display: block;} - #Loginhead {display: none;} - .headcol {display: none;} - .headbox {width: 100%; margin: auto;} - #big-logo {display: none;} - #mini-logo {display: table-cell; width: 100px;} - - /* hide nav-search when header-search is sticky */ - ARTICLE {margin-top: 0;} - #Navigationleft .blockbody {font-size: 1.5rem;} - #Navigationleft .blockbody P, - #Navigationleft .blockbody FORM - {display: none;} -} - -/* responsive comments */ -.comment_list_table {width: 100%;} - -/* responsive misc */ -@media (max-width: 750px) { - #shm-main-image { max-width: 95%; } -} - -#ed91727bc9c7a73fdcec6db562e63151main { - overflow: scroll; -} - -/* front page */ -div#front-page h1 {font-size: 4rem; margin-top: 2em; margin-bottom: 0; text-align: center; border: none; background: none; box-shadow: none; -webkit-box-shadow: none; -moz-box-shadow: none;} -div#front-page {text-align:center;} -.space {margin-bottom: 1em;} -div#front-page div#links a {margin: 0 0.5em;} -div#front-page li {list-style-type: none; margin: 0;} -@media (max-width: 800px) { - div#front-page h1 {font-size: 3rem; margin-top: 0.5em; margin-bottom: 0.5em;} - #counter {display: none;} -} diff --git a/themes/rule34v2/themelet.class.php b/themes/rule34v2/themelet.class.php deleted file mode 100644 index e26ff229..00000000 --- a/themes/rule34v2/themelet.class.php +++ /dev/null @@ -1,53 +0,0 @@ -get("thumb-block:{$image->id}"); - if (!is_null($cached)) { - return rawHTML($cached); - } - - $id = $image->id; - $view_link = make_link('post/view/'.$id); - $image_link = $image->get_image_link(); - $thumb_link = $image->get_thumb_link(); - $tip = $image->get_tooltip(); - $tags = strtolower($image->get_tag_list()); - $ext = strtolower($image->get_ext()); - - // If file is flash or svg then sets thumbnail to max size. - if ($image->get_mime() === MimeType::FLASH || $image->get_mime() === MimeType::SVG) { - $tsize = get_thumbnail_size($config->get_int('thumb_width'), $config->get_int('thumb_height')); - } else { - $tsize = get_thumbnail_size($image->width, $image->height); - } - - $html = DIV( - ['class' => 'shm-thumb thumb', 'data-ext' => $ext, 'data-tags' => $tags, 'data-post-id' => $id], - A( - ['class' => 'shm-thumb-link', 'href' => $view_link], - IMG(['id' => "thumb_$id", 'title' => $tip, 'alt' => $tip, 'height' => $tsize[1], 'width' => $tsize[0], 'src' => $thumb_link, 'loading' => 'lazy']) - ), - BR(), - A(['href' => $image_link], 'File Only'), - SPAN(['class' => 'need-del'], ' - ', A(['href' => '#', 'onclick' => "image_hash_ban($id); return false;"], 'Ban')) - ); - - // cache for ages; will be cleared in ext/index:onImageInfoSet - $cache->set("thumb-block:{$image->id}", (string)$html, rand(43200, 86400)); - - return $html; - } -} diff --git a/themes/rule34v2/upload.theme.php b/themes/rule34v2/upload.theme.php deleted file mode 100644 index 20f3e05a..00000000 --- a/themes/rule34v2/upload.theme.php +++ /dev/null @@ -1,44 +0,0 @@ -add_block(new Block("Upload", $this->build_upload_block(), "head", 20)); - $page->add_block(new Block("Upload", $this->build_upload_block(), "left", 20)); - } - - // override to put the warning in the header - public function display_full(Page $page): void - { - $page->add_block(new Block("Upload", "Disk nearly full, uploads disabled", "head", 20)); - } - - // override to remove small uploader and just show a link to - // the big page - protected function build_upload_block(): HTMLElement - { - return A(["href" => make_link("upload"), "style" => 'font-size: 1.7rem; display: block;'], "Upload"); - } -} diff --git a/themes/rule34v2/user.theme.php b/themes/rule34v2/user.theme.php deleted file mode 100644 index 1c16c0b3..00000000 --- a/themes/rule34v2/user.theme.php +++ /dev/null @@ -1,59 +0,0 @@ - $parts - */ - public function display_user_block(Page $page, User $user, array $parts): void - { - $h_name = html_escape($user->name); - $lines = []; - foreach ($parts as $part) { - if ($part["name"] == "User Options") { - continue; - } - $lines[] = "{$part["name"]}"; - } - if (count($lines) < 6) { - $html = implode("\n
", $lines); - } else { - $html = implode(" | \n", $lines); - } - $page->add_block(new Block("Logged in as $h_name", $html, "head", 90, "UserBlockhead")); - $page->add_block(new Block("Logged in as $h_name", $html, "left", 15, "UserBlockleft")); - } - - // Override to display login block in the head and in the left column - // (with css media queries deciding which one is visible) - public function display_login_block(Page $page): void - { - $page->add_block(new Block("Login", $this->create_login_block(), "head", 90)); - $page->add_block(new Block("Login", $this->create_login_block(), "left", 15)); - } -} From e9c8e852a5674fe8bcb414c3a4ff54726db047b9 Mon Sep 17 00:00:00 2001 From: Shish Date: Wed, 7 Feb 2024 18:28:31 +0000 Subject: [PATCH 08/13] [core] attempt to figure out base href from SCRIPT_FILENAME + DOCUMENT_ROOT, see #1024 --- core/polyfills.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/core/polyfills.php b/core/polyfills.php index b57a2da6..00412280 100644 --- a/core/polyfills.php +++ b/core/polyfills.php @@ -314,6 +314,9 @@ function get_base_href(): string break; } } + if(empty($ok_var) && isset($_SERVER['SCRIPT_FILENAME']) && isset($_SERVER['DOCUMENT_ROOT'])) { + $ok_var = substr($_SERVER['SCRIPT_FILENAME'], strlen($_SERVER['DOCUMENT_ROOT'])); + } assert(!empty($ok_var)); $dir = dirname($ok_var); $dir = str_replace("\\", "/", $dir); From 9f9ee49e026728064f45232365cd3a66eb93f5f4 Mon Sep 17 00:00:00 2001 From: Shish Date: Wed, 7 Feb 2024 20:44:39 +0000 Subject: [PATCH 09/13] [setup] make niceurl testing more accurate, see #1024 --- ext/setup/main.php | 26 +------------------------- ext/setup/script.js | 23 +++++++++++++++++++++++ 2 files changed, 24 insertions(+), 25 deletions(-) create mode 100644 ext/setup/script.js diff --git a/ext/setup/main.php b/ext/setup/main.php index 5c3d76b7..1b185ce9 100644 --- a/ext/setup/main.php +++ b/ext/setup/main.php @@ -355,30 +355,6 @@ class Setup extends Extension $themes[$human] = $name; } - $test_url = str_replace("/index.php", "/nicetest", $_SERVER["SCRIPT_NAME"]); - - $nicescript = ""; $sb = $event->panel->create_new_block("General"); $sb->position = 0; $sb->add_text_option(SetupConfig::TITLE, "Site title: "); @@ -388,7 +364,7 @@ class Setup extends Extension $sb->add_choice_option(SetupConfig::THEME, $themes, "
Theme: "); //$sb->add_multichoice_option("testarray", array("a" => "b", "c" => "d"), "
Test Array: "); $sb->add_bool_option("nice_urls", "
Nice URLs: "); - $sb->add_label("(Javascript inactive, can't test!)$nicescript"); + $sb->add_label("(Javascript inactive, can't test!)"); $sb = $event->panel->create_new_block("Remote API Integration"); $sb->add_label("Akismet"); diff --git a/ext/setup/script.js b/ext/setup/script.js new file mode 100644 index 00000000..2e113b8b --- /dev/null +++ b/ext/setup/script.js @@ -0,0 +1,23 @@ +document.addEventListener('DOMContentLoaded', () => { + const checkbox = document.getElementById('nice_urls'); + const out_span = document.getElementById('nicetest'); + + if(checkbox !== null && out_span !== null) { + checkbox.disabled = true; + out_span.innerHTML = '(testing...)'; + + fetch(document.body.getAttribute('data-base-href') + "/nicetest").then(response => { + if(response.ok) { + checkbox.disabled = false; + out_span.innerHTML = '(test passed)'; + } + else { + checkbox.disabled = true; + out_span.innerHTML = '(test failed)'; + } + }).catch(() => { + checkbox.disabled = true; + out_span.innerHTML = '(request failed)'; + }); + } +}); From c6e65a21f9d0713f5c04582afdbacbe700e020ee Mon Sep 17 00:00:00 2001 From: Shish Date: Wed, 7 Feb 2024 22:27:47 +0000 Subject: [PATCH 10/13] [setup] more specific niceurl test --- ext/setup/script.js | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/ext/setup/script.js b/ext/setup/script.js index 2e113b8b..ee6d067e 100644 --- a/ext/setup/script.js +++ b/ext/setup/script.js @@ -7,13 +7,19 @@ document.addEventListener('DOMContentLoaded', () => { out_span.innerHTML = '(testing...)'; fetch(document.body.getAttribute('data-base-href') + "/nicetest").then(response => { - if(response.ok) { - checkbox.disabled = false; - out_span.innerHTML = '(test passed)'; - } - else { + if(!response.ok) { checkbox.disabled = true; - out_span.innerHTML = '(test failed)'; + out_span.innerHTML = '(http error)'; + } else { + response.text().then(text => { + if(text === 'ok') { + checkbox.disabled = false; + out_span.innerHTML = '(test passed)'; + } else { + checkbox.disabled = true; + out_span.innerHTML = '(test failed)'; + } + }); } }).catch(() => { checkbox.disabled = true; From 7adb7348d788c56f3eac99ce7addda75df44bfe9 Mon Sep 17 00:00:00 2001 From: Shish Date: Wed, 7 Feb 2024 22:47:12 +0000 Subject: [PATCH 11/13] [core] fixes and tests for get_base_href + get_query, see #1024 --- core/polyfills.php | 25 ++++++++++++------------ core/tests/PolyfillsTest.php | 38 ++++++++++++++++++++++++++++++++++++ core/tests/UtilTest.php | 19 ++++++++++++++++++ core/util.php | 30 ++++++++++++++++++++-------- tests/bootstrap.php | 3 +++ tests/defines.php | 1 - 6 files changed, 95 insertions(+), 21 deletions(-) diff --git a/core/polyfills.php b/core/polyfills.php index 00412280..02735446 100644 --- a/core/polyfills.php +++ b/core/polyfills.php @@ -306,21 +306,22 @@ function get_base_href(): string if (defined("BASE_HREF") && !empty(BASE_HREF)) { return BASE_HREF; } - $possible_vars = ['SCRIPT_NAME', 'PHP_SELF', 'PATH_INFO', 'ORIG_PATH_INFO']; - $ok_var = null; - foreach ($possible_vars as $var) { - if (isset($_SERVER[$var]) && substr($_SERVER[$var], -4) === '.php') { - $ok_var = $_SERVER[$var]; - break; - } + if(str_ends_with($_SERVER['PHP_SELF'], 'index.php')) { + $self = $_SERVER['PHP_SELF']; } - if(empty($ok_var) && isset($_SERVER['SCRIPT_FILENAME']) && isset($_SERVER['DOCUMENT_ROOT'])) { - $ok_var = substr($_SERVER['SCRIPT_FILENAME'], strlen($_SERVER['DOCUMENT_ROOT'])); + elseif(isset($_SERVER['SCRIPT_FILENAME']) && isset($_SERVER['DOCUMENT_ROOT'])) { + $self = substr($_SERVER['SCRIPT_FILENAME'], strlen(rtrim($_SERVER['DOCUMENT_ROOT'], "/"))); } - assert(!empty($ok_var)); - $dir = dirname($ok_var); + /* + die(var_export([ + $_SERVER['PHP_SELF'], + $_SERVER['SCRIPT_FILENAME'], + $_SERVER['DOCUMENT_ROOT'], + $self + ], true)); + */ + $dir = dirname($self); $dir = str_replace("\\", "/", $dir); - $dir = str_replace("//", "/", $dir); $dir = rtrim($dir, "/"); return $dir; } diff --git a/core/tests/PolyfillsTest.php b/core/tests/PolyfillsTest.php index 2ca5328f..aa43c4da 100644 --- a/core/tests/PolyfillsTest.php +++ b/core/tests/PolyfillsTest.php @@ -254,4 +254,42 @@ class PolyfillsTest extends TestCase deltree($dir); $this->assertFalse(file_exists($dir)); } + + private function _tbh(array $vars, string $result): void + { + // update $_SERVER with $vars, call get_base_href() and check result, then reset $_SERVER to original value + $old_server = $_SERVER; + $_SERVER = array_merge($_SERVER, $vars); + $this->assertEquals($result, get_base_href()); + $_SERVER = $old_server; + } + + public function test_get_base_href(): void + { + // PHP_SELF should point to "the currently executing script + // relative to the document root" + $this->_tbh(["PHP_SELF" => "/index.php"], ""); + $this->_tbh(["PHP_SELF" => "/mydir/index.php"], "/mydir"); + + + // SCRIPT_FILENAME should point to "the absolute pathname of + // the currently executing script" and DOCUMENT_ROOT should + // point to "the document root directory under which the + // current script is executing" + $this->_tbh([ + "PHP_SELF" => "", + "SCRIPT_FILENAME" => "/var/www/html/mydir/index.php", + "DOCUMENT_ROOT" => "/var/www/html", + ], "/mydir"); + $this->_tbh([ + "PHP_SELF" => "", + "SCRIPT_FILENAME" => "/var/www/html/mydir/index.php", + "DOCUMENT_ROOT" => "/var/www/html/", + ], "/mydir"); + $this->_tbh([ + "PHP_SELF" => "", + "SCRIPT_FILENAME" => "/var/www/html/index.php", + "DOCUMENT_ROOT" => "/var/www/html", + ], ""); + } } diff --git a/core/tests/UtilTest.php b/core/tests/UtilTest.php index d622cc2d..bca8c98f 100644 --- a/core/tests/UtilTest.php +++ b/core/tests/UtilTest.php @@ -162,4 +162,23 @@ class UtilTest extends TestCase path_to_tags("/category:/tag/baz.jpg") ); } + + public function test_get_query(): void + { + // no query string + $_SERVER["REQUEST_URI"] = "/tasty/cake"; + $this->assertEquals("/tasty/cake", _get_query()); + + // query string + $_SERVER["REQUEST_URI"] = "index.php?q=/tasty/cake"; + $this->assertEquals("/tasty/cake", _get_query()); + + // leave url encoding alone + $_SERVER["REQUEST_URI"] = "index.php?q=/tasty/cake%20pie"; + $this->assertEquals("/tasty/cake%20pie", _get_query()); + + // if just viewing index.php + $_SERVER["REQUEST_URI"] = "index.php"; + $this->assertEquals("/", _get_query()); + } } diff --git a/core/util.php b/core/util.php index 18ae26e3..2868b587 100644 --- a/core/util.php +++ b/core/util.php @@ -715,19 +715,33 @@ function _get_user(): User function _get_query(): string { - // if query is explicitly set, use it - $q = @$_POST["q"] ?: @$_GET["q"]; - if(!empty($q)) { - return $q; + // if q is set in POST, use that + if(isset($_POST["q"])) { + return $_POST["q"]; } + + // if q is set in GET, use that + // (we need to manually parse the query string because PHP's $_GET + // does an extra round of URL decoding, which we don't want) + $parts = parse_url($_SERVER['REQUEST_URI']); + $qs = []; + foreach(explode('&', $parts['query'] ?? "") as $z) { + $qps = explode('=', $z, 2); + if(count($qps) == 2) { + $qs[$qps[0]] = $qps[1]; + } + } + if(isset($qs["q"])) { + return $qs["q"]; + } + // if we're just looking at index.php, use the default query - elseif (str_contains($_SERVER['REQUEST_URI'], "index.php")) { + if(str_ends_with($parts["path"], "index.php")) { return "/"; } + // otherwise, use the request URI - else { - return explode("?", $_SERVER['REQUEST_URI'])[0]; - } + return $parts["path"]; } diff --git a/tests/bootstrap.php b/tests/bootstrap.php index 32fc0ea1..ec8f9b74 100644 --- a/tests/bootstrap.php +++ b/tests/bootstrap.php @@ -19,7 +19,10 @@ require_once "core/sys_config.php"; require_once "core/polyfills.php"; require_once "core/util.php"; +$_SERVER['SCRIPT_FILENAME'] = '/var/www/html/test/index.php'; +$_SERVER['DOCUMENT_ROOT'] = '/var/www/html'; $_SERVER['QUERY_STRING'] = '/'; + if (file_exists("data/test-trace.json")) { unlink("data/test-trace.json"); } diff --git a/tests/defines.php b/tests/defines.php index 9a820285..3d5a9a4c 100644 --- a/tests/defines.php +++ b/tests/defines.php @@ -20,7 +20,6 @@ define("VERSION", 'unit-tests'); define("TRACE_FILE", null); define("TRACE_THRESHOLD", 0.0); define("TIMEZONE", 'UTC'); -define("BASE_HREF", "/test"); define("CLI_LOG_LEVEL", 50); define("STATSD_HOST", null); define("TRUSTED_PROXIES", []); From e0d9a20f4ce82996b44ee21598331ed2c1f5d590 Mon Sep 17 00:00:00 2001 From: Shish Date: Wed, 7 Feb 2024 23:01:45 +0000 Subject: [PATCH 12/13] cleanup --- core/polyfills.php | 8 -------- 1 file changed, 8 deletions(-) diff --git a/core/polyfills.php b/core/polyfills.php index 02735446..08e7a01c 100644 --- a/core/polyfills.php +++ b/core/polyfills.php @@ -312,14 +312,6 @@ function get_base_href(): string elseif(isset($_SERVER['SCRIPT_FILENAME']) && isset($_SERVER['DOCUMENT_ROOT'])) { $self = substr($_SERVER['SCRIPT_FILENAME'], strlen(rtrim($_SERVER['DOCUMENT_ROOT'], "/"))); } - /* - die(var_export([ - $_SERVER['PHP_SELF'], - $_SERVER['SCRIPT_FILENAME'], - $_SERVER['DOCUMENT_ROOT'], - $self - ], true)); - */ $dir = dirname($self); $dir = str_replace("\\", "/", $dir); $dir = rtrim($dir, "/"); From 1edb7b6126b3f4afa5947c647e9099e24a985442 Mon Sep 17 00:00:00 2001 From: Shish Date: Wed, 7 Feb 2024 23:22:24 +0000 Subject: [PATCH 13/13] more tests --- core/tests/UtilTest.php | 16 ++++++++++------ core/util.php | 4 ++-- 2 files changed, 12 insertions(+), 8 deletions(-) diff --git a/core/tests/UtilTest.php b/core/tests/UtilTest.php index bca8c98f..7fa13806 100644 --- a/core/tests/UtilTest.php +++ b/core/tests/UtilTest.php @@ -165,20 +165,24 @@ class UtilTest extends TestCase public function test_get_query(): void { - // no query string - $_SERVER["REQUEST_URI"] = "/tasty/cake"; + // niceurls + $_SERVER["REQUEST_URI"] = "/test/tasty/cake"; $this->assertEquals("/tasty/cake", _get_query()); - // query string - $_SERVER["REQUEST_URI"] = "index.php?q=/tasty/cake"; + // no niceurls + $_SERVER["REQUEST_URI"] = "/test/index.php?q=/tasty/cake"; $this->assertEquals("/tasty/cake", _get_query()); // leave url encoding alone - $_SERVER["REQUEST_URI"] = "index.php?q=/tasty/cake%20pie"; + $_SERVER["REQUEST_URI"] = "/test/index.php?q=/tasty/cake%20pie"; $this->assertEquals("/tasty/cake%20pie", _get_query()); // if just viewing index.php - $_SERVER["REQUEST_URI"] = "index.php"; + $_SERVER["REQUEST_URI"] = "/test/index.php"; + $this->assertEquals("/", _get_query()); + + // niceurl root + $_SERVER["REQUEST_URI"] = "/test/"; $this->assertEquals("/", _get_query()); } } diff --git a/core/util.php b/core/util.php index 2868b587..cbdaead7 100644 --- a/core/util.php +++ b/core/util.php @@ -740,8 +740,8 @@ function _get_query(): string return "/"; } - // otherwise, use the request URI - return $parts["path"]; + // otherwise, use the request URI minus the base path + return substr($parts["path"], strlen(get_base_href())); }