Development

Changeset 10004

You must first sign up to be able to contribute.

Changeset 10004

Show
Ignore:
Timestamp:
06/30/08 04:38:04 (5 years ago)
Author:
dwhittle
Message:

dwhittle: merged changes to branch

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • branches/dwhittle/1.0/CHANGELOG

    r8964 r10004  
    1 Version 1.0.17PRE 
    2 ------------- 
    3  
    4 This is a bug fix release. 
    5  
     1Version 1.0.18PRE 
     2------------- 
     3 
     4This is a bug fix release. 
     5 
     6Version 1.0.17 
     7------------- 
     8 
     9This is a bug fix release. 
     10 
     11* r9969: changed escaping of metas (and title) from htmlspecialchars to htmlentities to preserve intended encoding. fixes #2860. 
     12* r9959: fixed gpc_magic_qutes and array in cookie (closes #3458). 
     13* r9957: fixed convertUrlStringToParameters breaks urlencoded parameter (closes #3788). 
     14* r9892: fixed PHPMailer issue with UTF-8 subject being wrapped in middle of utf-8 char. fixes #2957. 
     15* r9861: fixed getColumnFilterTag() component type (closes #2861). 
     16* r9855: fixed generated admin returning to first page regardless on which page the edit was started. fixes #1280. 
     17* r9829: backported encoding fix for MySQLiConnection from creole trac. fixes #3017. 
     18* r9806: fixed i18n XLIFF do not handle entities correctly (closes #3792). 
     19* r9784: fixed autoload paths on windows (closes #1485). 
     20* r9668: fixed sfBrowser does not create DOMDocument when response is text/xml (closes #3766). 
     21* r9538: fixed sfFillInForm to work correctly with nested arrays like: article[description][]. 
     22* r9260: fixed cache corruption in the production environment for admin generated content. 
     23* r9216: fillin: fixed bug with html documents having extra attributes in head tag. 
     24* r9209: added third mode for fillin xhtml, same as xml but without prolog (+test). fixes #3568. 
     25* r9182: fixed phpmailer EOL line style using now PHP_EOL constant. fixes #3313 #3562. 
     26* r9177: 1.0: backported fix from r8926. fixes #2161. 
     27
    628Version 1.0.16 
    729------------- 
  • branches/dwhittle/1.0/lib/VERSION

    r8964 r10004  
    1 1.0.17-PRE 
     11.0.18-PRE 
  • branches/dwhittle/1.0/lib/config/sfViewConfigHandler.class.php

    r6598 r10004  
    227227    foreach ($this->mergeConfigValue('metas', $viewName) as $name => $content) 
    228228    { 
    229       $data[] = sprintf("  \$response->addMeta('%s', '%s', false, false);", $name, str_replace('\'', '\\\'', preg_replace('/&(?=\w+;)/', '&', htmlentities($content, ENT_QUOTES, sfConfig::get('sf_charset'))))); 
     229      $data[] = sprintf("  \$response->addMeta('%s', '%s', false, false);", $name, str_replace('\'', '\\\'', preg_replace('/&(?=\w+;)/', '&', htmlspecialchars($content, ENT_QUOTES, sfConfig::get('sf_charset'))))); 
    230230    } 
    231231 
  • branches/dwhittle/1.0/lib/controller/sfWebController.class.php

    r7797 r10004  
    188188      foreach ($matches as $match) 
    189189      { 
    190         $params[$match[1][0]] = $match[2][0]
     190        $params[urldecode($match[1][0])] = urldecode($match[2][0])
    191191      } 
    192192 
  • branches/dwhittle/1.0/lib/request/sfWebRequest.class.php

    r9838 r10004  
    790790    $pathArray = $this->getPathInfoArray(); 
    791791 
    792     return isset($pathArray[$name]) ? stripslashes($pathArray[$name]) : null; 
     792    return isset($pathArray[$name]) ? sfToolkit::stripslashesDeep($pathArray[$name]) : null; 
    793793  } 
    794794 
     
    804804    if (isset($_COOKIE[$name])) 
    805805    { 
    806       $retval = get_magic_quotes_gpc() ? stripslashes($_COOKIE[$name]) : $_COOKIE[$name]; 
     806      $retval = get_magic_quotes_gpc() ? sfToolkit::stripslashesDeep($_COOKIE[$name]) : $_COOKIE[$name]; 
    807807    } 
    808808 
  • branches/dwhittle/1.0/lib/response/sfWebResponse.class.php

    r6992 r10004  
    472472    if ($escape) 
    473473    { 
    474       $value = htmlentities($value, ENT_QUOTES, sfConfig::get('sf_charset')); 
     474      $value = htmlspecialchars($value, ENT_QUOTES, sfConfig::get('sf_charset')); 
    475475    } 
    476476 
  • branches/dwhittle/1.0/lib/util/sfToolkit.class.php

    r9563 r10004  
    447447  } 
    448448 
    449   public static function &getArrayValueForPath(&$values, $name, $default = null) 
     449  public static function &getArrayValueForPathByRef(&$values, $name, $default = null) 
    450450  { 
    451451    if (false !== ($offset = strpos($name, '['))) 
     
    468468          } 
    469469          $array = &$array[substr($name, $pos + 1, $end - $pos - 1)]; 
     470          $offset = $end; 
     471        } 
     472 
     473        return $array; 
     474      } 
     475    } 
     476 
     477    return $default; 
     478  } 
     479 
     480  public static function getArrayValueForPath($values, $name, $default = null) 
     481  { 
     482    if (false !== ($offset = strpos($name, '['))) 
     483    { 
     484      if (isset($values[substr($name, 0, $offset)])) 
     485      { 
     486        $array = $values[substr($name, 0, $offset)]; 
     487 
     488        while ($pos = strpos($name, '[', $offset)) 
     489        { 
     490          $end = strpos($name, ']', $pos); 
     491          if ($end == $pos + 1) 
     492          { 
     493            // reached a [] 
     494            break; 
     495          } 
     496          else if (!isset($array[substr($name, $pos + 1, $end - $pos - 1)])) 
     497          { 
     498            return $default; 
     499          } 
     500          $array = $array[substr($name, $pos + 1, $end - $pos - 1)]; 
    470501          $offset = $end; 
    471502        } 
  • branches/dwhittle/1.0/test/unit/controller/sfWebControllerTest.php

    r6598 r10004  
    1212require_once($_test_dir.'/unit/sfContextMock.class.php'); 
    1313 
    14 $t = new lime_test(17, new lime_output_color()); 
     14$t = new lime_test(18, new lime_output_color()); 
    1515 
    1616sfConfig::set('sf_max_forwards', 10); 
     
    125125    ), 
    126126  ), 
     127  '@test?id=foo%26bar&foo=bar%3Dfoo' => array( 
     128    'test', 
     129    array( 
     130      'id' => 'foo&bar', 
     131      'foo' => 'bar=foo', 
     132    ), 
     133  ), 
    127134); 
    128135 
  • branches/dwhittle/1.0/test/unit/response/sfWebResponseTest.php

    r6795 r10004  
    1212require_once($_test_dir.'/unit/sfContextMock.class.php'); 
    1313 
    14 $t = new lime_test(65, new lime_output_color()); 
     14$t = new lime_test(66, new lime_output_color()); 
    1515 
    1616class myWebResponse extends sfWebResponse 
     
    129129$response->setTitle('my title'); 
    130130$t->is($response->getTitle(), 'my title', '->setTitle() sets the title'); 
     131$response->setTitle('fööbäär'); 
     132$t->is($response->getTitle(), 'fööbäär', '->setTitle() will leave encoding intact'); 
    131133 
    132134// ->addHttpMeta() 
  • branches/dwhittle/1.1/CHANGELOG

    r9515 r10004  
     1Version 1.1.0 
     2------------- 
     3 
     4* Fixed gpc_magic_qutes and array in cookie 
     5* Fixed convertUrlStringToParameters breaks urlencoded parameter 
     6* Fixed 404 page when raised by a non existant route 
     7* Fixed sfForm::toString() silence exceptions 
     8* Added sfSession::regenerate and added calls on authentication/credential change to protect against session fixation attacks 
     9* Fixed addSortCriteria case sensitive problem 
     10* Added the widget when calling the formatter for the sfWidgetDormSelectRadio widget 
     11* Added debug output from Phing when using -t 
     12* Fixed genurl() with relative_url_root parameter set 
     13* Fixed m2m propel data loading 
     14* Added a min and a max option for sfValidatorDate 
     15* Fixed PHPMailer issue with UTF-8 subject being wrapped in middle of utf-8 char 
     16* Fixed locking issues with the cache:clear, project:disable, project:enable, and log:rotate tasks 
     17* Fixed Propel behavior registration when using functional tests or built-in tasks 
     18* Added a retry mechanism to sfMessageSource_XLIFF->save() that will recreate incorrect xml files 
     19* Renamed sfForm::getFormField() to sfForm::getFormFieldSchema() 
     20* Fixed getColumnFilterTag() component type 
     21* Fixed identifier name length check for Propel Generator 
     22* Fixed CRUD templates when using the --with-show option  
     23* Fixed generated admin returning to first page regardless on which page the edit was started 
     24* Fixed I18N timestamp handling 
     25* Added generation of a .zip file when creating a sandbox 
     26* Added sfValidatorTime 
     27* sfWebRequest->isSecure now recognizes HTTP_SSL_HTTPS 
     28* Fixed issue with incorrect calculation of uri prefix 
     29* Fixed i18n XLIFF do not handle entities correctly 
     30* Fixed sfMemcacheCache ignores multi-memcache-server configuration and defaults to localhost 
     31* Fixed symfony 1.1 task argument value of 0 
     32* Fixed error reporting value for the test environment and added a migration task 
     33* Re-added getCurrentRouteName to sfPatternRouting class 
     34* Fixed autoload paths on windows 
     35* Added extension depedencies to pear package 
     36* Disabled the autoloadAgain feature 
     37* Removed noXSD attribute from Propel 
     38* Fixed I18N-Bug in form_error() helper 
     39* Fixed custom schema for plugins are not found in Win32 environments 
     40* Added a throw_global_error to sfPropelValidatorUnique 
     41* Fixed session database storage classes 
     42* Fixed sfValidatorDate 
     43* Fixed propel:build-forms when using behaviors 
     44 
    145Version 1.1.0 RC2 
    246------------------ 
  • branches/dwhittle/1.1/lib/autoload/sfCoreAutoload.class.php

    r9838 r10004  
    1212 * The current symfony version. 
    1313 */ 
    14 define('SYMFONY_VERSION', '1.1.0-DEV'); 
     14define('SYMFONY_VERSION', '1.1.1-DEV'); 
    1515 
    1616/** 
  • branches/dwhittle/1.1/lib/controller/sfWebController.class.php

    r9949 r10004  
    168168      foreach ($matches as $match) 
    169169      { 
    170         $params[$match[1][0]] = $match[2][0]
     170        $params[urldecode($match[1][0])] = urldecode($match[2][0])
    171171      } 
    172172 
  • branches/dwhittle/1.1/lib/helper/FormHelper.php

    r9515 r10004  
    298298 * Returns a <select> tag populated with all the currencies in the world (or almost). 
    299299 * 
    300  * The select_currency_tag builds off the traditional select_tag function, and is conveniently populated with  
    301  * all the currencies in the world (sorted alphabetically). Each option in the list has a three character  
    302  * currency code for its value and the currency's name as its display title.  The currency data is  
    303  * retrieved via the sfCultureInfo class, which stores a wide variety of i18n and i10n settings for various  
     300 * The select_currency_tag builds off the traditional select_tag function, and is conveniently populated with 
     301 * all the currencies in the world (sorted alphabetically). Each option in the list has a three character 
     302 * currency code for its value and the currency's name as its display title.  The currency data is 
     303 * retrieved via the sfCultureInfo class, which stores a wide variety of i18n and i10n settings for various 
    304304 * countries and cultures throughout the world. Here's an example of an <option> tag generated by the select_currency_tag: 
    305305 * 
     
    316316 * </code> 
    317317 * 
    318  * @param  string $name      field name  
     318 * @param  string $name      field name 
    319319 * @param  string $selected  selected field value (threecharacter currency code) 
    320320 * @param  array  $options   additional HTML compliant <select> tag parameters 
     
    330330  $currency_option = _get_option($options, 'currencies'); 
    331331  $display_option = _get_option($options, 'display'); 
    332    
     332 
    333333  foreach ($currencies as $key => $value) 
    334334  { 
     
    961961} 
    962962 
    963 /** 
    964  * Returns a formatted ID based on the <i>$name</i> parameter and optionally the <i>$value</i> parameter. 
    965  * 
    966  * This function determines the proper form field ID name based on the parameters. If a form field has an 
    967  * array value as a name we need to convert them to proper and unique IDs like so: 
    968  * <samp> 
    969  *  name[] => name (if value == null) 
    970  *  name[] => name_value (if value != null) 
    971  *  name[bob] => name_bob 
    972  *  name[item][total] => name_item_total 
    973  * </samp> 
    974  * 
    975  * <b>Examples:</b> 
    976  * <code> 
    977  *  echo get_id_from_name('status[]', '1'); 
    978  * </code> 
    979  * 
    980  * @param  string $name   field name 
    981  * @param  string $value  field value 
    982  * 
    983  * @return string <select> tag populated with all the languages in the world. 
    984  */ 
    985 function get_id_from_name($name, $value = null) 
    986 { 
    987   // check to see if we have an array variable for a field name 
    988   if (strstr($name, '[')) 
    989   { 
    990     $name = str_replace(array('[]', '][', '[', ']'), array((($value != null) ? '_'.$value : ''), '_', '_', ''), $name); 
    991   } 
    992  
    993   return $name; 
    994 } 
    995  
    996  
    997 /** 
    998  * Converts specific <i>$options</i> to their correct HTML format 
    999  * 
    1000  * @param  array $options 
    1001  * @return array returns properly formatted options 
    1002  */ 
    1003 function _convert_options($options) 
    1004 { 
    1005   $options = _parse_attributes($options); 
    1006  
    1007   foreach (array('disabled', 'readonly', 'multiple') as $attribute) 
    1008   { 
    1009     if (array_key_exists($attribute, $options)) 
    1010     { 
    1011       if ($options[$attribute]) 
    1012       { 
    1013         $options[$attribute] = $attribute; 
    1014       } 
    1015       else 
    1016       { 
    1017         unset($options[$attribute]); 
    1018       } 
    1019     } 
    1020   } 
    1021  
    1022   return $options; 
    1023 } 
    1024  
    1025963function _convert_include_custom_for_select($options, &$select_options) 
    1026964{ 
  • branches/dwhittle/1.1/lib/helper/JavascriptHelper.php

    r9838 r10004  
    800800} 
    801801 
    802  
    803802/** 
    804803 * wrapper for script.aculo.us/prototype Ajax.Autocompleter. 
     
    830829  $tag_options['id'] = get_id_from_name(isset($tag_options['id']) ? $tag_options['id'] : $name); 
    831830 
    832   $javascript  = input_tag($name, $value, $tag_options); 
     831  $javascript  = tag('input', array_merge(array('type' => 'text', 'name' => $name, 'value' => $value), _convert_options($tag_options))); 
    833832  $javascript .= content_tag('div', '' , array('id' => $tag_options['id'].'_auto_complete', 'class' => 'auto_complete')); 
    834833  $javascript .= _auto_complete_field($tag_options['id'], $url, $comp_options); 
  • branches/dwhittle/1.1/lib/helper/TagHelper.php

    r9114 r10004  
    124124  return $value; 
    125125} 
     126 
     127/** 
     128 * Returns a formatted ID based on the <i>$name</i> parameter and optionally the <i>$value</i> parameter. 
     129 * 
     130 * This function determines the proper form field ID name based on the parameters. If a form field has an 
     131 * array value as a name we need to convert them to proper and unique IDs like so: 
     132 * <samp> 
     133 *  name[] => name (if value == null) 
     134 *  name[] => name_value (if value != null) 
     135 *  name[bob] => name_bob 
     136 *  name[item][total] => name_item_total 
     137 * </samp> 
     138 * 
     139 * <b>Examples:</b> 
     140 * <code> 
     141 *  echo get_id_from_name('status[]', '1'); 
     142 * </code> 
     143 * 
     144 * @param  string $name   field name  
     145 * @param  string $value  field value 
     146 * 
     147 * @return string <select> tag populated with all the languages in the world. 
     148 */ 
     149function get_id_from_name($name, $value = null) 
     150{ 
     151  // check to see if we have an array variable for a field name 
     152  if (strstr($name, '[')) 
     153  { 
     154    $name = str_replace(array('[]', '][', '[', ']'), array((($value != null) ? '_'.$value : ''), '_', '_', ''), $name); 
     155  } 
     156 
     157  return $name; 
     158} 
     159 
     160/** 
     161 * Converts specific <i>$options</i> to their correct HTML format 
     162 * 
     163 * @param  array $options 
     164 * @return array returns properly formatted options  
     165 */ 
     166function _convert_options($options) 
     167{ 
     168  $options = _parse_attributes($options); 
     169 
     170  foreach (array('disabled', 'readonly', 'multiple') as $attribute) 
     171  { 
     172    if (array_key_exists($attribute, $options)) 
     173    { 
     174      if ($options[$attribute]) 
     175      { 
     176        $options[$attribute] = $attribute; 
     177      } 
     178      else 
     179      { 
     180        unset($options[$attribute]); 
     181      } 
     182    } 
     183  } 
     184 
     185  return $options; 
     186} 
  • branches/dwhittle/1.1/lib/request/sfWebRequest.class.php

    r9838 r10004  
    801801    $pathArray = $this->getPathInfoArray(); 
    802802 
    803     return isset($pathArray[$name]) ? stripslashes($pathArray[$name]) : null; 
     803    return isset($pathArray[$name]) ? sfToolkit::stripslashesDeep($pathArray[$name]) : null; 
    804804  } 
    805805 
     
    818818    if (isset($_COOKIE[$name])) 
    819819    { 
    820       $retval = get_magic_quotes_gpc() ? stripslashes($_COOKIE[$name]) : $_COOKIE[$name]; 
     820      $retval = get_magic_quotes_gpc() ? sfToolkit::stripslashesDeep($_COOKIE[$name]) : $_COOKIE[$name]; 
    821821    } 
    822822 
  • branches/dwhittle/1.1/test/unit/controller/sfWebControllerTest.php

    r9949 r10004  
    1212require_once($_test_dir.'/unit/sfContextMock.class.php'); 
    1313 
    14 $t = new lime_test(25, new lime_output_color()); 
     14$t = new lime_test(26, new lime_output_color()); 
    1515 
    1616$_SERVER['HTTP_HOST'] = 'localhost'; 
     
    132132    ), 
    133133  ), 
     134  '@test?id=foo%26bar&foo=bar%3Dfoo' => array( 
     135    'test', 
     136    array( 
     137      'id' => 'foo&bar', 
     138      'foo' => 'bar=foo', 
     139    ), 
     140  ), 
    134141); 
    135142 
  • branches/dwhittle/1.1/test/unit/response/sfWebResponseTest.php

    r7782 r10004  
    1111require_once(dirname(__FILE__).'/../../bootstrap/unit.php'); 
    1212 
    13 $t = new lime_test(72, new lime_output_color()); 
     13$t = new lime_test(73, new lime_output_color()); 
    1414 
    1515class myWebResponse extends sfWebResponse 
     
    134134$response->setTitle('my title'); 
    135135$t->is($response->getTitle(), 'my title', '->setTitle() sets the title'); 
     136$response->setTitle('fööbäär'); 
     137$t->is($response->getTitle(), 'fööbäär', '->setTitle() will leave encoding intact'); 
    136138 
    137139// ->addHttpMeta()