Skip to content

Commit

Permalink
Merge pull request #1797 from sjinks/1.2.5
Browse files Browse the repository at this point in the history
[1.2.5] Fix #1783
  • Loading branch information
Phalcon committed Jan 13, 2014
2 parents ecc36aa + 8ff66b8 commit a515e84
Show file tree
Hide file tree
Showing 7 changed files with 26 additions and 16 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -481,3 +481,4 @@ ext/mvc/model/query/lemon
ext/mvc/model/query/parser.out
ext/mvc/view/engine/volt/lemon
ext/mvc/view/engine/volt/parser.out
*.d
1 change: 1 addition & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
- Fixed PHP Notices in Phalcon\Debug::onUncaughtException() (#1683)
- Phalcon\Logger\Adapter::commit() clears the queue (#1748)
- Constant-time string comparison in Phalcon\Security::checkHash() (#1755)
- Fix phalcon_escape_multi() to generate valid UTF-8 (#1681)

1.2.4
- Fixed broken ACL inheritance (#905)
Expand Down
10 changes: 6 additions & 4 deletions build/32bits/phalcon.c
Original file line number Diff line number Diff line change
Expand Up @@ -7481,7 +7481,7 @@ static long phalcon_unpack(char *data, int size, int issigned, int *map)
static inline char *phalcon_longtohex(unsigned long value) {

static char digits[] = "0123456789abcdef";
char buf[(sizeof(unsigned long) << 3) + 1];
char buf[(sizeof(unsigned long) << 1) + 1];
char *ptr, *end;

end = ptr = buf + sizeof(buf) - 1;
Expand Down Expand Up @@ -7552,7 +7552,7 @@ static void phalcon_escape_multi(zval *return_value, zval *param, const char *es
RETURN_FALSE;
}

if (value < 256 && isalnum(value)) {
if (value > 32 && value < 127 && isalnum(value)) {
smart_str_appendc(&escaped_str, (unsigned char) value);
continue;
}
Expand Down Expand Up @@ -7584,6 +7584,8 @@ static void phalcon_escape_multi(zval *return_value, zval *param, const char *es
case ';':
case '_':
case '|':
case '~':
case '`':
smart_str_appendc(&escaped_str, (unsigned char) value);
continue;
}
Expand Down Expand Up @@ -79998,7 +80000,7 @@ static PHP_METHOD(Phalcon_Mvc_Collection, save){
MAKE_STD_ZVAL(options);
Z_SET_REFCOUNT_P(options, 0); /* will be automatically destroyed by Zend on return from method call */
array_init_size(options, 1);
add_assoc_bool_ex(options, SS("safe"), 1);
add_assoc_long_ex(options, SS("w"), 1);

PHALCON_INIT_NVAR(status);
phalcon_call_method_p2_key(status, collection, "save", data, options, 274150868UL);
Expand Down Expand Up @@ -80400,7 +80402,7 @@ static PHP_METHOD(Phalcon_Mvc_Collection, delete){

PHALCON_INIT_VAR(options);
array_init_size(options, 1);
add_assoc_bool_ex(options, SS("safe"), 1);
add_assoc_long_ex(options, SS("w"), 1);

PHALCON_INIT_NVAR(status);
phalcon_call_method_p2_key(status, collection, "remove", id_condition, options, 1052443347UL);
Expand Down
10 changes: 6 additions & 4 deletions build/64bits/phalcon.c
Original file line number Diff line number Diff line change
Expand Up @@ -7481,7 +7481,7 @@ static long phalcon_unpack(char *data, int size, int issigned, int *map)
static inline char *phalcon_longtohex(unsigned long value) {

static char digits[] = "0123456789abcdef";
char buf[(sizeof(unsigned long) << 3) + 1];
char buf[(sizeof(unsigned long) << 1) + 1];
char *ptr, *end;

end = ptr = buf + sizeof(buf) - 1;
Expand Down Expand Up @@ -7552,7 +7552,7 @@ static void phalcon_escape_multi(zval *return_value, zval *param, const char *es
RETURN_FALSE;
}

if (value < 256 && isalnum(value)) {
if (value > 32 && value < 127 && isalnum(value)) {
smart_str_appendc(&escaped_str, (unsigned char) value);
continue;
}
Expand Down Expand Up @@ -7584,6 +7584,8 @@ static void phalcon_escape_multi(zval *return_value, zval *param, const char *es
case ';':
case '_':
case '|':
case '~':
case '`':
smart_str_appendc(&escaped_str, (unsigned char) value);
continue;
}
Expand Down Expand Up @@ -79998,7 +80000,7 @@ static PHP_METHOD(Phalcon_Mvc_Collection, save){
MAKE_STD_ZVAL(options);
Z_SET_REFCOUNT_P(options, 0); /* will be automatically destroyed by Zend on return from method call */
array_init_size(options, 1);
add_assoc_bool_ex(options, SS("safe"), 1);
add_assoc_long_ex(options, SS("w"), 1);

PHALCON_INIT_NVAR(status);
phalcon_call_method_p2_key(status, collection, "save", data, options, 210727548372UL);
Expand Down Expand Up @@ -80400,7 +80402,7 @@ static PHP_METHOD(Phalcon_Mvc_Collection, delete){

PHALCON_INIT_VAR(options);
array_init_size(options, 1);
add_assoc_bool_ex(options, SS("safe"), 1);
add_assoc_long_ex(options, SS("w"), 1);

PHALCON_INIT_NVAR(status);
phalcon_call_method_p2_key(status, collection, "remove", id_condition, options, 229481155068627UL);
Expand Down
10 changes: 6 additions & 4 deletions build/safe/phalcon.c
Original file line number Diff line number Diff line change
Expand Up @@ -7481,7 +7481,7 @@ static long phalcon_unpack(char *data, int size, int issigned, int *map)
static inline char *phalcon_longtohex(unsigned long value) {

static char digits[] = "0123456789abcdef";
char buf[(sizeof(unsigned long) << 3) + 1];
char buf[(sizeof(unsigned long) << 1) + 1];
char *ptr, *end;

end = ptr = buf + sizeof(buf) - 1;
Expand Down Expand Up @@ -7552,7 +7552,7 @@ static void phalcon_escape_multi(zval *return_value, zval *param, const char *es
RETURN_FALSE;
}

if (value < 256 && isalnum(value)) {
if (value > 32 && value < 127 && isalnum(value)) {
smart_str_appendc(&escaped_str, (unsigned char) value);
continue;
}
Expand Down Expand Up @@ -7584,6 +7584,8 @@ static void phalcon_escape_multi(zval *return_value, zval *param, const char *es
case ';':
case '_':
case '|':
case '~':
case '`':
smart_str_appendc(&escaped_str, (unsigned char) value);
continue;
}
Expand Down Expand Up @@ -79998,7 +80000,7 @@ static PHP_METHOD(Phalcon_Mvc_Collection, save){
MAKE_STD_ZVAL(options);
Z_SET_REFCOUNT_P(options, 0); /* will be automatically destroyed by Zend on return from method call */
array_init_size(options, 1);
add_assoc_bool_ex(options, SS("safe"), 1);
add_assoc_long_ex(options, SS("w"), 1);

PHALCON_INIT_NVAR(status);
phalcon_call_method_p2(status, collection, "save", data, options);
Expand Down Expand Up @@ -80400,7 +80402,7 @@ static PHP_METHOD(Phalcon_Mvc_Collection, delete){

PHALCON_INIT_VAR(options);
array_init_size(options, 1);
add_assoc_bool_ex(options, SS("safe"), 1);
add_assoc_long_ex(options, SS("w"), 1);

PHALCON_INIT_NVAR(status);
phalcon_call_method_p2(status, collection, "remove", id_condition, options);
Expand Down
6 changes: 4 additions & 2 deletions ext/kernel/filter.c
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ static long phalcon_unpack(char *data, int size, int issigned, int *map)
static inline char *phalcon_longtohex(unsigned long value) {

static char digits[] = "0123456789abcdef";
char buf[(sizeof(unsigned long) << 3) + 1];
char buf[(sizeof(unsigned long) << 1) + 1];
char *ptr, *end;

end = ptr = buf + sizeof(buf) - 1;
Expand Down Expand Up @@ -257,7 +257,7 @@ void phalcon_escape_multi(zval *return_value, zval *param, const char *escape_ch
/**
* Alphanumeric characters are not escaped
*/
if (value < 256 && isalnum(value)) {
if (value > 32 && value < 127 && isalnum(value)) {
smart_str_appendc(&escaped_str, (unsigned char) value);
continue;
}
Expand Down Expand Up @@ -292,6 +292,8 @@ void phalcon_escape_multi(zval *return_value, zval *param, const char *escape_ch
case ';':
case '_':
case '|':
case '~':
case '`':
smart_str_appendc(&escaped_str, (unsigned char) value);
continue;
}
Expand Down
4 changes: 2 additions & 2 deletions ext/mvc/collection.c
Original file line number Diff line number Diff line change
Expand Up @@ -1407,7 +1407,7 @@ PHP_METHOD(Phalcon_Mvc_Collection, save){
MAKE_STD_ZVAL(options);
Z_SET_REFCOUNT_P(options, 0); /* will be automatically destroyed by Zend on return from method call */
array_init_size(options, 1);
add_assoc_bool_ex(options, SS("safe"), 1);
add_assoc_long_ex(options, SS("w"), 1);

/**
* Save the document
Expand Down Expand Up @@ -1941,7 +1941,7 @@ PHP_METHOD(Phalcon_Mvc_Collection, delete){

PHALCON_INIT_VAR(options);
array_init_size(options, 1);
add_assoc_bool_ex(options, SS("safe"), 1);
add_assoc_long_ex(options, SS("w"), 1);

/**
* Remove the instance
Expand Down

0 comments on commit a515e84

Please sign in to comment.