Skip to content

Commit

Permalink
Merge branch 'MDL-67115' of https://github.com/stronk7/moodle
Browse files Browse the repository at this point in the history
  • Loading branch information
junpataleta authored and abgreeve committed Jan 23, 2020
2 parents c3c0d06 + 87861d9 commit 21b0f58
Show file tree
Hide file tree
Showing 19 changed files with 32 additions and 23 deletions.
8 changes: 4 additions & 4 deletions admin/renderer.php
Original file line number Diff line number Diff line change
Expand Up @@ -1290,7 +1290,7 @@ protected function missing_dependencies(core_plugin_manager $pluginman) {
if ($unavailable or $unknown) {
$out .= $this->output->heading(get_string('misdepsunavail', 'core_plugin'));
if ($unknown) {
$out .= $this->output->notification(get_string('misdepsunknownlist', 'core_plugin', implode($unknown, ', ')));
$out .= $this->output->notification(get_string('misdepsunknownlist', 'core_plugin', implode(', ', $unknown)));
}
if ($unavailable) {
$unavailablelist = array();
Expand All @@ -1305,7 +1305,7 @@ protected function missing_dependencies(core_plugin_manager $pluginman) {
$unavailablelist[] = $unavailablelistitem;
}
$out .= $this->output->notification(get_string('misdepsunavaillist', 'core_plugin',
implode($unavailablelist, ', ')));
implode(', ', $unavailablelist)));
}
$out .= $this->output->container_start('plugins-check-dependencies-actions');
$out .= ' '.html_writer::link(new moodle_url('/admin/tool/installaddon/'),
Expand Down Expand Up @@ -1425,7 +1425,7 @@ protected function available_missing_dependencies_list(core_plugin_manager $plug
html_writer::div($plugin->name, 'name').' '.html_writer::div($plugin->component, 'component'),
$plugin->version->release,
$plugin->version->version,
implode($supportedmoodles, ' '),
implode(' ', $supportedmoodles),
$info
);
}
Expand Down Expand Up @@ -2037,7 +2037,7 @@ public function environment_check_table($result, $environment_results) {
if (empty($CFG->docroot) or $environment_result->plugin) {
$report = get_string($stringtouse, 'admin', $rec);
} else {
$report = $this->doc_link(join($linkparts, '/'), get_string($stringtouse, 'admin', $rec), true);
$report = $this->doc_link(join('/', $linkparts), get_string($stringtouse, 'admin', $rec), true);
}
// Enclose report text in div so feedback text will be displayed underneath it.
$report = html_writer::div($report);
Expand Down
2 changes: 1 addition & 1 deletion completion/criteria/completion_criteria_activity.php
Original file line number Diff line number Diff line change
Expand Up @@ -288,7 +288,7 @@ public function get_details($completion) {
}
}

$details['requirement'] = implode($details['requirement'], ', ');
$details['requirement'] = implode(', ', $details['requirement']);

$details['status'] = '';

Expand Down
2 changes: 1 addition & 1 deletion filter/tex/filter.php
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ function filter($text, array $options = array()) {
'\\\\\((.+?)\\\\\)',
'\\[tex\\](.+?)\\[\/tex\\]'
);
$megarule = '/' . implode($rules, '|') . '/is';
$megarule = '/' . implode('|', $rules) . '/is';
preg_match_all($megarule, $text, $matches);
for ($i=0; $i<count($matches[0]); $i++) {
$texexp = '';
Expand Down
2 changes: 1 addition & 1 deletion group/classes/output/user_groups_editable.php
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ public function export_for_template(\renderer_base $output) {
}

if (!empty($listofgroups)) {
$this->displayvalue = implode($listofgroups, ', ');
$this->displayvalue = implode(', ', $listofgroups);
} else {
$this->displayvalue = get_string('groupsnone');
}
Expand Down
2 changes: 2 additions & 0 deletions lib/google/readme_moodle.txt
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@ Here are the files that we have added.

Local changes (to reapply until upstream upgrades contain them):
* MDL-67034 php74 compliance fixes
* MDL-67115 php74 implode() compliance fixes. This is fixed in upstream library v2.2.4
(verify that https://github.com/googleapis/google-api-php-client/pull/1683 is applied)


Information
Expand Down
2 changes: 1 addition & 1 deletion lib/google/src/Google/Http/REST.php
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ public static function createRequestUri($servicePath, $restPath, $params)
}

if (count($queryVars)) {
$requestUrl .= '?' . implode($queryVars, '&');
$requestUrl .= '?' . implode('&', $queryVars);
}

return $requestUrl;
Expand Down
4 changes: 2 additions & 2 deletions lib/htmlpurifier/HTMLPurifier/Printer/HTMLDefinition.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,8 @@ protected function renderDoctype()
$ret .= $this->element('caption', 'Doctype');
$ret .= $this->row('Name', $doctype->name);
$ret .= $this->row('XML', $doctype->xml ? 'Yes' : 'No');
$ret .= $this->row('Default Modules', implode($doctype->modules, ', '));
$ret .= $this->row('Default Tidy Modules', implode($doctype->tidyModules, ', '));
$ret .= $this->row('Default Modules', implode(', ', $doctype->modules));
$ret .= $this->row('Default Tidy Modules', implode(', ', $doctype->tidyModules));
$ret .= $this->end('table');
return $ret;
}
Expand Down
3 changes: 2 additions & 1 deletion lib/htmlpurifier/readme_moodle.txt
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,5 @@ Description of HTML Purifier v4.12.0 library import into Moodle

Modifications:
(verify if we need to apply them on every upgrade, remove when not needed)
(No modification was needed)
* MDL-67115 applied https://github.com/ezyang/htmlpurifier/pull/243 towards
php74 compatibility.
2 changes: 1 addition & 1 deletion lib/listlib.php
Original file line number Diff line number Diff line change
Expand Up @@ -552,7 +552,7 @@ public function to_html($indent = 0, $extraargs = array()) {
} else {
$childrenhtml = '';
}
return $this->item_html($extraargs).'&nbsp;'.(join($this->icons, '')).(($childrenhtml !='')?("\n".$childrenhtml):'');
return $this->item_html($extraargs).'&nbsp;'.(join('', $this->icons)).(($childrenhtml !='')?("\n".$childrenhtml):'');
}

public function set_icon_html($first, $last, $lastitem) {
Expand Down
2 changes: 1 addition & 1 deletion lib/minify/matthiasmullie-minify/src/CSS.php
Original file line number Diff line number Diff line change
Expand Up @@ -525,7 +525,7 @@ protected function shortenColors($content)
);

return preg_replace_callback(
'/(?<=[: ])('.implode(array_keys($colors), '|').')(?=[; }])/i',
'/(?<=[: ])('.implode('|', array_keys($colors)).')(?=[; }])/i',
function ($match) use ($colors) {
return $colors[strtoupper($match[0])];
},
Expand Down
6 changes: 6 additions & 0 deletions lib/minify/readme_moodle.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,9 @@ mv minify-1.3.51/data /path/to/moodle/lib/minify/matthiasmullie-minify/
2) Download https://github.com/matthiasmullie/path-converter/archive/1.1.0.zip and unzip

mv path-converter-1.1.0/src/ /path/to/moodle/lib/minify/matthiasmullie-pathconverter/

Local changes applied:

MDL-67115: php 74 compliance - implode() params order. Note this has been fixed upstream
by https://github.com/matthiasmullie/minify/pull/300 so, whenever this library is updated
check if the fix is included and remove this note.
4 changes: 2 additions & 2 deletions lib/questionlib.php
Original file line number Diff line number Diff line change
Expand Up @@ -1420,7 +1420,7 @@ function question_category_options($contexts, $top = false, $currentcat = 0,
foreach ($contexts as $context) {
$pcontexts[] = $context->id;
}
$contextslist = join($pcontexts, ', ');
$contextslist = join(', ', $pcontexts);

$categories = get_categories_for_contexts($contextslist, 'parent, sortorder, name ASC', $top);

Expand Down Expand Up @@ -2011,7 +2011,7 @@ public function require_cap($cap) {
*/
public function require_one_cap($caps) {
if (!$this->have_one_cap($caps)) {
$capsstring = join($caps, ', ');
$capsstring = join(', ', $caps);
print_error('nopermissions', '', '', $capsstring);
}
}
Expand Down
2 changes: 1 addition & 1 deletion lib/tests/behat/behat_navigation.php
Original file line number Diff line number Diff line change
Expand Up @@ -300,7 +300,7 @@ protected function select_node_in_navigation($nodetext, $parentnodes) {
// Throw exception if no node found.
if (!$nodetoclick) {
throw new ExpectationException('Navigation node "' . $nodetext . '" not found under "' .
implode($parentnodes, ' > ') . '"', $this->getSession());
implode(' > ', $parentnodes) . '"', $this->getSession());
}
$nodetoclick->click();
}
Expand Down
2 changes: 1 addition & 1 deletion lib/tests/other/pdflibtestpage.php
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@
}
$list[] = $f;
}
$c .= implode($list, ', ');
$c .= implode(', ', $list);
$c .= '<p><i><small>Note: * Standard core fonts are not embedded in PDF files, PDF viewers are using local fonts.</small></i></p>';

$c .= '<h3>Installed languages and their alphabets</h3>';
Expand Down
4 changes: 2 additions & 2 deletions mod/glossary/lib.php
Original file line number Diff line number Diff line change
Expand Up @@ -570,13 +570,13 @@ function glossary_print_recent_activity($course, $viewfullnames, $timestart) {

$joins = array(' FROM {glossary_entries} ge ');
$joins[] = 'JOIN {user} u ON u.id = ge.userid ';
$fromsql = implode($joins, "\n");
$fromsql = implode("\n", $joins);

$params['timestart'] = $timestart;
$clausesql = ' WHERE ge.timemodified > :timestart ';

if (count($approvals) > 0) {
$approvalsql = 'AND ('. implode($approvals, ' OR ') .') ';
$approvalsql = 'AND ('. implode(' OR ', $approvals) .') ';
} else {
$approvalsql = '';
}
Expand Down
2 changes: 1 addition & 1 deletion question/editlib.php
Original file line number Diff line number Diff line change
Expand Up @@ -490,7 +490,7 @@ function question_build_edit_resources($edittab, $baseurl, $params) {
foreach ($contexts->having_one_edit_tab_cap($edittab) as $context){
$contextlistarr[] = "'{$context->id}'";
}
$contextlist = join($contextlistarr, ' ,');
$contextlist = join(' ,', $contextlistarr);
if (!empty($pagevars['cat'])){
$catparts = explode(',', $pagevars['cat']);
if (!$catparts[0] || (false !== array_search($catparts[1], $contextlistarr)) ||
Expand Down
2 changes: 1 addition & 1 deletion question/format/examview/format.php
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ public function readquestions($lines) {
$questions = array();
$currentquestion = array();

$text = implode($lines, ' ');
$text = implode(' ', $lines);
$text = $this->cleanunicode($text);

$xml = xmlize($text, 0);
Expand Down
2 changes: 1 addition & 1 deletion question/format/examview/tests/examviewformat_test.php
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,7 @@ public function test_parse_matching_groups() {
$lines = $this->make_test_xml();

$importer = new qformat_examview();
$text = implode($lines, ' ');
$text = implode(' ', $lines);

$xml = xmlize($text, 0);
$importer->parse_matching_groups($xml['examview']['#']['matching-group']);
Expand Down
2 changes: 1 addition & 1 deletion user/classes/output/user_roles_editable.php
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ public function export_for_template(\renderer_base $output) {
}

if (!empty($listofroles)) {
$this->displayvalue = implode($listofroles, ', ');
$this->displayvalue = implode(', ', $listofroles);
} else if (!empty($roleids) && empty($viewableroleids)) {
$this->displayvalue = get_string('novisibleroles', 'role');
} else {
Expand Down

0 comments on commit 21b0f58

Please sign in to comment.