Changeset 12219
- Timestamp:
- 09/07/2018 03:43:17 AM (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/bp-templates/bp-nouveau/js/buddypress-nouveau.js
r12201 r12219 2 2 /* jshint devel: true */ 3 3 /* jshint browser: true */ 4 /* @version 3. 0.0 */4 /* @version 3.2.0 */ 5 5 window.wp = window.wp || {}; 6 6 window.bp = window.bp || {}; … … 160 160 161 161 return params; 162 }, 163 164 /** 165 * URL Decode a query variable. 166 * 167 * @param {string} qv The query variable to decode. 168 * @param {object} chars The specific characters to use. Optionnal. 169 * @return {string} The URL decoded variable. 170 */ 171 urlDecode: function( qv, chars ) { 172 var specialChars = chars || { 173 amp: '&', 174 lt: '<', 175 gt: '>', 176 quot: '"', 177 '#039': '\'' 178 }; 179 180 return decodeURIComponent( qv.replace( /\+/g, ' ' ) ).replace( /&([^;]+);/g, function( v, q ) { 181 return specialChars[q] || ''; 182 } ); 162 183 }, 163 184 … … 239 260 } 240 261 262 // Prepare the search terms for the request 263 if ( data.search_terms ) { 264 data.search_terms = data.search_terms.replace( /</g, '<' ).replace( />/g, '>' ); 265 } 266 241 267 // Set session's data 242 268 if ( null !== data.scope ) { … … 358 384 359 385 if ( search_terms ) { 360 search_terms = decodeURIComponent( search_terms.replace( /\+/g, ' ' ));386 search_terms = self.urlDecode( search_terms ); 361 387 $( '#buddypress [data-bp-search="' + object + '"] input[type=search]' ).val( search_terms ); 362 388 }
Note: See TracChangeset
for help on using the changeset viewer.