Permalink
Browse files

Merge branch '1.0.1' of https://github.com/phalcon/cphalcon into 1.0.1

  • Loading branch information...
2 parents 1404cc6 + 0aa48d8 commit a81431f74934e279b1ef1284edf9b593b554f414 phalcon committed Apr 6, 2013
Showing with 13 additions and 10 deletions.
  1. +12 −8 build/64bits/phalcon.c
  2. +1 −2 ext/validation/validator/stringlength.c
View
@@ -1834,24 +1834,27 @@ int phalcon_get_global(zval **arr, char *global, unsigned int global_length TSRM
zend_bool jit_initialization = PG(auto_globals_jit);
if (jit_initialization) {
- zend_is_auto_global(global, global_length-1 TSRMLS_CC);
+ zend_is_auto_global(global, global_length - 1 TSRMLS_CC);
}
if (&EG(symbol_table)) {
if( zend_hash_find(&EG(symbol_table), global, global_length, (void **) &gv) == SUCCESS) {
if (Z_TYPE_PP(gv) == IS_ARRAY) {
*arr = *gv;
+ if (!*arr) {
+ PHALCON_INIT_VAR(*arr);
+ array_init(*arr);
+ }
} else {
PHALCON_INIT_VAR(*arr);
array_init(*arr);
}
+ return SUCCESS;
}
}
- if (!*arr) {
- PHALCON_INIT_VAR(*arr);
- array_init(*arr);
- }
+ PHALCON_INIT_VAR(*arr);
+ array_init(*arr);
return SUCCESS;
}
@@ -9461,12 +9464,12 @@ int PHALCON_FASTCALL phalcon_internal_require(zval *return_value, zval *require_
} else {
file_path = Z_STRVAL_P(require_path);
- file_path_length = Z_STRLEN_P(require_path);
ret = php_stream_open_for_zend_ex(file_path, &file_handle, ENFORCE_SAFE_MODE|USE_PATH|STREAM_OPEN_FOR_INCLUDE TSRMLS_CC);
if (ret == SUCCESS) {
if (!file_handle.opened_path) {
+ file_path_length = Z_STRLEN_P(require_path);
file_handle.opened_path = estrndup(file_path, file_path_length);
}
@@ -9478,16 +9481,17 @@ int PHALCON_FASTCALL phalcon_internal_require(zval *return_value, zval *require_
char realfile[MAXPATHLEN];
int realfile_len;
dummy = 1;
- if(expand_filepath(file_handle.filename, realfile TSRMLS_CC)){
+ if (expand_filepath(file_handle.filename, realfile TSRMLS_CC)) {
realfile_len = strlen(realfile);
- zend_hash_add(&EG(included_files), realfile, realfile_len+1, (void *)&dummy, sizeof(int), NULL);
+ zend_hash_add(&EG(included_files), realfile, realfile_len + 1, (void *)&dummy, sizeof(int), NULL);
file_handle.opened_path = estrndup(realfile, realfile_len);
}
}
}
if (!dummy) {
if (file_handle.opened_path) {
+ file_path_length = strlen(file_handle.opened_path);
zend_hash_add(&EG(included_files), file_handle.opened_path, file_path_length + 1, (void *)&dummy, sizeof(int), NULL);
}
}
@@ -1,4 +1,3 @@
-
/*
+------------------------------------------------------------------------+
| Phalcon Framework |
@@ -46,7 +45,7 @@
*<code>
*use Phalcon\Validation\Validator\StringLength as StringLength;
*
- *$validation->validate('name_last', new StringLength(array(
+ *$validation->add('name_last', new StringLength(array(
* 'max' => 50,
* 'min' => 2,
* 'messageMaximum' => 'We don't like really long names',

0 comments on commit a81431f

Please sign in to comment.