Skip to content

Commit

Permalink
Merge branch 't/12189'
Browse files Browse the repository at this point in the history
  • Loading branch information
mlewand committed Nov 4, 2015
2 parents 9d2e4f9 + d8c97dc commit 01babe2
Show file tree
Hide file tree
Showing 5 changed files with 47 additions and 2 deletions.
1 change: 1 addition & 0 deletions CHANGES.md
Expand Up @@ -12,6 +12,7 @@ Fixed Issues:
* [#13887](https://dev.ckeditor.com/ticket/13887): Fixed: Link target now supports wider ASCII character range. Thanks to [SamZiemer](https://github.com/SamZiemer)!
* [#13790](https://dev.ckeditor.com/ticket/13790): Fixed: Allow for the iframe having been removed already. Thanks to [Stefan Rijnhart](https://github.com/StefanRijnhart)!
* [#13803](https://dev.ckeditor.com/ticket/13803): Fixed: Allow the editor to be destroyed before being fully initialized. Thanks to [Cyril Fluck](https://github.com/cyril-sf)!
* [#12189](http://dev.ckeditor.com/ticket/12189): Fixed: Link plugin dialog does not display subject of email links if subject parameter is not lowercase.
* [#13361](http://dev.ckeditor.com/ticket/13361): Fixed: Images fail when site path includes parentheses because background-image path needs single-quotes around URL value.
* [#13798](http://dev.ckeditor.com/ticket/13798): Fixed: Changing paragraph format causes cursor to move on Firefox 41.
* [#13771](http://dev.ckeditor.com/ticket/13771): Fixed: Now `contents.css` style will be used even if [IFrame Editing Area](http://ckeditor.com/addon/wysiwygarea) plugin is missing.
Expand Down
4 changes: 2 additions & 2 deletions plugins/link/plugin.js
Expand Up @@ -203,8 +203,8 @@
// Loads the parameters in a selected link to the link dialog fields.
var javascriptProtocolRegex = /^javascript:/,
emailRegex = /^mailto:([^?]+)(?:\?(.+))?$/,
emailSubjectRegex = /subject=([^;?:@&=$,\/]*)/,
emailBodyRegex = /body=([^;?:@&=$,\/]*)/,
emailSubjectRegex = /subject=([^;?:@&=$,\/]*)/i,
emailBodyRegex = /body=([^;?:@&=$,\/]*)/i,
anchorRegex = /^#(.*)$/,
urlRegex = /^((?:http|https|ftp|news):\/\/)?(.*)$/,
selectableTargets = /^(_(?:self|top|parent|blank))$/,
Expand Down
22 changes: 22 additions & 0 deletions tests/plugins/link/mail_link.js
Expand Up @@ -72,6 +72,28 @@ bender.test( {
assert.areEqual( '', subjectField.getValue() );
assert.areEqual( '', bodyField.getValue() );

dialog.fire( 'ok' );
dialog.hide();
} );
},

// #12189
'test read from mail link with Subject and Body parameters provided': function() {
var bot = this.editorBot;

bot.setHtmlWithSelection( '[<a href="mailto:job@cksource.com?Subject=Test%20subject&amp;Body=Test%20body">AJD</a>]' );

bot.dialog( 'link', function( dialog ) {
var linkTypeField = dialog.getContentElement( 'info', 'linkType' ),
addressField = dialog.getContentElement( 'info', 'emailAddress' ),
subjectField = dialog.getContentElement( 'info', 'emailSubject' ),
bodyField = dialog.getContentElement( 'info', 'emailBody' );

assert.areEqual( 'email', linkTypeField.getValue() );
assert.areEqual( 'job@cksource.com', addressField.getValue() );
assert.areEqual( 'Test subject', subjectField.getValue() );
assert.areEqual( 'Test body', bodyField.getValue() );

dialog.fire( 'ok' );
dialog.hide();
} );
Expand Down
11 changes: 11 additions & 0 deletions tests/plugins/link/manual/parseuppercasedurlparams.html
@@ -0,0 +1,11 @@
<body>
<div id="editor">
<p>
<a href="mailto:jobs@cksource.com?Subject=Test%20subject&amp;Body=Test%20body">jobs@cksource.com</a>
</p>
</div>

<script>
CKEDITOR.replace( 'editor' );
</script>
</body>
11 changes: 11 additions & 0 deletions tests/plugins/link/manual/parseuppercasedurlparams.md
@@ -0,0 +1,11 @@
@bender-tags: tc, link, 12189, 4.5.5
@bender-ui: collapsed
@bender-ckeditor-plugins: link, toolbar, wysiwygarea

----

1. Double click on mail link in the editor. The dialog should open.

**Expected:**
* The value of "E-mail subject" field should be equal to `Test subject`.
* The value of "Email body" field should be equal to `Test body`.

0 comments on commit 01babe2

Please sign in to comment.