Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Circumvent sending null to preg_match and strip_tags #437

Open
wants to merge 1 commit into
base: MOODLE_404_DEV
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions local/kaltura/locallib.php
Original file line number Diff line number Diff line change
Expand Up @@ -238,8 +238,10 @@ function local_kaltura_get_endpoint($module) {
function local_kaltura_add_kaf_uri_token($url) {
$configsettings = local_kaltura_get_config();
// For records that have been migrated from old kaf uri to token format by search and replace.
if (preg_match('/https?:\/\/'.KALTURA_URI_TOKEN.'/', $url)) {
$url = preg_replace('/https?:\/\/'.KALTURA_URI_TOKEN.'/', $configsettings->kaf_uri, $url);
if (!is_null($url)) {
if (preg_match('/https?:\/\/'.KALTURA_URI_TOKEN.'/', $url)) {
$url = preg_replace('/https?:\/\/'.KALTURA_URI_TOKEN.'/', $configsettings->kaf_uri, $url);
}
}
return $url;
}
Expand Down
4 changes: 3 additions & 1 deletion mod/kalvidassign/renderer.php
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,9 @@ public function col_submissioncomment($data) {
$output .= html_writer::end_tag('textarea');

} else {
$output = shorten_text(strip_tags($data->submissioncomment), 15);
if (isset($data->submissioncomment) && !is_null($data->submissioncomment)) {
$output = shorten_text(strip_tags($data->submissioncomment), 15);
}
}

return $output;
Expand Down