Commit graph

267 commits

Author SHA1 Message Date
Shish
f91daba264 count less 2023-01-11 11:41:13 +00:00
Shish
5a64e8729b nits 2023-01-11 11:15:26 +00:00
Shish
bce2d55744 Namespaces are one honking great idea—let's do more of those! 2023-01-10 22:44:09 +00:00
Shish
a04bc2e7e4 php8.1 gogogo 2022-10-28 01:45:35 +01:00
Shish
caa3c80de4 Use Y-m-d H:i:s for default 'posted' date 2022-10-27 17:09:39 +01:00
Shish
a828c3e0e5 more thorough testing for path_to_tags, and handle more edge cases 2022-10-27 17:09:39 +01:00
Shish
22ec34ea52 format 2022-09-27 17:38:15 +01:00
myname
10e63a0666 Fixing bulk add bug, tag is set to "\" if no other tags are present 2022-09-27 02:12:24 -05:00
Shish
b859e1fc60
Merge pull request #869 from thoughever/reverse_proxy
X-Real-IP support and Varnish PURGE config options
2022-05-01 10:42:54 +01:00
Jessica Stokes
6bc1ec4f81 Allow setting $image->posted values 2022-04-29 11:21:57 -07:00
thoughever
f15407bc75 X-Real-IP support and Varnish PURGE config options
X-Real-IP for core functionality

Global config define REVERSE_PROXY_X_HEADERS

Config host and port for varnish PURGE

config option to specify PURGE protocol

exception in curl purge now shows error code

ipv6 x-real-ip addresses are now validated properly

X-Forwarded-Proto enabled by define
2022-01-20 22:25:22 +00:00
Shish
3d9e32e919 new php-cs-fixer 2021-12-14 18:32:47 +00:00
Shish
58db685b29 more error handling 2021-11-10 19:33:51 +00:00
Shish
d932178670 don't crash when the user searches with no positive tags and multiple non-existent negative tags 2021-10-06 17:02:29 +00:00
Shish
3f0a8399d1 clarify some nullables 2021-09-25 13:40:41 +01:00
Shish
faf35cc884 video references image width / height 2021-03-16 01:49:48 +00:00
Shish
77f7121e26 drop php7.3 support, make use of 7.4 features 2021-03-14 23:43:50 +00:00
Matthew Barbour
4f82dce662 Changed image->get_tag_array to sort the array before returning 2021-01-16 14:26:18 -06:00
Shish
ecafd4e131 Merge branch 'image2post' 2020-10-27 22:42:47 +00:00
Shish
338bbcdbcb more test passing 2020-10-27 22:19:26 +00:00
Shish
10f563ee37 boolinate locked 2020-10-27 01:05:12 +00:00
Shish
ee7a4f178c boolinate video/audio 2020-10-27 00:58:18 +00:00
Shish
ed735e17be boolinate image 2020-10-27 00:58:18 +00:00
Shish
aceb3e23f3 remove redundant casts 2020-10-26 23:18:14 +00:00
Shish
cc06df171a Argh, that doesn't work for OTHER versions of sqlite...
This reverts commit 55e3cb5d63.
2020-10-26 22:37:25 +00:00
Shish
55e3cb5d63 compatibility with out-of-date sqlite: use '(1=0)' instead of 'false' 2020-10-26 22:33:11 +00:00
Matthew Barbour
e7b109a7f2 Image to Post - Some core files 2020-10-26 10:53:02 -05:00
Shish
19a6b39c70 make use of str_starts_with / str_ends_with / str_contains 2020-10-25 19:31:58 +00:00
Shish
c783ff0e8d polyfills for php8's str_starts_with and str_ends_with 2020-10-25 19:15:13 +00:00
Shish
c8bd5e8d49 clarity for not-emptiness 2020-10-25 13:09:51 +00:00
Shish
0dca09c230 make order querylets a first class citizen instead of a hack 2020-10-25 12:55:36 +00:00
Shish
19d5cfe8b9 make search term parse ID a standard thing 2020-10-25 12:55:36 +00:00
Shish
c11f0dafd0 format 2020-10-24 22:16:18 +01:00
Shish
58a0f060ce avoid numeric columns 2020-10-24 19:18:40 +01:00
Shish
8ff70134ae nits 2020-10-24 13:46:57 +01:00
Matthew Barbour
bf2a34c106 Adjusted mime type update statement to include NULLs. Changed get_mime() so that it can return a null in the event of the mime type not being properly set. 2020-10-08 17:41:24 -05:00
Matthew Barbour
6bc8b791d2 Added option to go to next image when an image is deleted 2020-10-08 17:24:21 -05:00
Shish
a93c66515b
Merge pull request #749 from sanmadjack/video_transcode
Video transcoding
2020-09-16 13:46:18 +01:00
Shish
4131bcbd64
Merge pull request #748 from sanmadjack/image_info
Added image info option to admin, changed the info template parser to…
2020-09-16 11:21:31 +01:00
Shish
5d86314fc2
Merge pull request #746 from sanmadjack/resize_types
Added "Fit Blur Tall, Fill Wide" resize type
2020-09-16 11:20:28 +01:00
Matthew Barbour
ecd860ec6d Video transcoding extension, currently just supports changing the video container 2020-08-28 09:52:01 -05:00
Matthew Barbour
65aca09203 Added understanding of video codecs, primarily to allow us to determine whether a file is a webm or not, but also to support my forthcoming video transcoding extension 2020-08-28 09:51:55 -05:00
Matthew Barbour
4c5ef85906 Added image info option to admin, changed the info template parser to not use the url-escaped option 2020-08-28 09:50:36 -05:00
Matthew Barbour
2dedeb06e0 Added "Fit Blur Tall, Fill Wide" resize type 2020-08-28 09:49:24 -05:00
Matthew Barbour
ab008e351d Added SPEED_HAX criteria to image count shortcuts. 2020-08-28 09:48:10 -05:00
Shish
de26b7f373 don't die if database is missing a MIME type 2020-07-07 16:07:19 +00:00
Matthew Barbour
7f68ef1cfd Added option to transcode extension and thumbnailing to choose the color to use to fill in the background when converting an image with an alpha channel to a format without 2020-06-25 00:42:43 +01:00
Matthew Barbour
984c9702ec The great MIMEing 2020-06-25 00:42:34 +01:00
Matthew Barbour
b937ad6255 Added thumbnail scaling options
Changed ffmpeg thumbnailer to instead output a full-size png which is forwarded to the image thumbnailer, to allow it to take advantage of all available scaling options
2020-06-23 15:05:55 +01:00
Matthew Barbour
6d16c52367 New bulk import/export extension 2020-06-23 15:01:22 +01:00
Matthew Barbour
63b2601e67 Mime type handling overhaul
Changed mime type map to deal with the reality that certain file types have multiple extensions and/or multiple mime types, as well as constants supporting all of the data. Created new functions using the updated mime type map to resolve mime types and extensions. Updated various items around the project that determine mime/extension to take advantage of the new functions.
2020-06-03 19:47:40 +01:00
Shish
1fc75c0b18 Whenever we display an image for any reason, show the admin block, fixes #621 2020-03-23 00:06:43 +00:00
Shish
7fa9d11512 hard-code one bad case 2020-03-13 10:04:12 +00:00
Shish
8f3002f2d8 dot in special chars list 2020-03-13 09:47:43 +00:00
Shish
33731e8cb0 separate link formatting for URLs and for plain text 2020-02-25 12:26:56 +00:00
Shish
b44a4de42c one return 2020-02-25 12:18:18 +00:00
Shish
89dd1a7658 create_scaled_image, for other uses 2020-02-25 12:04:37 +00:00
Matthew Barbour
152e55b5db Changed Image::by_hash so that it isn't case-sensitive 2020-02-23 23:07:02 -06:00
Shish
674d3fc6fa dedupe create_image_from_data 2020-02-23 18:19:27 +00:00
Shish
c5d8585824 info command 2020-02-23 18:14:35 +00:00
Shish
43ab3088cf cache key 2020-02-13 20:54:59 +00:00
Shish
3a57817fc2 Spread ParseLinkTemplate work across relevant extensions 2020-02-09 19:22:25 +00:00
Shish
d749784e95 remove redundant escaping and split load_balance_url into a separate function with testing 2020-02-09 16:02:37 +00:00
Shish
cc7a33b31f show lengths to 1/10th second 2020-02-09 00:32:20 +00:00
Shish
4b5becfb7f video length in thumb 2020-02-08 20:44:23 +00:00
Shish
fd7c774f5b handle_svg doesn't need to override ALL of onDataUpload 2020-02-08 20:44:23 +00:00
Shish
03af4dd92f ??? 2020-02-05 09:01:22 +00:00
Shish
23943692ce formatting 2020-02-05 01:38:32 +00:00
Shish
ef82d5f1a1 account for missing tags 2020-02-05 01:26:18 +00:00
Shish
f7feb4075a order, order 2020-02-05 00:27:37 +00:00
Shish
1a07f84622 inline build_accurate_search_querylet 2020-02-05 00:16:47 +00:00
Shish
e971d10d41 we can also optimise one negative tag in the same way 2020-02-04 23:49:54 +00:00
Shish
b81a95129c faster search for getting deep into individual tag archives 2020-02-04 23:43:24 +00:00
Shish
c0bdb6b7f8 merge common stuff into build_search_querylet 2020-02-04 23:27:01 +00:00
Shish
aa5cf0e81b optimise counting number of results for one negative tag 2020-02-04 23:05:07 +00:00
Shish
9216be3c96 if we're past the searchable number of pages, don't bother counting the number of pages, just 404 2020-02-04 22:44:27 +00:00
Shish
f5c402ad85 inline a one-use function 2020-02-01 23:37:20 +00:00
Shish
6d2c92575d tests for format_milliseconds 2020-02-01 23:03:23 +00:00
Shish
40ab91f8ea remove redundant scoreql_to_sql 2020-02-01 22:44:50 +00:00
Shish
6f7e0e5b12 drop logging args that didn't get used in practice 2020-02-01 21:37:07 +00:00
Shish
de0a7138d2 formatting 2020-02-01 11:59:39 +00:00
Shish
da42b19d6b make it more explicit that caret/decaret are for encoding tags into URL paths 2020-01-30 21:50:30 +00:00
Shish
0ec305a886 stop using ? as a wildcard 2020-01-30 10:55:35 +00:00
Shish
fb5bce69f8 SQL T_T 2020-01-29 20:34:02 +00:00
Shish
4e57e04ddf fix a lot of tests 2020-01-29 20:22:50 +00:00
Shish
615da9e9d2 fix all the tests (for sqlite, php7.4, osx, at least) 2020-01-28 21:19:59 +00:00
Shish
3c5e6f0746 delete search-accel stuff - built-in queries are faster now 2020-01-27 19:49:50 +00:00
Shish
235b976dbc databases... 2020-01-26 18:10:58 +00:00
Shish
3631084afd format 2020-01-26 16:38:26 +00:00
Shish
9eb5acf2dc use strict types 2020-01-26 16:27:56 +00:00
Shish
70db0ce5bd flash_message -> page->flash, with no cookies 2019-12-15 19:47:18 +00:00
Shish
d7a2ca9ddc remove SCORE_STRNORM - everyone supports LOWER now 2019-12-15 16:07:46 +00:00
Shish
6486bb95da name_to_id 2019-11-11 16:43:42 +00:00
Shish
bde49c4f5e paged ip bans 2019-11-11 12:52:11 +00:00
Shish
55c6854003 formatting 2019-11-02 19:57:34 +00:00
Matthew Barbour
ed8caa86bf Fix for random issue 2019-10-18 16:35:44 +01:00
Matthew Barbour
9139bbfd01 Added another lower() to a tag lookup 2019-10-18 16:31:38 +01:00
Matthew Barbour
3a14857b40 Consolidated tag sanitization functions
Added more tag convenience functions
2019-10-18 16:29:04 +01:00
Matthew Barbour
6b030c00eb Constants for index config 2019-10-18 16:26:11 +01:00
Shish
4564fd4092 by_id_or_hash for more elegant CLI use 2019-10-04 20:48:21 +01:00
Shish
71c74e034b allow find_images without limit 2019-10-04 20:47:48 +01:00
Shish
30698fefdc remove a bunch of dead variables and things 2019-10-02 11:23:57 +01:00
Shish
e08cdb1638 make Cache its own thing, separate from Database 2019-10-02 10:49:32 +01:00
Shish
19c4fcaf34 even with EMULATE_PREPARES=false, sqlite still returns strings for int columns... 2019-09-30 10:40:15 +01:00
Shish
0f4a0275b5 use is_int instead of is_numeric if we want to reject numeric strings, should fix #681 2019-09-29 17:58:56 +01:00
Shish
54067f02a4 fix merge 2019-09-29 15:44:59 +01:00
Shish
e6a402cd4e Merge branch 'custom_ratings' into develop 2019-09-29 14:41:14 +01:00
Shish
f5119b20a3 formatting 2019-09-29 14:32:51 +01:00
Shish
a6bb15d859 formatting 2019-09-29 14:30:55 +01:00
Matthew Barbour
88e6e68d79 Changed omitted related tags (like tagme) to be powered by a setting, allowing any performance-impacting (or just not useful in this context) tags to be omitted
Further tag list performance improvements
TagListConfig constants
2019-09-26 15:46:28 +01:00
Daniel Oaks
a1c276c840 Fix SQLite underscore searching (#619) 2019-09-14 13:46:39 +10:00
Shish
9341c408b9 allow randomness to be limited, because sql's OFFSET N is O(n) 2019-09-08 17:13:20 +01:00
Matthew Barbour
68ee4d0e77 Custom rating support, user rating filter settings 2019-08-07 15:49:26 -05:00
Matthew Barbour
972b68bdd3 Setup constants 2019-08-05 09:00:23 -05:00
Matthew Barbour
cb1e9c0075 Permissions to constants 2019-08-01 08:07:05 -05:00
Matthew Barbour
a0c0b6e3d1 Various fixes 2019-07-08 08:07:11 -05:00
Matthew Barbour
b1db833d51 Added additional media properties to the images table, video, audio, length, and lossless.
Added new event to handle fetching media properties like height, width, and the newly added fields, and admin controls to manually scan files for their properties.
Added a search terms content:video and content:audio to search for images that do (or do not) have those flags.
2019-07-08 08:07:09 -05:00
Matthew Barbour
a41e99d1af Renamed graphics extension to media extension 2019-07-08 08:07:08 -05:00
Matthew Barbour
3859e27839 New Graphics extension
Added constants to several extensions
2019-07-08 08:07:02 -05:00
Shish
1bd7e1a547 better DISABLE_ACCEL 2019-07-07 17:40:24 +01:00
Shish
cf98e4bf43 remove one-positive-tag special case which is slower than the generic build_accurate_search_querylet 2019-07-07 17:13:56 +01:00
Shish
ea802f4a24 Remove build_ugly_search_querylet
now that the accurate search doesn't use subqueries, perhaps mysql can
accept it
2019-07-07 16:50:55 +01:00
Shish
bd5ccd2800 remove ancient misleading description of the search code 2019-07-07 16:46:56 +01:00
Shish
3c6b09110a Cache multiple flexihashes
otherwise get_thumb / get_image / get_thumb / get_image / ... will
have 100% cache miss rate
2019-07-07 14:26:45 +01:00
Shish
99646a4b00 bump tracer api 2019-07-07 13:30:50 +01:00
Matthew Barbour
f5a5352511 Correction to negative tag code 2019-07-07 11:17:21 +01:00
matthew
d64603674e Added ability to use generators with database queries.
Adapted bulk actions to use generators.
2019-07-07 11:10:40 +01:00
Matthew Barbour
183f9bb897 Changed the image tag search query to run more efficiently on pgsql 2019-07-07 11:06:45 +01:00
Shish
f4a98e7a9b GET flag to skip accelerator 2019-07-07 10:29:00 +01:00
Shish
68f3ebb2c6 Consistently say '<Type> Query' 2019-07-07 00:17:39 +01:00
Shish
c682670f64 derp 2019-07-06 10:38:18 +01:00
Shish
ccb9c493d5 s/Context/EventTracer/g 2019-07-05 20:49:47 +01:00
Matthew Barbour
a82fb56063 Added force flag to image deletion event to override trash extension 2019-07-05 18:31:31 +01:00
Shish
c24a6e9b97 formatting pass 2019-06-21 09:12:44 +01:00
Matthew Barbour
1370afec72 Moved database driver constants to DatabaseDriver 2019-06-20 10:47:15 -05:00
Matthew Barbour
5eb4a66ab7 Added merged indicator to DataUploadEvent and ImageAddEvent
Changed merge process so that the ID of the merged image can make it back through the event chanin
2019-06-19 20:19:38 -05:00
matthew
123089bfbf Merge remote-tracking branch 'upstream/develop' into bugfixes
# Conflicts:
#	core/imageboard/image.php
2019-06-18 13:31:04 -05:00
Shish
1d10baa719 only sql-escape if we're going to the database, not the accelerator 2019-06-16 19:25:40 +01:00
Shish
6df1190501 Rename Tag/ImgQuerylet to Tag/ImgCondition
It was confusing because Tag/ImgQuerylet (an abstract condition to use
as part of image search filtering) were unrelated to Querylet (a
fragment of SQL)
2019-06-16 19:11:16 +01:00
Shish
6b9d18b52e Parse tags first, then check accelerator, then check database
Better than half-assed tag parsing in the accelerator then full parsing
in the database
2019-06-16 19:07:55 +01:00
Matthew Barbour
37fe743f65 Changed "images" and "thumbs" usages to constants 2019-06-15 11:20:11 -05:00
Matthew Barbour
6f501a6e74 Database driver constants 2019-06-14 13:38:47 -05:00
Matthew Barbour
58acb71282 Change imagemagick commands to return the error output
Added ico to transcode extension
2019-06-14 13:01:24 -05:00
Matthew Barbour
ed4b6bc4a0 Updated handle_ico to use new common image thumbnailing and to inherit DataHandlerExtension 2019-06-14 13:00:59 -05:00
Matthew Barbour
1b76366dd9 Cleaned up some of the new image processing code, added documentation 2019-06-14 09:41:55 -05:00
Shish
064b24ffc1 formatting pass 2019-06-14 13:47:50 +01:00
Shish
d1102cd635 Merge from sanmadjack:develop 2019-06-14 13:46:55 +01:00
Shish
f078b283bd pull a bunch of small fixes from #659 2019-06-14 13:16:58 +01:00
Matthew Barbour
5765978afd Changed to prevent writing duplicate image tag IDs 2019-06-14 12:52:58 +01:00
Matthew Barbour
1aa0225652 Adjustments to transcoding to allow psd transcoding to actually work
Changed resize extension to run later in the extension stack
Little fixes
2019-06-13 11:45:34 -05:00