Esempio n. 1
0
  public Object generateContent(PhpWebEnvironment webEnv) throws IOException, ServletException {

    /* Start of block */
    super.startBlock("__wp_pass_block1");
    gVars.webEnv = webEnv;

    /* Condensed dynamic construct: 513604 */ require(gVars, gConsts, Wp_configPage.class);

    if (booleanval(Options.get_magic_quotes_gpc(gVars.webEnv))) {
      gVars.webEnv._POST.putValue(
          "post_password",
          Strings.stripslashes(gVars.webEnv, strval(gVars.webEnv._POST.getValue("post_password"))));
    }

    // 10 days
    Network.setcookie(
        gVars.webEnv,
        "wp-postpass_" + gConsts.getCOOKIEHASH(),
        strval(gVars.webEnv._POST.getValue("post_password")),
        DateTime.time() + 864000,
        gConsts.getCOOKIEPATH());

    getIncluded(PluggablePage.class, gVars, gConsts)
        .wp_safe_redirect(getIncluded(FunctionsPage.class, gVars, gConsts).wp_get_referer(), 302);

    return DEFAULT_VAL;
  }
Esempio n. 2
0
  /**
   * --------------------------------------------------------------------------------
   * --------------------------------------------------------------------------------
   * --------------------------------------------------------------------------------
   * -------------------------------------------------------------------------------- Function :
   * PclZipUtilTranslateWinPath() Function : PclZipUtilTranslateWinPath() Description : Description
   * : Translate windows path by replacing '\' by '/' and optionally removing Translate windows path
   * by replacing '\' by '/' and optionally removing drive letter. drive letter. Parameters :
   * Parameters : $p_path : path to translate. $p_path : path to translate. $p_remove_disk_letter :
   * true | false $p_remove_disk_letter : true | false Return Values : Return Values : The path
   * translated. The path translated.
   * --------------------------------------------------------------------------------
   * --------------------------------------------------------------------------------
   */
  public String PclZipUtilTranslateWinPath(String p_path, boolean p_remove_disk_letter) {
    int v_position = 0;

    if (booleanval(Strings.stristr(Options.php_uname(), "windows"))) /*
         * ----- Look for potential disk letter ----- Look for potential disk
         * letter
         *
         * ----- Change potential windows directory separator ----- Change
         * potential windows directory separator
         */ {
      if (p_remove_disk_letter && !equal(v_position = Strings.strpos(p_path, ":"), false)) {
        p_path = Strings.substr(p_path, v_position + 1);
      }

      if ((Strings.strpos(p_path, "\\") > 0) || equal(Strings.substr(p_path, 0, 1), "\\")) {
        p_path = Strings.strtr(p_path, "\\", "/");
      }
    }

    return p_path;
  }
Esempio n. 3
0
  /**
   * wp_load_image() - Load an image which PHP Supports.
   *
   * @package WordPress
   * @internal Missing Long Description
   * @param string $file Filename of the image to load
   * @return resource The resulting image resource on success, Error string on failure.
   */
  public Object wp_load_image(Object fileObj) {
    int image = 0;

    // Modified by Numiton
    String file;

    if (is_numeric(fileObj)) {
      file =
          strval(
              getIncluded(PostPage.class, gVars, gConsts)
                  .get_attached_file(intval(fileObj), false));
    } else {
      file = strval(fileObj);
    }

    if (!FileSystemOrSocket.file_exists(gVars.webEnv, file)) {
      return QStrings.sprintf(
          getIncluded(L10nPage.class, gVars, gConsts).__("File \'%s\' doesn\'t exist?", "default"),
          file);
    }

    if (!true) /*Modified by Numiton*/ {
      return getIncluded(L10nPage.class, gVars, gConsts)
          .__("The GD image library is not installed.", "default");
    }

    // Set artificially high because GD uses uncompressed images in memory
    Options.ini_set(gVars.webEnv, "memory_limit", "256M");
    image =
        Image.imagecreatefromstring(
            gVars.webEnv, FileSystemOrSocket.file_get_contents(gVars.webEnv, file));

    if (!is_resource(image)) {
      return QStrings.sprintf(
          getIncluded(L10nPage.class, gVars, gConsts).__("File \'%s\' is not an image.", "default"),
          file);
    }

    return image;
  }