This website requires JavaScript.
be437fcf5f
Add function to get next strpos of any of a specified set of needles
master
Joshua Ramon Enslin
2024-12-25 18:41:28 +0100
fa2985463f
Use more explicit type hints for improved static code analysis
Joshua Ramon Enslin
2024-09-22 16:51:54 +0200
bce4268a70
Merge branch 'master' of gitea:museum-digital/MD_STD
Joshua Ramon Enslin
2024-09-05 14:25:14 +0200
92c942aab3
Remove whitespaces in isbns before validating
Joshua Ramon Enslin
2024-09-05 14:24:18 +0200
6174c5454e
Clean em dashes from ISBNs during sanitization
Joshua Ramon Enslin
2024-08-14 16:41:55 +0200
a57036789e
Fix implicit array creation
Joshua Ramon Enslin
2024-07-12 02:56:27 +0200
fc727932ca
Make function in MD_STD_HTML_TEST final
Joshua Ramon Enslin
2024-07-12 02:54:26 +0200
40d83ce5b0
Add class MD_STD_HTML_TEST for validating HTML outputs
Joshua Ramon Enslin
2024-07-12 02:31:32 +0200
cbc66c4140
Improve test coverage for MD_STD_SEC
Joshua Ramon Enslin
2024-07-11 15:32:50 +0200
11faeaa7e7
Improve test coverage
Joshua Ramon Enslin
2024-07-11 14:53:05 +0200
fb008e1b59
Add function for ensuring all input in an array is strings
Joshua Ramon Enslin
2024-07-09 16:43:21 +0200
cd46a3ec73
Add wrapper around file_put_contents
Joshua Ramon Enslin
2024-06-24 16:53:01 +0200
94dfa17290
Fix code smells
Joshua Ramon Enslin
2024-06-11 21:57:56 +0200
d4918dd893
Handle dates outside of strtotime()'s range in date_to_int, int_to_date
Joshua Ramon Enslin
2024-05-05 00:48:04 +0200
fb1372d193
Use MD_STD::strtotime() over strtotime()
Joshua Ramon Enslin
2024-05-04 01:19:52 +0200
63ac1b296e
Add functions for transferring dates to ints and vice versa
Joshua Ramon Enslin
2024-05-03 17:42:32 +0200
8c1050f40a
Add wrapper around MD_STD::strtotime() that will throw an expected exception
Joshua Ramon Enslin
2024-01-30 01:21:51 +0100
2bea372973
Use phpstan-specific comments for main sanitization + validation functions
Joshua Ramon Enslin
2024-01-14 22:18:48 +0100
69e6850c16
Write prettier error message in MDFailedToCreateDirectory
Joshua Ramon Enslin
2023-11-27 01:31:16 +0100
8006695093
Throw a specific exception if MD_STD::mkdir fails
Joshua Ramon Enslin
2023-11-27 01:30:43 +0100
db31822a3f
Use empty() over === false to also return error in case of empty strings
Joshua Ramon Enslin
2023-11-10 16:17:20 +0100
0fb368b96d
Extend MD_STD_IN::sanitize_url to automatically set protocol / scheme names in lowercase
Joshua Ramon Enslin
2023-11-09 16:40:28 +0100
66e704de47
Extend tests for MD_STD_IN considerably, fix some edge cases
Joshua Ramon Enslin
2023-11-08 21:24:23 +0100
a03f072a69
Add function for validating ZIP codes (somewhat)
Joshua Ramon Enslin
2023-11-08 02:18:34 +0100
d83ed2d0eb
Improve indentation in phpunit
Joshua Ramon Enslin
2023-11-07 22:52:23 +0100
2c58e0554b
Improve coverage of MD_STD_IN
Joshua Ramon Enslin
2023-11-07 22:50:18 +0100
1f2f63c9af
Set beStrictAboutOutputDuringTests=true in phpunit.xml
Joshua Ramon Enslin
2023-11-06 23:49:27 +0100
c9dce8f782
Annotate the available tests as @small
Joshua Ramon Enslin
2023-11-06 23:26:21 +0100
0c0d059dd3
Add testsuite for /tests directory in phpunit.xml
Joshua Ramon Enslin
2023-11-06 23:03:35 +0100
5d80f82040
Remove printer class / use testdox by default in phpunit setup
Joshua Ramon Enslin
2023-11-06 23:02:44 +0100
5c2c1a47cc
Fully ensure all URL components are present for rewriting
Joshua Ramon Enslin
2023-11-05 23:37:28 +0100
ae12cfdf0f
Add tests for MD_STD_IN::sanitize_url() and ensure it supports rewriting unencoded cyrillic inputs
Joshua Ramon Enslin
2023-11-05 23:29:14 +0100
2176e7312b
Remove MD_STD_CACHE open_redis_default()
Joshua Ramon Enslin
2023-10-05 16:58:48 +0200
3ece870f0c
Require externally set up redis connection for caching + serving full pages via redis
Joshua Ramon Enslin
2023-10-05 16:45:35 +0200
b143845aea
Fix type-safety issues around curl in new checking HTTP status function
Joshua Ramon Enslin
2023-08-18 15:12:45 +0200
88458df949
Add general abstract classes for tests, starting with test classes for RSS feeds
Joshua Ramon Enslin
2023-08-18 15:09:58 +0200
9c49afe416
Improve comment on return parameter
Joshua Ramon Enslin
2023-08-16 20:09:22 +0200
6426947e60
Add function for getting user language without using cookies
Joshua Ramon Enslin
2023-08-14 15:15:41 +0200
a8599667c9
Use is_file() over file_exists() in MD_STD::ensure_file()
Joshua Ramon Enslin
2023-07-21 16:09:43 +0200
bb36388e7e
Add README
Joshua Ramon Enslin
2023-06-24 02:04:03 +0200
66a5b77b51
Add function unlink_if_exists
Joshua Ramon Enslin
2023-04-14 14:13:09 +0200
23232f4e6a
Remove superfluous variable assignments
Joshua Ramon Enslin
2022-09-15 21:38:41 +0200
c38f0146dc
Allow passing existing redis connections to MD_STD_CACHE
Joshua Ramon Enslin
2022-09-04 23:27:04 +0200
bbac217aa0
Reduce factors for setting anti-brute force delays
Joshua Ramon Enslin
2022-08-14 18:12:33 +0200
ced5a65122
Fix variable misnomers in MD_STD_SEC
Joshua Ramon Enslin
2022-08-14 16:17:03 +0200
52aeedd31e
Set a cap to maximum delay in preventing brute force attacks
Joshua Ramon Enslin
2022-08-14 13:08:40 +0200
f477401114
Add functions for validating longitudes and latitutdes
Joshua Ramon Enslin
2022-07-28 11:01:30 +0200
c362aa1283
Remove superfluous checks for empty realnames
Joshua Ramon Enslin
2022-03-31 14:38:02 +0200
65aaea4097
Check links for using an accepted scheme during validation (http, https, ftp)
Joshua Ramon Enslin
2022-03-30 13:03:04 +0200
7c02bbb8ad
Fix function comment for setting content-security-policies
Joshua Ramon Enslin
2022-03-29 17:51:21 +0200
6a7b8bd8fd
Disable setting language cookie for curl or clients without user agents
Joshua Ramon Enslin
2022-03-26 16:49:10 +0100
8d7b270f6f
Allow setting worker-src in MD_STD_SEC
Joshua Ramon Enslin
2022-03-24 23:25:05 +0100
9507387c8a
Fix bug in validating ISBN 13s
Joshua Ramon Enslin
2022-03-11 23:31:41 +0100
589161219f
Require numbers OR special chars for passwords, not AND
Joshua Ramon Enslin
2022-03-09 00:16:55 +0100
e18b649250
Return array of error messages on password validate
Joshua Ramon Enslin
2022-03-08 21:23:45 +0100
5bb863ffc9
Add function validate_password
Joshua Ramon Enslin
2022-03-08 20:12:54 +0100
1b63951b44
Enable TCP Fast-Open for outgoing curl requests
Joshua Ramon Enslin
2022-02-12 23:06:53 +0100
93991225fe
Use curl_setopt_array and enable http2 for speeding up CURL requests
Joshua Ramon Enslin
2022-02-12 22:51:42 +0100
321609306d
Use strip tags in sanitize_text over deprecated FILTER_SANITIZE_STRING
Joshua Ramon Enslin
2022-02-02 02:18:33 +0100
2a333c1de6
Simplify MD_STD::startsWithAny
Joshua Ramon Enslin
2022-01-16 15:19:40 +0100
c689f7568f
Allow empty input haystacks in MD_STD::stri_contains()
Joshua Ramon Enslin
2022-01-09 22:20:05 +0100
dc86540da2
Explicitly expect positive ints for depths in MD_STD::json_encode
Joshua Ramon Enslin
2022-01-08 01:09:57 +0100
e50f1f0526
Remove superfluous parentheses
Joshua Ramon Enslin
2021-12-24 02:01:40 +0100
e2ada291f7
Fix bug in splitting int arrays, add function for splitting string arrays
Joshua Ramon Enslin
2021-12-14 03:16:11 +0100
aa7a3c5012
Clarify prevention of empty returns in array splitter
Joshua Ramon Enslin
2021-11-30 00:45:02 +0100
3f37dd7a9e
Improve phpdoc types, type-safety
Joshua Ramon Enslin
2021-11-29 22:30:28 +0100
86c8235dae
Specify MDJsonEncodingFailedException for failure to encode JSON through MD_STD::json_encode
Joshua Ramon Enslin
2021-11-26 03:23:07 +0100
8f5174e90d
Move to rather locking down based on user accounts than on IP in MD_STD_SEC, use class constants for more obvious code
Joshua Ramon Enslin
2021-11-25 01:09:08 +0100
80af1ef260
Add function for opening redis connection using default settings
Joshua Ramon Enslin
2021-11-22 23:44:53 +0100
eb869071b8
Add class for splitting a list into lists of a predefined size
Joshua Ramon Enslin
2021-11-16 14:40:38 +0100
e19e0c875c
Add function for batch validating ids in an array
Joshua Ramon Enslin
2021-11-03 02:41:22 +0100
245d161805
Add function stri_contains for case-insensitive, but intuitive str_contains
Joshua Ramon Enslin
2021-09-28 01:15:51 +0200
a1e6d7773b
Fix error in sorting a searched list by an inherent value
Joshua Ramon Enslin
2021-09-26 19:25:07 +0200
d35e3ed003
Fix error in sorting by external list
Joshua Ramon Enslin
2021-09-26 19:23:42 +0200
9113cad57e
Add new class MD_STD_SORT to provide useful sorting tools
Joshua Ramon Enslin
2021-09-26 01:02:18 +0200
143a4680e2
Add validation function for phone numbers
Joshua Ramon Enslin
2021-09-25 21:56:01 +0200
a6ebab3e03
Remove superfluous parentheses
Joshua Ramon Enslin
2021-09-17 15:52:37 +0200
80ab3216d5
Allow setting headers when running MD_STD::runCurl
Joshua Ramon Enslin
2021-08-12 13:57:25 +0200
2071b57053
Add class MD_STD_DEBUG for debugging and code improvements
Joshua Ramon Enslin
2021-07-27 23:44:08 +0200
5e7313f166
Use MD_STD::json_encode over the generic json_encode
Joshua Ramon Enslin
2021-07-20 18:25:34 +0200
1c5d451619
Add json_encode_object for encoding objects (mainly SimpleXML obj.)
Joshua Ramon Enslin
2021-07-20 18:15:23 +0200
7fb5ad8ced
Deprecate MD_STD::startsWith - can be replaced by str_starts_with
Joshua Ramon Enslin
2021-07-20 12:51:46 +0200
01ac23229b
Use MD_STD::unlink over unlink in mime type check
Joshua Ramon Enslin
2021-07-20 03:34:01 +0200
d53303e617
Add option to pass acceptable mime types to MD_STD_IN::move_uploaded_file
Joshua Ramon Enslin
2021-07-20 02:04:55 +0200
6adf0ee0a2
Add wrapper around move_uploaded_file
Joshua Ramon Enslin
2021-07-20 01:26:31 +0200
dbbdf4f230
Add function to ensure an input string is UTF-8 encoded
Joshua Ramon Enslin
2021-07-01 15:34:46 +0200
f030adba20
Set worker-src 'self' in MD_STD_SEC
Joshua Ramon Enslin
2021-05-15 17:17:53 +0200
980c408631
Remove explicit naming of domain in setcookie
Joshua Ramon Enslin
2021-05-15 15:37:05 +0200
a06a6ed41d
Prepare for PHP 8
Joshua Ramon Enslin
2021-05-13 23:02:37 +0200
20c33437c9
Add function for checking the mime type of a remove file
Joshua Ramon Enslin
2021-05-13 22:18:58 +0200
63d6154d40
Fix spelling in setting language cookie
Joshua Ramon Enslin
2021-05-13 15:21:06 +0200
d03befe483
Use prefixed cookies for user language
Joshua Ramon Enslin
2021-05-13 14:48:44 +0200
fe0a8ba83b
Remove obsolete phpcs exclusions
Joshua Ramon Enslin
2021-05-01 22:54:37 +0200
3b5f20aa96
Add missing "static" keyword in MD_STD
Joshua Ramon Enslin
2021-04-14 18:16:13 +0200
56f4fdc88a
Add function get_user_lang for getting user language based on cookies
Joshua Ramon Enslin
2021-04-14 17:59:11 +0200
919ffdb1b5
Use ++$i over $i++
Joshua Ramon Enslin
2021-04-11 21:20:44 +0200
36bdb36986
Use consistent first uppercase char in MD_STD reference to exception
Joshua Ramon Enslin
2021-04-09 13:45:19 +0200
2c1f6a0490
Move scripts to /src subdirectory
Joshua Ramon Enslin
2021-03-09 20:09:11 +0100
06bbaf5f97
Ad doption to set start character on an unordered list in md output
Joshua Ramon Enslin
2021-02-21 01:57:15 +0100
376333b660
Add class MDFormatter for formatting contents in markdown
Joshua Ramon Enslin
2021-02-19 00:49:26 +0100