Commit graph

1827 commits

Author SHA1 Message Date
David Mudrák
db0073291b MDL-72203 curl: Warn if someone actually started to use $maxredirects
The new parameter of curl_security_helper::url_is_blocked() introduced
in MDL-71916 became part of the API. Even if we reverted it quickly,
someone can use a released Moodle version that has that parameter in
place. For that reason and also to avoid potential troubles in the
future (e.g. when yet another argument would be added to this method),
we need to make it clear that the second parameter of this method should
never be used again.

Poor $maxredirects, you did not live long with us. Oh well.
2021-07-27 23:22:21 +08:00
David Mudrák
984e3fc510 MDL-72203 curl: Revert original fix of redirects to blocked URLs
This reverts the original fix introduced in MDL-71916. It introduced an
extra native cURL call inside curl_security_helper to check if the given
URL triggers a redirect to a blocked URL or not.

Shortly after the release, a couple of regressions were reported as a
result of the integrated solution. It was agreed to revert the fix and
progress with implementing an alternative approach.
2021-07-27 23:22:21 +08:00
cescobedo
913eb31830 MDL-71919 core_message: Fix unclosed html tags in email notification 2021-07-08 23:34:54 +02:00
Michael Hawkins
61e9318339 MDL-71916 lib: Check cURL redirects for blocked URLs before following 2021-07-06 23:45:24 +02:00
Paul Holden
80e2f8473e MDL-71981 dataformat: indicate HTML support in writer callback. 2021-07-06 09:29:44 +08:00
Peter Dias
1dd574efd8 MDL-71460 hub: Use checkboxes instead of dropdowns
Change the yes/no dropdowns to a checkbox. Defaults to unchecked.
2021-05-05 10:28:02 +08:00
Sara Arjona
3f5477f8a0 Merge branch 'MDL-71136_39' of https://github.com/TomoTsuyuki/moodle into MOODLE_39_STABLE 2021-04-22 13:56:55 +02:00
Simey Lameze
c72839d6d0 MDL-71156 core: machinery to recover orphaned calendar events
The machinery to fix orphaned calendar events that were broken by MDL-67494.

The solution consists of:

1) Upgrade step that checks if this site has executed the problematic upgrade steps and
   if positive, it will schedule a new run for calendar_fix_orphaned_events adhoc task.

2) Adhoc task that will self-spawn calling the recovery machinery, running until
   all the orphaned calendar events are fixed. It also sets the maximum runtime of
   60 seconds. It is also possible to override that number by specifing the desired
   number setting the ->calendareventsmaxseconds in your config.php

3) CLI script that will look for all the calendar events which userids
   where broken by a wrong upgrade step, affecting to Moodle 3.9.5
   and up.

   It performs checks to both:
     a) Detect if the site was affected (ran the wrong upgrade step).
     b) Look for orphaned calendar events, categorising them as:
       - standard: site / category / course / group / user events
       - subscription: events created via subscriptions.
       - action: normal action events, created to show common important dates.
       - override: user and group override events, particular, that some activities support.
       - custom: other events, not being any of the above, common or particular.

   By specifying it (--fix) try to recover as many broken events (missing userid) as
   possible. Standard, subscription, action, override events in core are fully supported but
   override or custom events should be fixed by each plugin as far as there isn't any standard
   API (plugin-wise) to launch a rebuild of the calendar events.

4) Unit tests and helper functions to generate calendar events. We have decided to
   keep the tests simple, testing only true and false and not using data generators because
   the code is purely to recover the calendar events and won't turn into an API or something
   and also due to the urgency of this issue.
   The helpers have been created in calendar/tests/helpers.php since there are no data generators
   for calendar.
2021-04-22 10:45:27 +08:00
Tomo Tsuyuki
c34c6a75df MDL-71136 backup: Fix moodle_exception path. 2021-03-30 10:55:38 +11:00
Eloy Lafuente (stronk7)
8d748b3401 Merge branch 'MDL-70424-auth-avoid-changes-MOODLE_39_STABLE' of https://github.com/brendanheywood/moodle into MOODLE_39_STABLE 2021-03-04 00:32:34 +01:00
Brendan Heywood
6feb10dd53 MDL-70424 auth: Avoid random changes to $CFG->auth 2021-03-04 09:31:51 +11:00
Sara Arjona
226a690c0d Merge branch 'MDL-67119-39' of git://github.com/aanabit/moodle into MOODLE_39_STABLE 2021-03-03 11:11:47 +01:00
Sander Wind
299fb2f158 MDL-70668 auth: Fix secret validation during user confirmation
Co-authored-by: Michael Hawkins <michaelh@moodle.com>
2021-03-02 23:37:35 +01:00
Amaia Anabitarte
120b877cb6 MDL-67119 core_analytics: Analyse users once per course
User's activity in a course should be analysed only once
no matter the number of enrolments the user has in that course.
2021-02-26 11:48:09 +01:00
Ilya Tregubov
8d4930ab11 MDL-70552 core_message: Show popup for teachers when anonymous
user completed feedback.
2021-02-17 08:43:35 +02:00
Eloy Lafuente (stronk7)
bb9e3ec1ff Merge branch 'MDL-70476_39' of https://github.com/timhunt/moodle into MOODLE_39_STABLE 2021-01-07 00:28:16 +01:00
Mikhail Golenkov
322afa9f4f MDL-70520 tasks: Keep lastruntime when a scheduled task is reset 2020-12-22 15:31:38 +11:00
Tim Hunt
f6ae03bf41 MDL-70476 permission overrides: role names double-escaped in tool tip 2020-12-18 13:09:02 +00:00
Sara Arjona
1bc92d37f2 Merge branch 'MDL-69553-m39' of https://github.com/NeillM/moodle into MOODLE_39_STABLE 2020-10-22 08:56:19 +02:00
Adrian Greeve
3c2208cc24 Merge branch 'MDL-69788-39' of https://github.com/paulholden/moodle into MOODLE_39_STABLE 2020-10-22 09:06:53 +08:00
Sara Arjona
41cd0c4d3a Merge branch 'm39_MDL-68536_Notice_Undefined_Property_CFG_branch' of https://github.com/scara/moodle into MOODLE_39_STABLE 2020-10-21 18:33:15 +02:00
Neill Magill
e9506c638b MDL-69553 output: Handle pre-loading multiline string defines
Before this patch strings that were declared over multiple lines in
a template would not be parsed correctly.

{{#str}}value,
mod_forum{{/str}}

would have been been parsed to get_string('value', 'core')

{{#str}}
value, mod_forum
{{/str}}

would have been been parsed to get_string('', 'core')
2020-10-21 10:08:23 +01:00
Jake Dallimore
6e7c392d84 Merge branch 'MDL-68983-recent-session-lock-ro-MOODLE_39_STABLE' of https://github.com/brendanheywood/moodle into MOODLE_39_STABLE 2020-10-21 12:46:11 +08:00
Paul Holden
c4c328565d MDL-69788 lang: fallback to all translations if misconfigured.
If given translation list contains only invalid entries, fallback
to returning the complete list of available language translations.
2020-10-16 14:38:07 +01:00
Brendan Heywood
cedf141cc3 MDL-68983 cache: Fix bug with readonly session combined with lock debug 2020-10-13 14:53:11 +11:00
Brendan Heywood
2e5daf9108 MDL-68292 core: Remove sesskey leakage on module pages 2020-10-12 17:11:48 +11:00
Eloy Lafuente (stronk7)
7714ea42ec Merge branch 'MDL-69772-39-allcountrycodes' of git://github.com/mudrd8mz/moodle into MOODLE_39_STABLE 2020-10-06 00:04:13 +02:00
Matteo Scaramuccia
d84da184c5 MDL-68536 core: Fix notice about undefined prop 'branch' in $CFG 2020-09-30 14:47:20 +02:00
Sara Arjona
b354694012 Merge branch 'MDL-69342-39_profile_picture_deletion' of https://github.com/vtos/moodle into MOODLE_39_STABLE 2020-09-29 19:01:19 +02:00
David Mudrák
11e5003bd6 MDL-69772 lang: Ignore misconfigured allcountrycodes filter
If the allcountrycodes filter contains only invalid values, ignore the
whole filter setting and make get_list_of_countries() return the full
list of all known countries, rather than empty list.
2020-09-24 18:14:12 +02:00
Vitaly
141216f94c MDL-69342 core_user: fixed user picture updating
When editing a user and checking the 'Delete picture' checkbox to delete
the old picture and uploading a new one at a time, the new one didn't appear
in the user profile. This happened due to the 'if/else' statement
in the 'core_user::update_picture()' method which allowed either to delete
the old picture or to upload a new one.
The fix removes the 'else' part of the 'if/else' statement to force
checking for a new uploaded picture no matter if a user checked
the 'Delete picture' checkbox or not.
2020-09-24 10:55:29 +03:00
Paul Holden
4ff5d5ef17 MDL-69448 backup: fix capability checks when unable to copy user data.
When a given user doesn't have the capability to "Include user data"
during course copying, freeze the form element rather than not adding
it at all.

This caused problems as the element was required before preceding with
the course copy.
2020-09-04 08:20:13 +01:00
Andrew Nicols
22217ac42f Merge branch 'MOODLE_39_MDL-69358' of https://github.com/golenkovm/moodle into MOODLE_39_STABLE 2020-08-27 10:57:57 +08:00
Sara Arjona
0f13aee6fb MDL-61215 core_files: add new optimised_image group
Currently, PHP getimagesize method doesn't support SVG images.
As some features, such as badges, processs and optimise the images
before using them, a new filetype group has been created to exclude
SVG from there: optimised_image.
SVG can't be removed from web_image because then users won't be
able to add SVG images to their courses using labels, pages...
2020-08-14 17:06:57 +02:00
Mikhail Golenkov
5778aa1fa1 MDL-69358 backup: Do not clean up records for incomplete adhoc tasks.
Co-authored-by: Heena Agheda <heenaagheda@catalyst-au.net>
2020-08-12 12:07:28 +10:00
Paul Holden
5068d59b13 MDL-69311 dataformat: correct license docblock.
When this class was implemented in 8844cb82, it incorrectly set the
license to Moodle Workplace.
2020-07-22 10:44:38 +01:00
Andrew Nicols
aa6bf0f367 MDL-69215 output: Correct use of icon_system::instance 2020-07-16 07:30:32 +08:00
Andrew Nicols
7164e1626e MDL-69215 output: Correct font awesome for themes 2020-07-16 07:30:32 +08:00
Marina Glancy
b1a2e67326 MDL-69109 theme: try to load icons from the current theme 2020-07-08 08:40:52 +08:00
Marina Glancy
40553ed459 MDL-69109 core: use different cache keys for FA icon maps 2020-07-08 08:40:51 +08:00
Jake Dallimore
c53b9c9a6f Merge branch 'MDL-68991-master' of git://github.com/rezaies/moodle 2020-06-11 12:27:16 +08:00
Jun Pataleta
a04f9e8bf4 Merge branch 'MDL-69013-master' of git://github.com/andrewnicols/moodle 2020-06-11 11:28:31 +08:00
Andrew Nicols
6414edf1f9 MDL-69013 core: Add quizaccess_safebrowser to deleted plugins 2020-06-11 09:43:38 +08:00
Shamim Rezaie
ce80716a8e MDL-68991 core: delete core_get_userfeedback_url webservice 2020-06-10 16:12:03 +10:00
Shamim Rezaie
292a67aede MDL-68991 core: Prevent popup blockers blocking feedback window
Some browsers like Firefox are very inflexible with window.open()
and block it if it is not instantly invoked after the user click.

Also according to https://stackoverflow.com/a/6807615 it is best
practice to replace self:: with static::
2020-06-10 16:10:53 +10:00
Shamim Rezaie
4cdcd23fb2 MDL-68931 core: No feedback link on footer if the feature is disabled 2020-06-10 16:10:53 +10:00
Jun Pataleta
1495cf837e Merge branch 'MDL-68931-master' of git://github.com/rezaies/moodle 2020-06-09 22:53:04 +08:00
Shamim Rezaie
e505618f08 MDL-68931 core: No feedback link on footer if the feature is disabled 2020-06-09 19:05:16 +10:00
Paul Holden
fb6b7e8a42 MDL-68950 core: add Moodlenet tool to standard plugin list. 2020-06-07 22:44:00 +01:00
Jun Pataleta
ee8a4fbb95 MDL-68933 core: Use get_config() to fetch theme version number
Fetching the theme version number via get_component_version() which
requires lib/adminlib.php unnecessarily increases memory consumption.
Using get_config() is more direct and simpler.
2020-06-05 16:19:02 +08:00