Commit Graph

30294 Commits

Author SHA1 Message Date
David Woloszyn 42518c7c4a MDL-77846 core: Make endpoint revision number checks stricter
In some places we prevented cache poisoning, in others we did not. We
also did not place any restriction on the minimum value for a revision.

This change introduces a new set of functions for configonly endpoints
which validates the revision numbers passed in. If the revision is
either too old, or too new, it is rejected and the file content is not
cached. The content is still served, but caching headers are not sent,
and any local storage caching is prevented.

The current time is used as the maximum version, with 60 seconds added
to allow for any clock skew between cluster nodes. Previously some
locations used one hour, but there should never be such a large clock
skew on a correctly configured system.

Co-authored-by: Andrew Nicols <andrew@nicols.co.uk>
2023-10-04 02:05:15 +02:00
Ilya Tregubov 55430e7995 Merge branch 'MDL-79360/400' of https://github.com/skodak/moodle into MOODLE_400_STABLE 2023-09-28 09:38:59 +08:00
Petr Skoda 25bc96c1c1 MDL-79360 filter: fix nolink tag regression from MDL-77525 2023-09-15 12:45:31 +02:00
Jun Pataleta 21feaf77ba MDL-78806 behat: Create a step that for checking the page title
Create a Behat step "the page title should contain ':title'" to check
the page title.
2023-09-10 23:33:43 +08:00
Eloy Lafuente (stronk7) 955a276e6e MDL-76459 xmldb: Add environmental check to verify $CFG->prefix
While, right now, sites using long (> 10 chars) $CFG->prefix
can continue working (because we still don't have any table
> 28 chars), as soon as some new table with long name is added,
it won't work with PostgreSQL anymore (if the 63 limit is raised).

Hence, this environmental check will verify on both install and
upgrade that the $CFG->prefix is always <= 10 chars.

Sites with longer prefixes will need to rename all their tables
(and maybe other objects, depending on the dbtype) to use a shorter
prefix.
2023-09-02 09:22:36 +02:00
Jun Pataleta c5231e4d28 Merge branch 'MDL-79017-400' of https://github.com/paulholden/moodle into MOODLE_400_STABLE 2023-08-31 20:31:53 +08:00
Andrew Nicols 2e9dbfd2d1 MDL-78612 core: Wrap modal_factory.create in pendingPromise 2023-08-30 13:36:26 +08:00
Paul Holden 5e91f88d4b MDL-79017 core: re-factor method to unserialize array.
We can use the existing helper for object unserialization as the
base for this method, rather than manual string parsing.
2023-08-21 21:02:48 +01:00
Andrew Nicols c9682dfece Merge branch 'MDL-78684-400' of https://github.com/andelacruz/moodle into MOODLE_400_STABLE 2023-08-16 22:45:00 +08:00
raortegar c1ed3e422d MDL-74289 lib: Improve the proxy bypass matching 2023-08-10 18:45:11 +07:00
Paul Holden a524ac4bb3 MDL-78647 files: safer unserializing of file reference data. 2023-08-04 12:55:23 +02:00
Jun Pataleta cdfb51b114 Merge branch 'MDL-78498-400' of https://github.com/lameze/moodle into MOODLE_400_STABLE 2023-08-02 11:22:50 +08:00
Sara Arjona 9077bade59 Merge branch 'MDL-78703-400' of https://github.com/paulholden/moodle into MOODLE_400_STABLE 2023-08-01 13:45:19 +02:00
Angelia Dela Cruz e24eb760ae MDL-78498 Behat: Use data generators for forum posts and replies
This commit does few things:
* Replace manual forum posts and replies to use data generator.
* It also changes the code to handle social forums.
* Other behat clean-ups and optimization.

Co-authored-by: Simey Lameze <simey@moodle.com>
2023-08-01 16:08:18 +08:00
Angelia Dela Cruz 5017f192ba MDL-78684 Behat: Replace gradebook navigation to use page resolvers
This commit also does other things such as:
- Replace manual steps to setup gradebook by data generators
- Added support for outcomes and scales page resolvers
- Behat clean up
2023-08-01 15:53:59 +08:00
Ferran Recio 78d7191ea5 MDL-78782 behat: optimize with editing mode step
The current I am on course homepage with editing mode loads twice the
course page. This patch prevents this from happening by going directly
to editmode.php.
2023-07-26 16:19:48 +02:00
Paul Holden dcc6ad76f1 MDL-78703 behat: fix HTTP GET method capitalization on redirect. 2023-07-15 01:00:09 +01:00
Andrew Nicols bfc7a5e99f Merge branch 'MDL-78157-400' of https://github.com/golenkovm/moodle into MOODLE_400_STABLE 2023-07-13 09:48:31 +08:00
Andrew Nicols 4136c6b0c9 MDL-78673 grade: Switch test to use generators 2023-07-10 11:31:55 +08:00
Andrew Nicols b621be27c7 MDL-78673 behat: Allow plugins to define their expansion of > 2023-07-10 11:31:54 +08:00
Misha Golenkov 4d1b3728ea MDL-78379 js: Add missing newline character 2023-07-06 16:18:07 +10:00
Petr Skoda abc2201890 MDL-77525 filter: add filtering stages 2023-06-17 16:51:08 +02:00
Andrew Nicols 8ff3117478 Merge branch 'MDL-69231-400' of https://github.com/lameze/moodle into MOODLE_400_STABLE 2023-06-15 10:55:48 +08:00
Ilya Tregubov cbea4fa598 Merge branch 'MDL-70152-400' of https://github.com/andelacruz/moodle into MOODLE_400_STABLE 2023-06-14 13:25:29 +08:00
Sara Arjona 792c35ac30 Merge branch 'MDL-77946-400' of https://github.com/paulholden/moodle into MOODLE_400_STABLE 2023-06-08 06:57:02 +02:00
Sara Arjona 87945beba8 Merge branch 'MDL-78308-400' of https://github.com/paulholden/moodle into MOODLE_400_STABLE 2023-06-08 06:48:46 +02:00
Andrew Nicols 546baf2d7a MDL-76838 core: Add unit test for invalid unicode sequences 2023-06-08 11:59:28 +08:00
Andrew Nicols 3801d87036 Merge branch 'MDL-76838-400' of https://github.com/paulholden/moodle into MOODLE_400_STABLE 2023-06-08 11:54:54 +08:00
Andrew Nicols eb9c234345 Merge branch 'MDL-77264-400' of https://github.com/paulholden/moodle into MOODLE_400_STABLE 2023-06-08 11:33:17 +08:00
Andrew Nicols bc50b73d15 Merge branch 'MDL-78408-400' of https://github.com/snake/moodle into MOODLE_400_STABLE 2023-06-08 11:06:14 +08:00
Andrew Nicols 27249f3681 Merge branch 'MDL-76406-400' of https://github.com/safatshahin/moodle into MOODLE_400_STABLE 2023-06-08 10:41:47 +08:00
Jun Pataleta 5a04d7fc30 Merge branch 'MDL-78431-400' of https://github.com/andrewnicols/moodle into MOODLE_400_STABLE 2023-06-08 10:28:12 +08:00
Stevani Andolo 777e72beff MDL-78215 core: Added support unit test 2023-06-08 09:37:21 +08:00
Stevani Andolo 6ae19a6c9a MDL-78215 core: support checking if 0.0.0.0 is in subnet 2023-06-08 09:37:21 +08:00
Andrew Nicols 555622abf2 MDL-78431 core: Abort after config for source maps 2023-06-07 21:08:00 +08:00
Jake Dallimore d293744f08 MDL-78408 core: fix restoration of anchor to wantsurl during login 2023-06-07 14:31:58 +08:00
Sara Arjona 34fbef096e Merge branch 'MDL-76936-400' of https://github.com/HirotoKagotani/moodle into MOODLE_400_STABLE 2023-06-06 11:22:21 +02:00
Simey Lameze 78aa80dd5f MDL-69231 behat: remaining work for role capability generator
This commit does few things:
* Unify data generators usage to role short name.
* Replace remaining manual steps to use the new data generator.
* Also replaced other manual steps to set config to use data generators.
* Tidy up of some tests, aligning pipes and splitting one line steps into multiple lines.
* Fixes tests to have one Given/When/Then per scenario.
2023-06-02 12:39:52 +08:00
Andrew Nicols 091aa9b872 MDL-69231 tests: Add role capability setting generator 2023-06-02 12:39:52 +08:00
Andrew Nicols 521e21d842 MDL-69231 tests: Improve existing role generator
Support definition of context levels and permissions.
2023-06-02 12:39:52 +08:00
Safat c2e0c4a533 MDL-76406 core: Add environment check for versions not supporting 8.2 2023-06-02 12:09:41 +10:00
Andrew Nicols 36ee03c6f2 Merge branch 'MDL-77749-unset-config-duration-MOODLE_400_STABLE' of https://github.com/brendanheywood/moodle into MOODLE_400_STABLE 2023-06-01 12:03:46 +08:00
Angelia Dela Cruz e0e4b2fad2 MDL-70152 behat: Forum behat generators use UI
Behat cleanup and optimisation
2023-05-29 10:24:10 +08:00
Angelia Dela Cruz b6928826e1 MDL-70152 behat: Forum behat generators use UI
Replace steps that manually add forum and forum post instances
via the UI and use Behat generators. This improves the speed of
Behat test runs.
2023-05-29 10:24:02 +08:00
Paul Holden fa042d8849 MDL-76838 backup: remove invalid utf8 code sequences writing XML.
The surrogate blocks FFFE and FFFF are non-characters, specifically
disallowed in the character range for XML documents.
2023-05-22 21:04:17 +01:00
Sara Arjona 5f0c5919c7 Merge branch 'MDL-78225-400' of https://github.com/paulholden/moodle into MOODLE_400_STABLE 2023-05-22 12:04:24 +02:00
Andrew Nicols e4f344282e MDL-78157 js: Be more careful about inserting missing module names
It is perfectly legitimate to create and/or use a method named `define`
in JS outside of RequireJS.

Unfortunately our requirejs.php wrapper is dumb and does not understand
this.

In the long term we need to stop doing this at all. We really should be
able to already, but every time I try to something prevents it.

In the interim, this change adds a secondary check to see if there is an
existing define which _does_ have the right name in it already.
2023-05-22 14:40:41 +08:00
Andrew Nicols 2fdf057520 MDL-77733 behat: Remove extraneous no-axe option
There is no need for no-axe if we make axe a boolean value. We already
have automatic support for negated boolean flags.
2023-05-19 11:28:19 +08:00
Paul Holden 01b12e91ac MDL-78308 output: better parsing of custom menu item configuration.
Previously certain values would cause deprecation notices in PHP8.1.
2023-05-18 10:19:16 +01:00
Jun Pataleta df846aca78 Merge branch 'MDL-77439-400' of https://github.com/junpataleta/moodle into MOODLE_400_STABLE 2023-05-16 20:39:22 +08:00