byId($dirIdOfHtaccess)->getAbsPath() . '/' . $sourceRelHtaccess; return $source; } private static function getSource() { if (self::$usingDocRoot) { $source = self::getSourceDocRoot(); } else { $source = self::getSourceNoDocRoot(); } return $source; } private static function processRequestNoTryCatch() { self::loadConfig(); $options = self::$options; $wodOptions = self::$wodOptions; $serveOptions = $options['webp-convert']; $convertOptions = &$serveOptions['convert']; //echo '
' . print_r($wodOptions, true) . ''; exit; // Validate that WebPExpress was configured to redirect to this conversion script // (but do not require that for Nginx) // ------------------------------------------------------------------------------ self::$checking = 'settings'; if (stripos($_SERVER["SERVER_SOFTWARE"], 'nginx') === false) { if (!isset($wodOptions['enable-redirection-to-converter']) || ($wodOptions['enable-redirection-to-converter'] === false)) { throw new ValidateException('Redirection to conversion script is not enabled'); } } // Check source (the image to be converted) // -------------------------------------------- self::$checking = 'source'; // Decode URL in case file contains encoded symbols (#413) $source = urldecode(self::getSource()); //self::exitWithError($source); $imageRoots = self::getImageRootsDef(); // Get upload dir $uploadDirAbs = $imageRoots->byId('uploads')->getAbsPath(); // Check destination path // -------------------------------------------- self::$checking = 'destination path'; $destination = ConvertHelperIndependent::getDestination( $source, $wodOptions['destination-folder'], $wodOptions['destination-extension'], self::$webExpressContentDirAbs, $uploadDirAbs, self::$usingDocRoot, self::getImageRootsDef() ); //$destination = SanityCheck::absPathIsInDocRoot($destination); $destination = SanityCheck::pregMatch('#\.webp$#', $destination, 'Does not end with .webp'); //self::exitWithError($destination); // Done with sanitizing, lets get to work! // --------------------------------------- if (isset($wodOptions['success-response']) && ($wodOptions['success-response'] == 'original')) { $serveOptions['serve-original'] = true; $serveOptions['serve-image']['headers']['vary-accept'] = false; } else { $serveOptions['serve-image']['headers']['vary-accept'] = true; } //echo $source . '