2 Commits

Author SHA1 Message Date
cvs2svn
73e2b159aa This commit was manufactured by cvs2svn to create tag 'RELEASE_0_1'.
git-svn-id: http://svn.php.net/repository/pecl/rar/tags/RELEASE_0_1@163350 c90b9560-bf6c-de11-be94-00142212c4b1
2004-07-15 06:43:09 +00:00
cvs2svn
c15a6caa67 This commit was manufactured by cvs2svn to create branch 'PECL_4_3'.
git-svn-id: http://svn.php.net/repository/pecl/rar/branches/PECL_4_3@163349 c90b9560-bf6c-de11-be94-00142212c4b1
2004-07-15 06:43:08 +00:00
4 changed files with 26 additions and 18 deletions

View File

@@ -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
View File

@@ -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;

View File

@@ -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);
}

View File

@@ -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);
}