Package freenet.client.filter

Examples of freenet.client.filter.HTMLFilter$MetaTagVerifier


    byte[] bufUTF16 = alt.getBytes("UTF-16");
    byte[] total = new byte[buf.length+utf16bom.length+bufUTF16.length];
    System.arraycopy(utf16bom, 0, total, 0, utf16bom.length);
    System.arraycopy(buf, 0, total, utf16bom.length, buf.length);
    System.arraycopy(bufUTF16, 0, total, utf16bom.length+buf.length, bufUTF16.length);
    HTMLFilter filter = new HTMLFilter();
    boolean failed = false;
    FileOutputStream fos;
    try {
      ArrayBucket out = new ArrayBucket();
      filter.readFilter(new ArrayBucket(total).getInputStream(), out.getOutputStream(), "UTF-16", null, null);
      fos = new FileOutputStream("output.utf16");
      fos.write(out.toByteArray());
      fos.close();
      failed = true;
      assertFalse("Filter accepted dangerous UTF8 text with BOM as UTF16! (HTMLFilter)", true);
View Full Code Here


    byte[] bufUTF16 = alt.getBytes("UTF-16");
    byte[] total = new byte[buf.length+utf16bom.length+bufUTF16.length];
    System.arraycopy(utf16bom, 0, total, 0, utf16bom.length);
    System.arraycopy(buf, 0, total, utf16bom.length, buf.length);
    System.arraycopy(bufUTF16, 0, total, utf16bom.length+buf.length, bufUTF16.length);
    HTMLFilter filter = new HTMLFilter();
    boolean failed = false;
    FileOutputStream fos;
    try {
      ArrayBucket out = new ArrayBucket();
      filter.readFilter(new ArrayBucket(total).getInputStream(), out.getOutputStream(), "UTF-16", null, null);
      fos = new FileOutputStream("output.utf16");
      fos.write(out.toByteArray());
      fos.close();
      failed = true;
      assertFalse("Filter accepted dangerous UTF8 text with BOM as UTF16! (HTMLFilter)", true);
View Full Code Here

    HTMLFilter filter;
    HTMLFilter.HTMLParseContext pc;

    @Override
    public void setUp() throws Exception {
      filter = new HTMLFilter();
      attributes = new LinkedHashMap<String, String>();
      pc = filter.new HTMLParseContext(null, null, "utf-8", new GenericReadFilterCallback(new URI(ALT_BASE_URI), null, null, null), false);
    }
View Full Code Here

    HTMLFilter filter;
    HTMLFilter.HTMLParseContext pc;

    @Override
    public void setUp() throws Exception {
      filter = new HTMLFilter();
      attributes = new LinkedHashMap<String, String>();
      pc = filter.new HTMLParseContext(null, null, "utf-8", new GenericReadFilterCallback(new URI(ALT_BASE_URI), null, null, null), false);
    }
View Full Code Here

TOP

Related Classes of freenet.client.filter.HTMLFilter$MetaTagVerifier

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.