Changeset 10004
- Timestamp:
- 06/30/08 04:38:04 (5 years ago)
- Files:
-
- branches/dwhittle/1.0/CHANGELOG (modified) (1 diff)
- branches/dwhittle/1.0/lib/VERSION (modified) (1 diff)
- branches/dwhittle/1.0/lib/config/sfViewConfigHandler.class.php (modified) (1 diff)
- branches/dwhittle/1.0/lib/controller/sfWebController.class.php (modified) (1 diff)
- branches/dwhittle/1.0/lib/request/sfWebRequest.class.php (modified) (2 diffs)
- branches/dwhittle/1.0/lib/response/sfWebResponse.class.php (modified) (1 diff)
- branches/dwhittle/1.0/lib/util/sfToolkit.class.php (modified) (2 diffs)
- branches/dwhittle/1.0/test/unit/controller/sfWebControllerTest.php (modified) (2 diffs)
- branches/dwhittle/1.0/test/unit/response/sfWebResponseTest.php (modified) (2 diffs)
- branches/dwhittle/1.1/CHANGELOG (modified) (1 diff)
- branches/dwhittle/1.1/lib/autoload/sfCoreAutoload.class.php (modified) (1 diff)
- branches/dwhittle/1.1/lib/controller/sfWebController.class.php (modified) (1 diff)
- branches/dwhittle/1.1/lib/helper/FormHelper.php (modified) (4 diffs)
- branches/dwhittle/1.1/lib/helper/JavascriptHelper.php (modified) (2 diffs)
- branches/dwhittle/1.1/lib/helper/TagHelper.php (modified) (1 diff)
- branches/dwhittle/1.1/lib/request/sfWebRequest.class.php (modified) (2 diffs)
- branches/dwhittle/1.1/test/unit/controller/sfWebControllerTest.php (modified) (2 diffs)
- branches/dwhittle/1.1/test/unit/response/sfWebResponseTest.php (modified) (2 diffs)
- branches/dwhittle/trunk (deleted)
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 1 Version 1.0.18PRE 2 ------------- 3 4 This is a bug fix release. 5 6 Version 1.0.17 7 ------------- 8 9 This 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 . 6 28 Version 1.0.16 7 29 ------------- branches/dwhittle/1.0/lib/VERSION
r8964 r10004 1 1.0.1 7-PRE1 1.0.18-PRE branches/dwhittle/1.0/lib/config/sfViewConfigHandler.class.php
r6598 r10004 227 227 foreach ($this->mergeConfigValue('metas', $viewName) as $name => $content) 228 228 { 229 $data[] = sprintf(" \$response->addMeta('%s', '%s', false, false);", $name, str_replace('\'', '\\\'', preg_replace('/&(?=\w+;)/', '&', html entities($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'))))); 230 230 } 231 231 branches/dwhittle/1.0/lib/controller/sfWebController.class.php
r7797 r10004 188 188 foreach ($matches as $match) 189 189 { 190 $params[ $match[1][0]] = $match[2][0];190 $params[urldecode($match[1][0])] = urldecode($match[2][0]); 191 191 } 192 192 branches/dwhittle/1.0/lib/request/sfWebRequest.class.php
r9838 r10004 790 790 $pathArray = $this->getPathInfoArray(); 791 791 792 return isset($pathArray[$name]) ? s tripslashes($pathArray[$name]) : null;792 return isset($pathArray[$name]) ? sfToolkit::stripslashesDeep($pathArray[$name]) : null; 793 793 } 794 794 … … 804 804 if (isset($_COOKIE[$name])) 805 805 { 806 $retval = get_magic_quotes_gpc() ? s tripslashes($_COOKIE[$name]) : $_COOKIE[$name];806 $retval = get_magic_quotes_gpc() ? sfToolkit::stripslashesDeep($_COOKIE[$name]) : $_COOKIE[$name]; 807 807 } 808 808 branches/dwhittle/1.0/lib/response/sfWebResponse.class.php
r6992 r10004 472 472 if ($escape) 473 473 { 474 $value = html entities($value, ENT_QUOTES, sfConfig::get('sf_charset'));474 $value = htmlspecialchars($value, ENT_QUOTES, sfConfig::get('sf_charset')); 475 475 } 476 476 branches/dwhittle/1.0/lib/util/sfToolkit.class.php
r9563 r10004 447 447 } 448 448 449 public static function &getArrayValueForPath (&$values, $name, $default = null)449 public static function &getArrayValueForPathByRef(&$values, $name, $default = null) 450 450 { 451 451 if (false !== ($offset = strpos($name, '['))) … … 468 468 } 469 469 $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)]; 470 501 $offset = $end; 471 502 } branches/dwhittle/1.0/test/unit/controller/sfWebControllerTest.php
r6598 r10004 12 12 require_once($_test_dir.'/unit/sfContextMock.class.php'); 13 13 14 $t = new lime_test(1 7, new lime_output_color());14 $t = new lime_test(18, new lime_output_color()); 15 15 16 16 sfConfig::set('sf_max_forwards', 10); … … 125 125 ), 126 126 ), 127 '@test?id=foo%26bar&foo=bar%3Dfoo' => array( 128 'test', 129 array( 130 'id' => 'foo&bar', 131 'foo' => 'bar=foo', 132 ), 133 ), 127 134 ); 128 135 branches/dwhittle/1.0/test/unit/response/sfWebResponseTest.php
r6795 r10004 12 12 require_once($_test_dir.'/unit/sfContextMock.class.php'); 13 13 14 $t = new lime_test(6 5, new lime_output_color());14 $t = new lime_test(66, new lime_output_color()); 15 15 16 16 class myWebResponse extends sfWebResponse … … 129 129 $response->setTitle('my title'); 130 130 $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'); 131 133 132 134 // ->addHttpMeta() branches/dwhittle/1.1/CHANGELOG
r9515 r10004 1 Version 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 1 45 Version 1.1.0 RC2 2 46 ------------------ branches/dwhittle/1.1/lib/autoload/sfCoreAutoload.class.php
r9838 r10004 12 12 * The current symfony version. 13 13 */ 14 define('SYMFONY_VERSION', '1.1. 0-DEV');14 define('SYMFONY_VERSION', '1.1.1-DEV'); 15 15 16 16 /** branches/dwhittle/1.1/lib/controller/sfWebController.class.php
r9949 r10004 168 168 foreach ($matches as $match) 169 169 { 170 $params[ $match[1][0]] = $match[2][0];170 $params[urldecode($match[1][0])] = urldecode($match[2][0]); 171 171 } 172 172 branches/dwhittle/1.1/lib/helper/FormHelper.php
r9515 r10004 298 298 * Returns a <select> tag populated with all the currencies in the world (or almost). 299 299 * 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 304 304 * countries and cultures throughout the world. Here's an example of an <option> tag generated by the select_currency_tag: 305 305 * … … 316 316 * </code> 317 317 * 318 * @param string $name field name 318 * @param string $name field name 319 319 * @param string $selected selected field value (threecharacter currency code) 320 320 * @param array $options additional HTML compliant <select> tag parameters … … 330 330 $currency_option = _get_option($options, 'currencies'); 331 331 $display_option = _get_option($options, 'display'); 332 332 333 333 foreach ($currencies as $key => $value) 334 334 { … … 961 961 } 962 962 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 an967 * 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_bob972 * name[item][total] => name_item_total973 * </samp>974 *975 * <b>Examples:</b>976 * <code>977 * echo get_id_from_name('status[]', '1');978 * </code>979 *980 * @param string $name field name981 * @param string $value field value982 *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 name988 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 format999 *1000 * @param array $options1001 * @return array returns properly formatted options1002 */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 else1016 {1017 unset($options[$attribute]);1018 }1019 }1020 }1021 1022 return $options;1023 }1024 1025 963 function _convert_include_custom_for_select($options, &$select_options) 1026 964 { branches/dwhittle/1.1/lib/helper/JavascriptHelper.php
r9838 r10004 800 800 } 801 801 802 803 802 /** 804 803 * wrapper for script.aculo.us/prototype Ajax.Autocompleter. … … 830 829 $tag_options['id'] = get_id_from_name(isset($tag_options['id']) ? $tag_options['id'] : $name); 831 830 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))); 833 832 $javascript .= content_tag('div', '' , array('id' => $tag_options['id'].'_auto_complete', 'class' => 'auto_complete')); 834 833 $javascript .= _auto_complete_field($tag_options['id'], $url, $comp_options); branches/dwhittle/1.1/lib/helper/TagHelper.php
r9114 r10004 124 124 return $value; 125 125 } 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 */ 149 function 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 */ 166 function _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 801 801 $pathArray = $this->getPathInfoArray(); 802 802 803 return isset($pathArray[$name]) ? s tripslashes($pathArray[$name]) : null;803 return isset($pathArray[$name]) ? sfToolkit::stripslashesDeep($pathArray[$name]) : null; 804 804 } 805 805 … … 818 818 if (isset($_COOKIE[$name])) 819 819 { 820 $retval = get_magic_quotes_gpc() ? s tripslashes($_COOKIE[$name]) : $_COOKIE[$name];820 $retval = get_magic_quotes_gpc() ? sfToolkit::stripslashesDeep($_COOKIE[$name]) : $_COOKIE[$name]; 821 821 } 822 822 branches/dwhittle/1.1/test/unit/controller/sfWebControllerTest.php
r9949 r10004 12 12 require_once($_test_dir.'/unit/sfContextMock.class.php'); 13 13 14 $t = new lime_test(2 5, new lime_output_color());14 $t = new lime_test(26, new lime_output_color()); 15 15 16 16 $_SERVER['HTTP_HOST'] = 'localhost'; … … 132 132 ), 133 133 ), 134 '@test?id=foo%26bar&foo=bar%3Dfoo' => array( 135 'test', 136 array( 137 'id' => 'foo&bar', 138 'foo' => 'bar=foo', 139 ), 140 ), 134 141 ); 135 142 branches/dwhittle/1.1/test/unit/response/sfWebResponseTest.php
r7782 r10004 11 11 require_once(dirname(__FILE__).'/../../bootstrap/unit.php'); 12 12 13 $t = new lime_test(7 2, new lime_output_color());13 $t = new lime_test(73, new lime_output_color()); 14 14 15 15 class myWebResponse extends sfWebResponse … … 134 134 $response->setTitle('my title'); 135 135 $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'); 136 138 137 139 // ->addHttpMeta()