diff --git src/wp-admin/js/bookmarklet.js src/wp-admin/js/bookmarklet.js
index fe8e74a..b1d1a58 100644
|
|
|
|
| | 1 | /** |
| | 2 | * @summary Creates a form with a URL, title, and content based on the current opened URL and the content of the associated web page. |
| | 3 | * |
| | 4 | * @since 4.2.0 |
| | 5 | * |
| | 6 | * @param {window} window The window. |
| | 7 | * @param {document} document The document. |
| | 8 | * @param {string} href The current opened URL. |
| | 9 | * @param {string} pt_url The URL to post the content to. |
| | 10 | * |
| | 11 | * @returns {void} |
| | 12 | */ |
| 1 | 13 | ( function( window, document, href, pt_url ) { |
| 2 | 14 | var encURI = window.encodeURIComponent, |
| 3 | 15 | form = document.createElement( 'form' ), |
| … |
… |
|
| 13 | 25 | |
| 14 | 26 | if ( href.match( /^https?:/ ) ) { |
| 15 | 27 | pt_url += '&u=' + encURI( href ); |
| | 28 | // Check whether the unencoded url and the encoded url use the same protocol. |
| 16 | 29 | if ( href.match( /^https:/ ) && pt_url.match( /^http:/ ) ) { |
| 17 | 30 | canPost = false; |
| 18 | 31 | } |
| … |
… |
|
| 52 | 65 | return; |
| 53 | 66 | } |
| 54 | 67 | |
| | 68 | /** |
| | 69 | * @summary Creates a hidden input field and sets its name and value. |
| | 70 | * |
| | 71 | * @since 4.2.0 |
| | 72 | * |
| | 73 | * @param name The input field name. |
| | 74 | * @param value The input field value. |
| | 75 | * |
| | 76 | * @returns {void} |
| | 77 | */ |
| 55 | 78 | function add( name, value ) { |
| 56 | 79 | if ( typeof value === 'undefined' ) { |
| 57 | 80 | return; |