jenkins-bot has submitted this change and it was merged.

Change subject: Sanitize invalid titles: replace slash with hyphen
......................................................................


Sanitize invalid titles: replace slash with hyphen

Bug: T74889
Change-Id: I8a9ba843275d20627077bd95fb5849a95762fa4b
---
M resources/ep.addcourse.js
1 file changed, 3 insertions(+), 1 deletion(-)

Approvals:
  AndyRussG: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/resources/ep.addcourse.js b/resources/ep.addcourse.js
index 425c1a6..1f19c52 100644
--- a/resources/ep.addcourse.js
+++ b/resources/ep.addcourse.js
@@ -10,8 +10,10 @@
 
        $( document ).ready( function() {
 
-               $( '.ep-course-add' ).closest( 'form' ).submit( function() {
+               $( '.ep-course-add' ).closest( 'form' ).submit( function(event) 
{
                        var courseName = $( '#newname' ).val();
+                       // replace slash with hyphen in the course name, to 
keep it from causing database errors
+                       courseName = courseName.replace(/\//g, "-");
                        courseName = courseName.charAt( 0 ).toUpperCase() + 
courseName.slice( 1 );
 
                        $( this ).attr(

-- 
To view, visit https://gerrit.wikimedia.org/r/183998
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I8a9ba843275d20627077bd95fb5849a95762fa4b
Gerrit-PatchSet: 6
Gerrit-Project: mediawiki/extensions/EducationProgram
Gerrit-Branch: master
Gerrit-Owner: Sputniza <anke.nowot...@gmail.com>
Gerrit-Reviewer: AndyRussG <andrew.green...@gmail.com>
Gerrit-Reviewer: Ragesoss <rages...@gmail.com>
Gerrit-Reviewer: jenkins-bot <>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to