Examples of sanitize()


Examples of com.google.caja.plugin.templates.TemplateSanitizer.sanitize()

    MessageQueue mq = jobs.getMessageQueue();

    TemplateSanitizer ts = new TemplateSanitizer(htmlSchema, mq);
    for (IhtmlRoot ihtmlRoot : html) {
      ts.sanitize(ihtmlRoot.root);
    }

    TemplateCompiler tc = new TemplateCompiler(
        html, css, js, cssSchema, htmlSchema,
        jobs.getPluginMeta(), jobs.getMessageContext(), mq);
View Full Code Here

Examples of com.google.caja.plugin.templates.TemplateSanitizer.sanitize()

        htmlSchema, jobs.getMessageQueue());

    boolean valid = true;
    for (JobEnvelope env : jobs.getJobsByType(ContentType.HTML)) {
      if (env.fromCache) { continue; }
      if (!s.sanitize(((Dom) env.job.getRoot()).getValue())) {
        valid = false;
        // Keep going so that we can display error messages for all inputs.
      }
    }
    return valid;
View Full Code Here

Examples of com.google.caja.plugin.templates.TemplateSanitizer.sanitize()

    MessageQueue mq = jobs.getMessageQueue();

    TemplateSanitizer ts = new TemplateSanitizer(htmlSchema, mq);
    for (IhtmlRoot ihtmlRoot : html) {
      ts.sanitize(ihtmlRoot.root);
    }

    TemplateCompiler tc = new TemplateCompiler(
        html, css, js, cssSchema, htmlSchema,
        jobs.getPluginMeta(), jobs.getMessageContext(), mq);
View Full Code Here

Examples of com.jolbox.bonecp.BoneCPDataSource.sanitize()

      BoneCPDataSource ds = new BoneCPDataSource();
      ds.setJdbcUrl("jdbc:postgresql://localhost/postgres");
      ds.setUsername("postgres");
      ds.setPassword("postgres");
      ds.setDefaultAutoCommit(false);
      ds.sanitize();

      System.out.println("Initial connection test");
      testConnection(ds);

      System.out.println("Unplug your network cable ");
View Full Code Here

Examples of org.apache.myfaces.tobago.sanitizer.Sanitizer.sanitize()

      }
    } else { // escape="false"
      writer.writeText("", null); // to ensure the closing > of the <span> start tag.
      if ("auto".equals(out.getSanitize())) {
        final Sanitizer sanitizer = TobagoConfig.getInstance(facesContext).getSanitizer();
        text = sanitizer.sanitize(text);
      }
      writer.write(text);
    }
    if (createSpan) {
      writer.endElement(HtmlElements.SPAN);
View Full Code Here

Examples of org.apache.myfaces.tobago.sanitizer.Sanitizer.sanitize()

      }
    } else { // escape="false"
      writer.writeText("", null); // to ensure the closing > of the <span> start tag.
      if ("auto".equals(out.getSanitize())) {
        final Sanitizer sanitizer = TobagoConfig.getInstance(facesContext).getSanitizer();
        text = sanitizer.sanitize(text);
      }
      writer.write(text);
    }
    if (createSpan) {
      writer.endElement(HtmlElements.SPAN);
View Full Code Here

Examples of org.apache.myfaces.tobago.sanitizer.Sanitizer.sanitize()

      if (input instanceof UITextarea) {
        UITextarea textarea = (UITextarea) input;
        if (ComponentUtils.getDataAttribute(input, "html-editor") != null
            && "auto".equals(textarea.getSanitize())) {
          final Sanitizer sanitizer = TobagoConfig.getInstance(facesContext).getSanitizer();
          newValue = sanitizer.sanitize(newValue);
        }
      }

      input.setSubmittedValue(newValue);
    }
View Full Code Here

Examples of org.apache.myfaces.tobago.sanitizer.Sanitizer.sanitize()

    String currentValue = RenderUtils.currentValue(input);
    if (currentValue != null) {
      if (ComponentUtils.getDataAttribute(input, "html-editor") != null
          && "auto".equals(input.getSanitize())) {
        final Sanitizer sanitizer = TobagoConfig.getInstance(facesContext).getSanitizer();
        currentValue = sanitizer.sanitize(currentValue);
      }
      // this is because browsers eat the first CR+LF of <textarea>
      if (currentValue.startsWith("\r\n")) {
        currentValue = "\r\n" + currentValue;
      } else if (currentValue.startsWith("\n")) {
View Full Code Here

Examples of org.jboss.as.jdr.util.PatternSanitizer.sanitize()

    @Test
    public void testPatternSanitizer() throws Exception {
        String propf = "password=123456";
        InputStream is = new ByteArrayInputStream(propf.getBytes());
        PatternSanitizer s = new PatternSanitizer("password=.*", "password=*", Filters.TRUE);
        InputStream res = s.sanitize(is);
        byte [] buf = new byte [res.available()];
        res.read(buf);
        assertEquals("password=*", new String(buf));
    }

View Full Code Here

Examples of org.jboss.as.jdr.util.XMLSanitizer.sanitize()

    @Test
    public void testXMLSanitizer() throws Exception {
        String xml = "<test><password>foobar</password></test>";
        InputStream is = new ByteArrayInputStream(xml.getBytes());
        XMLSanitizer s = new XMLSanitizer("//password", Filters.TRUE);
        InputStream res = s.sanitize(is);
        byte [] buf = new byte [res.available()];
        res.read(buf);
        assertEquals("<?xml version=\"1.0\" encoding=\"UTF-8\"?><test><password/></test>", new String(buf));
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.