anchor.diff:          return f;
       }
       
  -	public String readProperties( ServletContext context )
  -		throws IOException
  -	{
  +    public String readProperties( ServletContext context )
  +        throws IOException
  +    {
           File f = findPropertyFile( context );
  -		FileReader in = null;
  -		String contents = null;
  -		try
  -		{
  -			in = new FileReader( f );
  +        FileReader in = null;
  +        String contents = null;
  +        try
  +        {
  +            in = new FileReader( f );
               contents = FileUtil.readContents( in );
  -		}
  -		finally
  -		{
  -			if( in != null ) in.close();
  -		}
  +        }
  +        finally
  +        {
  +            if( in != null ) in.close();
  +        }
   		
  -		return contents;
  -	}
  +        return contents;
  +    }
   %>
   
   <%
       String propertyString = readProperties( getServletContext() );
       
       Properties props = new Properties();
  -    props.load( new ByteArrayInputStream(propertyString.getBytes("ISO-8859-1")) );
  -    
  -
  -    String appname = request.getParameter( "appname" );
  -    String baseurl = request.getParameter( "baseurl" );
  -    String dir = request.getParameter( "dir" );
  -    String logdir = request.getParameter( "logdir" );
  -    String workdir = request.getParameter( "workdir" );
  -    String password1 = request.getParameter( "password1" );
  -    String password2 = request.getParameter( "password2" );
  -    String password  = request.getParameter( "password" );
  +    props.load( new ByteArrayInputStream(propertyString.getBytes()) );
  +    
  +
  +    String appname   = safeGetParameter( request, "appname" );
  +    String baseurl   = safeGetParameter( request, "baseurl" );
  +    String dir       = safeGetParameter( request, "dir" );
  +    String logdir    = safeGetParameter( request, "logdir" );
  +    String workdir   = safeGetParameter( request, "workdir" );
  +    String password1 = safeGetParameter( request, "password1" );
  +    String password2 = safeGetParameter( request, "password2" );
  +    String password  = safeGetParameter( request, "password" );
   
       String oldpassword = props.getProperty( "jspwiki.auth.masterPassword", null );
       
  
positive.code:         return s.trim();
      }
      
  	public String setProperty( String propertyfile, String key, String value )
  	{
          int idx = 0;
          
  		while( (idx < propertyfile.length()) && ((idx = propertyfile.indexOf(key,idx)) != -1) )
  		{
              int prevret = propertyfile.lastIndexOf("\n",idx);
              if( prevret != -1 )
              {
  
negative.code:                     continue;
                  }
              }
              int eqsign = propertyfile.indexOf("=",idx);
  			
              if( eqsign != -1 )
              {
                  int ret = propertyfile.indexOf("\n",eqsign);
  				
                  if( ret == -1 ) ret = propertyfile.length();
  				
                  propertyfile = TextUtil.replaceString( propertyfile, eqsign+1, ret, value );
                  
                  return propertyfile;
              }
              // idx += key.length();
          }
  
          //
          //  If it was not found, we'll add it here.
  