main/vcl/aqua/source/app/salinst.cxx
// #i104525# many versions of OSX have problems with some URLs:
// when an app requests OSX to add one of these URLs to the "Recent Items" list
// then this app gets killed (TextEdit, Preview, etc. and also OOo)
i104525# many versions of OSX have problems with some URLs:
when an app requests OSX to add one of these URLs to the "Recent Items" list
then this app gets killed (TextEdit, Preview, etc.
i104525# many versions of OSX have problems with some URLs : when an app requests OSX to add one of these URLs to the " Recent Items " list then this app gets killed ( TextEdit Preview etc .
static bool isDangerousUrl( const rtl::OUString& rUrl )
{
	const int nLen = rUrl.getLength();
	const sal_Unicode* p = rUrl.getStr();
	for( int i = 0; i < nLen-3; ++i, ++p ) {
		if( p[0] != '%' )
			continue;
		if( (p[1] == '2') && (p[2] == '5') )
			return true;
		if( (p[1] != 'f') && (p[1] != 'F') )
			continue;
		int cLowNibble = p[2];
		if( (cLowNibble >= '0' ) && (cLowNibble <= '9'))
			return false;
		if( cLowNibble >= 'a' )
			cLowNibble -= 'a' - 'A';
		if( (cLowNibble < 'A') || (cLowNibble >= 'C'))
			return true;
	}
	return false;
}
static bool isDangerousUrl ( const rtl :: OUString & rUrl ) { const int nLen = rUrl . getLength ( ) ; const sal_Unicode * p = rUrl . getStr ( ) ; for ( int i = 0 ; i < nLen - 3 ; ++ i , ++ p ) { if ( p [ 0 ] != ' ' ) continue ; if ( ( p [ 1 ] == ' ' ) && ( p [ 2 ] == ' ' ) ) return true ; if ( ( p [ 1 ] != ' ' ) && ( p [ 1 ] != ' ' ) ) continue ; int cLowNibble = p [ 2 ] ; if ( ( cLowNibble >= ' ' ) && ( cLowNibble <= ' ' ) ) return false ; if ( cLowNibble >= ' ' ) cLowNibble -= ' ' - ' ' ; if ( ( cLowNibble < ' ' ) || ( cLowNibble >= ' ' ) ) return true ; } return false ; }
i104525# many versions of OSX have problems with some URLs:
when an app requests OSX to add one of these URLs to the "Recent Items" list
then this app gets killed (TextEdit, Preview, etc.
i104525# many versions of OSX have problems with some URLs : when an app requests OSX to add one of these URLs to the " Recent Items " list then this app gets killed ( TextEdit Preview etc .
// use a heuristic that detects all known cases since there is no official comment // on the exact impact and root cause of the OSX bug // escaped percent? // escapes are considered to be UTF-8 encoded // => check for invalid UTF-8 leading byte