mirror of
https://github.com/NNTmux/newznab-tmux.git
synced 2026-08-29 09:18:54 +00:00
Fix wrong check for yydecoderpath
This commit is contained in:
@@ -1,3 +1,5 @@
|
||||
2017-01-24 DariusIII
|
||||
* Fix: Fix wrong check for yydecoderpath
|
||||
2017-01-18 DariusIII
|
||||
* Chg: Prevent undefined index output on nzb-import page
|
||||
* Chg: Add back construct to RequestIDLocal
|
||||
|
||||
@@ -41,8 +41,8 @@ if (defined('NN_INSTALLER') && NN_INSTALLER !== false) {
|
||||
case extension_loaded('simple_php_yenc_decode'):
|
||||
$adapter = 'SimplePhpYencDecode';
|
||||
break;
|
||||
case !empty(Settings::value('..yydecoderpath', true)) &&
|
||||
(strpos(Settings::value('..yydecoderpath', true), 'simple_php_yenc_decode') === false):
|
||||
case !empty(Settings::value('apps..yydecoderpath', true)) &&
|
||||
(strpos(Settings::value('apps..yydecoderpath', true), 'simple_php_yenc_decode') === false):
|
||||
$adapter = 'Ydecode';
|
||||
break;
|
||||
default:
|
||||
|
||||
@@ -43,13 +43,13 @@ class Ydecode extends \lithium\core\Object
|
||||
public static function decode(&$text, $ignore = false)
|
||||
{
|
||||
if (!preg_match('/^(=yBegin.*=yEnd[^$]*)$/ims', $text, $input)) {
|
||||
throw new \Exception('Text does not look like yEnc.');
|
||||
throw new \UnexpectedValueException('Text does not look like yEnc.');
|
||||
}
|
||||
$data = shell_exec(
|
||||
"echo '{$input[1]}' | '" . self::$pathBin . "' -o - " . ($ignore ? "-b " : " ") . self::$silent
|
||||
);
|
||||
if ($data === null) {
|
||||
throw new \Exception('Error getting data from yydecode.');
|
||||
throw new \LengthException('Error getting data from yydecode.');
|
||||
}
|
||||
|
||||
return $data;
|
||||
@@ -79,7 +79,7 @@ class Ydecode extends \lithium\core\Object
|
||||
{
|
||||
parent::_init();
|
||||
|
||||
$path = Settings::value('..yydecoderpath', true);
|
||||
$path = Settings::value('apps..yydecoderpath', true);
|
||||
if (!empty($path) && strpos($path, 'simple_php_yenc_decode') === false) {
|
||||
if (file_exists($path) && is_executable($path)) {
|
||||
self::$silent = (Utility::isWin() ? '' : ' > /dev/null 2>&1');
|
||||
|
||||
Reference in New Issue
Block a user