mirror of
https://github.com/php-win-ext/php-rar.git
synced 2026-03-24 04:52:07 +01:00
Compare commits
1 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
73e2b159aa |
@@ -5,7 +5,7 @@ ARG_ENABLE("rar", "Rar support", "no");
|
||||
|
||||
if (PHP_RAR != "no") {
|
||||
EXTENSION("rar", "rar.cpp");
|
||||
ADD_SOURCES(configure_module_dirname + "/unrar/", "rar.cpp \
|
||||
ADD_SOURCES(configure_module_dirname + "unrar/", "rar.cpp \
|
||||
strlist.cpp strfn.cpp pathfn.cpp int64.cpp \
|
||||
savepos.cpp global.cpp file.cpp filefn.cpp \
|
||||
filcreat.cpp archive.cpp arcread.cpp unicode.cpp \
|
||||
@@ -19,7 +19,7 @@ if (PHP_RAR != "no") {
|
||||
scantree.cpp", "rar");
|
||||
|
||||
if (!PHP_RAR_SHARED) {
|
||||
ADD_DEF_FILE(configure_module_dirname + "\\unrar\\dll.def");
|
||||
ADD_DEF_FILE(configure_module_dirname + "unrar\\dll.def");
|
||||
}
|
||||
|
||||
AC_DEFINE("HAVE_RAR", 1, "Rar support");
|
||||
|
||||
22
rar.cpp
22
rar.cpp
@@ -26,6 +26,7 @@
|
||||
|
||||
/* $Id$ */
|
||||
|
||||
extern "C" {
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#include "config.h"
|
||||
#endif
|
||||
@@ -33,6 +34,7 @@
|
||||
#include "php.h"
|
||||
#include "php_ini.h"
|
||||
#include "ext/standard/info.h"
|
||||
}
|
||||
|
||||
#if HAVE_RAR
|
||||
extern "C" {
|
||||
@@ -334,10 +336,6 @@ PHP_FUNCTION(rar_open)
|
||||
|
||||
convert_to_string_ex(filename);
|
||||
|
||||
if (PG(safe_mode) && (!php_checkuid(Z_STRVAL_PP(filename), NULL, CHECKUID_CHECK_FILE_AND_DIR))) {
|
||||
RETURN_FALSE;
|
||||
}
|
||||
|
||||
if (php_check_open_basedir(Z_STRVAL_PP(filename) TSRMLS_CC)) {
|
||||
RETURN_FALSE;
|
||||
}
|
||||
@@ -385,7 +383,7 @@ PHP_FUNCTION(rar_list)
|
||||
WRONG_PARAM_COUNT;
|
||||
}
|
||||
|
||||
if (!_rar_get_file_resource(file,&rar TSRMLS_CC)) {
|
||||
if (!_rar_get_file_resource(file,&rar)) {
|
||||
RETURN_FALSE;
|
||||
}
|
||||
|
||||
@@ -429,7 +427,7 @@ PHP_FUNCTION(rar_entry_get)
|
||||
WRONG_PARAM_COUNT;
|
||||
}
|
||||
|
||||
if (!_rar_get_file_resource(file,&rar TSRMLS_CC)) {
|
||||
if (!_rar_get_file_resource(file,&rar)) {
|
||||
RETURN_FALSE;
|
||||
}
|
||||
|
||||
@@ -468,7 +466,7 @@ PHP_FUNCTION(rar_close)
|
||||
WRONG_PARAM_COUNT;
|
||||
}
|
||||
|
||||
if (!_rar_get_file_resource(file,&rar TSRMLS_CC)) {
|
||||
if (!_rar_get_file_resource(file,&rar)) {
|
||||
RETURN_FALSE;
|
||||
}
|
||||
|
||||
@@ -504,21 +502,13 @@ PHP_METHOD(rarentry, extract)
|
||||
convert_to_string_ex(path);
|
||||
path_str = Z_STRVAL_PP(path);
|
||||
|
||||
if (Z_STRLEN_PP(path) && PG(safe_mode) && (!php_checkuid(Z_STRVAL_PP(path), NULL, CHECKUID_CHECK_FILE_AND_DIR))) {
|
||||
RETURN_FALSE;
|
||||
}
|
||||
|
||||
if (Z_STRLEN_PP(path) && php_check_open_basedir(Z_STRVAL_PP(path) TSRMLS_CC)) {
|
||||
if (php_check_open_basedir(Z_STRVAL_PP(path) TSRMLS_CC)) {
|
||||
RETURN_FALSE;
|
||||
}
|
||||
|
||||
if (ac == 2) {
|
||||
convert_to_string_ex(filename);
|
||||
extract_to_file = Z_STRVAL_PP(filename);
|
||||
|
||||
if (PG(safe_mode) && (!php_checkuid(Z_STRVAL_PP(filename), NULL, CHECKUID_CHECK_FILE_AND_DIR))) {
|
||||
RETURN_FALSE;
|
||||
}
|
||||
|
||||
if (php_check_open_basedir(Z_STRVAL_PP(filename) TSRMLS_CC)) {
|
||||
RETURN_FALSE;
|
||||
|
||||
@@ -118,7 +118,13 @@ void ComprDataIO::UnpWrite(byte *Addr,uint Count)
|
||||
ErrHandler.Exit(RAR_USER_BREAK);
|
||||
if (Cmd->ProcessDataProc!=NULL)
|
||||
{
|
||||
#ifdef _WIN_32
|
||||
_EBX=_ESP;
|
||||
#endif
|
||||
int RetCode=Cmd->ProcessDataProc(Addr,Count);
|
||||
#ifdef _WIN_32
|
||||
_ESP=_EBX;
|
||||
#endif
|
||||
if (RetCode==0)
|
||||
ErrHandler.Exit(RAR_USER_BREAK);
|
||||
}
|
||||
|
||||
@@ -56,7 +56,13 @@ bool MergeArchive(Archive &Arc,ComprDataIO *DataIO,bool ShowFileName,char Comman
|
||||
}
|
||||
if (Cmd->ChangeVolProc!=NULL)
|
||||
{
|
||||
#ifdef _WIN_32
|
||||
_EBX=_ESP;
|
||||
#endif
|
||||
int RetCode=Cmd->ChangeVolProc(NextName,RAR_VOL_ASK);
|
||||
#ifdef _WIN_32
|
||||
_ESP=_EBX;
|
||||
#endif
|
||||
if (RetCode==0)
|
||||
{
|
||||
Cmd->DllError=ERAR_EOPEN;
|
||||
@@ -106,7 +112,13 @@ bool MergeArchive(Archive &Arc,ComprDataIO *DataIO,bool ShowFileName,char Comman
|
||||
return(false);
|
||||
if (Cmd->ChangeVolProc!=NULL)
|
||||
{
|
||||
#ifdef _WIN_32
|
||||
_EBX=_ESP;
|
||||
#endif
|
||||
int RetCode=Cmd->ChangeVolProc(NextName,RAR_VOL_NOTIFY);
|
||||
#ifdef _WIN_32
|
||||
_ESP=_EBX;
|
||||
#endif
|
||||
if (RetCode==0)
|
||||
return(false);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user