Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Comparing changes

Choose two branches to see what's changed or to start a new pull request. If you need to, you can also compare across forks.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also compare across forks.
base fork: cataphract/php-rar
base: master
...
head fork: cataphract/php-rar
compare: ext-v0.1
Checking mergeability… Don't worry, you can still create the pull request.
  • 2 commits
  • 4 files changed
  • 0 commit comments
  • 1 contributor
Showing with 26 additions and 18 deletions.
  1. +2 −2 config.w32
  2. +6 −16 rar.cpp
  3. +6 −0 unrar/rdwrfn.cpp
  4. +12 −0 unrar/volume.cpp
View
4 config.w32
@@ -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");
View
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;
View
6 unrar/rdwrfn.cpp
@@ -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
12 unrar/volume.cpp
@@ -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);
}

No commit comments for this range

Something went wrong with that request. Please try again.