Fix: Type Missmatch in HtmlHelper::tableCells()#14935
Closed
YveIce wants to merge 1 commit into
Closed
Fix: Type Missmatch in HtmlHelper::tableCells()#14935YveIce wants to merge 1 commit into
YveIce wants to merge 1 commit into
Conversation
TableCells() allow $data to be of type string. If so, it will be warped into an array an later unpacked in a foreach loop, and passed as string to _renderCells(). But _renderCells() aspects the argument $line to be an array. Double warp it as array should fix this.
Member
|
Do you have a test case for this? |
Contributor
Author
echo $this->Html->tableCells("Foo");Throws Exception: Testcase: public function test(): bool
{
return ($this->Html->tableCells("Foo") == $this->Html->tableCells(["Foo"]));
} |
Merged
Member
|
Solved in #14940 |
vlad-ko
added a commit
to vlad-ko/cakephp
that referenced
this pull request
Dec 2, 2020
* Update version number to 4.1.2 * Add function name to window so that debugkit can use it Because jQuery's script tag insertion happens *after* DOMContentLoaded we need a window hook to allow debug kit to have interactive dump blocks. * Ensure plugin path config is loaded for each PluginCollection::findPath() call. This is necessary primarily for testing because the Configure::clear() call in TestCase::tearDown() wipes out all configuration including plugin paths config. Reverts cakephp#14860. Closes cakephp#14889. * Tests for url and pagination first/last * Fix use of libxml_disable_entity_loader() for Xml::build() too. Removed code duplication. Refs cakephp#14886. * Throw exception when exceeding maximum number of Sql Server parameters * Updated max parameters exception message * Update exception assert message to match * Added connection retry logic to Driver. Configured SqlServer to retry connection on Azure Database paused error code. * Fix output buffers not being closed when the view triggers an exception. When evaluating a template or caching a block, the view itself opens a buffer, and the templates/blocks that it evaluates might open buffers too. In case an exception happens, the opened buffers will not be closed, causing risky tests with PHPUnit, and possible further output to be swallowed unless the test itself closes/flushes the remaining buffers. * Ensure DateType marshalling works for both mutable and immutable types * Make Route normalize HTTP method conditions By normalizing the http method name to the correct case resource routes are a bit more ergonomic as case mistakes don't cause routes to fail matching. Fixes cakephp#14902 * Update version number to 4.1.3 * Fix phpcs * Indent the HTML tags Make the HTML output include whitespace. This makes copying and pasting into other formats easier as the text has whitespace. * Fix phpcs * Normalize and validate HTTP method names. * Remove a cast. * Revert the previous change. Creating the array changes the behavior in ways that make the test suite sad. * Add copy to debug output Add copy behavior to the debug output HTML. I've also replaced the unicode arrow with a tiny inline svg which renders better. * Update docblocks * Bump up phpstan. * Keep all components annotated, even if deprecated (still in use). * Update src/Error/Debug/dumpHeader.html Co-authored-by: Oliver Nowak <ndm2@users.noreply.github.com> * Tweak positioning. * Upgrade to php-coveralls 2.2.0 * Add line number to debug copy. * Make test assert stricter for scalar values. * Undeprecate class * Fix tmpdir path * Bump up phpstan version. * Bump up psalm's version. Ignore "UnsafeInstantiation" errors. * Ignore invalid psalm error. * Fix parameter name mismatches. * Typecast to string to avoid type mismatch error. Fixes cakephp#14921. * Fix data normalization. Closes cakephp#14935 * Remove outdated comment. * Fix UUID warning for invalid ones. * Add a way to restore 3.x behavior for last=true * Fix CS. * Update src/Validation/Validator.php Co-authored-by: Mark Story <mark@mark-story.com> * Fix generation of alias when using FQCN with TableLocator::get(). Closes cakephp#14948 * Get rid of "teamcity" output format. It makes spotting failing tests difficult in output logs. * Fix formatting in docblock * Update version number to 4.1.4 * Update psalm's baseline file. * Don't allow PluginLoadCommand to add invalid plugins Catch mistakes earlier on as users can easily make typos when adding plugins to their applications. Fixes cakephp#14870 * Update src/Command/PluginLoadCommand.php Co-authored-by: YveIce <42624289+YveIce@users.noreply.github.com> * Update tests to match new output and fix phpcs * Add test covering cakephp#14961 The reported issue doesn't seem to effect 4.x * Don't run test suite on nightly/PHP 8. PHP 8 support requires updating dependencies and hence a new minor release. * Fixtures: Truncate instead of drop if schema defined in database table Issue cakephp#14958 * Init BS4. * Throw an exception on invalid cache configuration * Add test case for the memcached config on the second port, cakephp#14985 * Port changes from cakephp#14986 to 4.x Fixes cakephp#14985 * Fix incorrect type on persistent connection. * Apply suggestions from code review Co-authored-by: othercorey <corey.taylor.fl@gmail.com> * Fix up PHPUnit usage. * Fix incorrect index. * Add default values when reading action request parameter Fixes cakephp#14990 * Fix empty string check * Fix "Copy" to clipboard link in debug output. Closes cakephp#14992. * Add gitattributes php diff * Switch to codecov for code coverage reporting. It now uses GH annotations to show lines without test coverage on the pull request itself. * Move warning about count() to top of docblock * Move codecov config file * Update Collection parameter names * Bump up phpstan and psalm's version. * Update Connection parameter names * Add Cake\ORM\Query * Update src/Database/Query.php Co-authored-by: ADmad <ADmad@users.noreply.github.com> * Allow the Reply-to header of e-mail contain more than one e-mail * Add more tests with the Reply-To header of e-mails * Use setStopOnFailure() instead. * Clarify version map * Remove the function Message::addReplyTo * Update version number to 4.1.5 * Fix description * Made a more accurate comment on the Sender methods cakephp#15010 (comment) cakephp#15010 (comment) * Clarify rfc link explains Sender field * Fix incorrectly handled null action. Fixes cakephp#14990 * Fix CS error * Fix missing parameter in Routing error Fixes cakephp#15027 * Fix operator extraction from expression keys Fix the operator extraction on expression key values. Previously we were not handling functions with spaces well which resulted in conditions being lowercased. Fixes cakephp#15008 * Fix test * Remove lies from docblock. * Update test to only run without quoting identifier quoting creates inconsistent results and isn't compatible with string expressions anyways. I also tweaked how spacing was handled in postgres and sqlserver to generate consistent results. * ensure its a string (php8) * Set utf8mb4 character set for travis * Add comment for operator spacing. * Update static analyzers * RFC in uppercase * URL in uppercase * Mention of 'url' parameter in quotes to clarify * IP in uppercase * HTML in uppercase * CLI in uppercase * XML in uppercase * JSON in uppercase * AJAX in uppercase * MySQL name correctly * JS in uppercase * Only include URL encoded data in Oauth signatures The OAuth 1.0a spec only allows urlencoded data to be included in the OAuth signature to be included. All other content types should be skipped. Fixes cakephp#15066 * Replace deprecated notEmpty with notEmptyString * Make sure debug as string doesn't throw error. * Default to string if no SQLite type is defined cakephp#15075 * adds docblock comments * Resolve `Multi-line arrays must have a trailing comma after the last element.` * Add suggestions for string comparison and `TableSchema::TYPE_TEXT` * updates test for TableSchema::TYPE_TEXT change * Remove trailing , for php 7.2 * Apply suggestions from code review Co-authored-by: othercorey <corey.taylor.fl@gmail.com> * children, not childs https://dictionary.cambridge.org/de/worterbuch/englisch/child * Revert key in caps https://github.com/cakephp/cakephp/pull/15069/files/f37e81c9dc17074041391145ad30795f279410c8#r506576466 * Update statement about XML layout location * Improve wording, grammar, punctuation etc. * Use `assertSame()` instead of `assertEquals()` * Preferred indentation style for .neon files is using tabs. * Forward port support of UTF-8 encoding for pj() * Fix regression in object value comparison when marshalling entity. Closes cakephp#15099 * Add DockerHub login for unit test test suite * Improve error when INSERT query cannot be compiled Add a more useful error when insert queries cannot be compiled. * Upgrade psalm to 3.18 * Apply suggestions from code review Co-authored-by: othercorey <corey.taylor.fl@gmail.com> * Remove duckerhub login because it doesn't work with forked PRs * Allowing scalar and empty body for JSON requests When the request is set as `application/json` and contains a valid body, such as empty body or non-array/object, the `BodyParserMiddleware` was throwing a `BadRequestException`. * Fix offset error in identifier quoting. * Add check to SQLServer query compiler * Use PHP env variable in ServerCommand Use the PHP environment variable when starting up the PHP server. Fixes cakephp#15116 * Delete .appveyor.yml * Update src/Command/ServerCommand.php Co-authored-by: othercorey <corey.taylor.fl@gmail.com> * Allow 5 seconds for server and db now() comparison * Update GA workflow to run jobs that were run on TravisCI * Optimize GA CI workflow * Try to fix builds * Add prefer-lowest to composer cache key * Fix bash false/true check with github action expression result * Remove expected exception message as it changes between php versions * Delete .travis.yml * Wait 2 seconds for 1 second expiration test to avoid edge cases * Use composer v1 for windows * Sync with 4.next * Update version number to 4.1.6 * Enable composer v2 on windows * Add prefer-lowest to composer cache key * No need for extra action, phpunit problem matcher is already available. * Avoid redundant check * Ensure psalm and phpstan are run even if previous steps fail * Dont use a dist for a non changing file * Adjust gitattributes for phpcs.xml * Fix up event docs. * Use memcache docker image instead of apt package. * Add test for retaining and flash messages. * add missing method to solve the error ```Fatal error: Class Application contains 1 abstract method and must therefore be declared abstract or implement the remaining methods (Psr\Http\Server\RequestHandlerInterface::handle)``` * Fix typo in comment doesnt -> doesn't * Fix SQL Server missing parentheses on paging subquery in order clause. * Fix missing parentheses when ordering by query expression. * Fix SQL Server bindings conflict when ordering by expression fields. * Fix CS. * Fix limit/offset SQL comparison failing on SQL Server. * Fix CS. * Fix test failing on Postgres because NULLS FIRST behavior. * Fix cannot reuse placeholders with SQL Server. * Add better exception output * Also fix up order by expr message * Use strict assertions. * Make debugging easier for tests * Fix Hash::mergeDiff() not handling scalar values. Fixes cakephp#15190 Co-authored-by: Mark Story <mark@mark-story.com> Co-authored-by: ADmad <admad.coder@gmail.com> Co-authored-by: othercorey <corey.taylor.fl@gmail.com> Co-authored-by: mscherer <mark.scherer@spryker.com> Co-authored-by: ndm2 <ndm2@users.noreply.github.com> Co-authored-by: ADmad <ADmad@users.noreply.github.com> Co-authored-by: Mark Sch <dereuromark@users.noreply.github.com> Co-authored-by: YveIce <42624289+YveIce@users.noreply.github.com> Co-authored-by: Jonathan McAndrew <jon@hydracor.net> Co-authored-by: bancer <val@dinnerbooking.com> Co-authored-by: itosho <www.itosho@gmail.com> Co-authored-by: Ricardo Turella <rturella3@ucs.br> Co-authored-by: Richard.Strittmatter <Richi2401$> Co-authored-by: Matthias Wirtz <2990373+swiffer@users.noreply.github.com> Co-authored-by: ravage84 <ravage@bluewin.ch> Co-authored-by: Daniel Opitz <odan@users.noreply.github.com> Co-authored-by: chris cnizzardini <cnizzardini@gmail.com> Co-authored-by: Juan Basso <jrbasso@gmail.com> Co-authored-by: saeideng <saeideng@users.noreply.github.com> Co-authored-by: Ikko Ashimine <eltociear@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
TableCells() allow $data to be of type string. If so, it will be warped into an array an later unpacked in a foreach loop, and passed as string to _renderCells(). But _renderCells() aspects the argument $line to be an array.
Double warp it as array should fix this.