mirror of https://github.com/vector-im/riot-web
				
				
				
			For paths with variables, insert <redacted>
To preserve the analytics for these pages we did previouslypull/21833/head
							parent
							
								
									ff4909e6ab
								
							
						
					
					
						commit
						6b0af81f71
					
				| 
						 | 
				
			
			@ -21,6 +21,7 @@ import Modal from './Modal';
 | 
			
		|||
import sdk from './index';
 | 
			
		||||
 | 
			
		||||
const hashRegex = /#\/(groups?|room|user|settings|register|login|forgot_password|home|directory)/;
 | 
			
		||||
const hashVarRegex = /#\/(group|room|user)\/.*$/;
 | 
			
		||||
 | 
			
		||||
// Remove all but the first item in the hash path. Redact unexpected hashes.
 | 
			
		||||
function getRedactedHash(hash) {
 | 
			
		||||
| 
						 | 
				
			
			@ -31,6 +32,10 @@ function getRedactedHash(hash) {
 | 
			
		|||
        return '#/<unexpected hash location>';
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    if (hashVarRegex.test(hash)) {
 | 
			
		||||
        return hash.replace(hashVarRegex, "#/$1/<redacted>");
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    return hash.replace(hashRegex, "#/$1");
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
		Reference in New Issue