diff --git a/.htaccess.sample b/.htaccess.sample
index e60c87bfb9f5d3cc749bd3ca3916069e91a0c468..db1427b9317a0f0480076a10c77b16463b1c9bec 100644
--- a/.htaccess.sample
+++ b/.htaccess.sample
@@ -16,12 +16,6 @@ Options +FollowSymLinks
 # Make Drupal handle any 404 errors.
 ErrorDocument 404 /index.php
 
-# Force simple error message for requests for non-existent favicon.ico.
-<Files favicon.ico>
-  # There is no end quote below, for compatibility with Apache 1.3.
-  ErrorDocument 404 "The requested file favicon.ico was not found.
-</Files>
-
 # Set the default handler.
 DirectoryIndex index.php index.html index.htm
 
@@ -146,7 +140,7 @@ DirectoryIndex index.php index.html index.htm
 
     <FilesMatch "(\.js\.gz|\.css\.gz)$">
       # Serve correct encoding type.
-      Header append Content-Encoding gzip
+      Header set Content-Encoding gzip
       # Force proxies to cache gzipped & non-gzipped css/js files separately.
       Header append Vary Accept-Encoding
     </FilesMatch>
diff --git a/CHANGELOG.txt b/CHANGELOG.txt
index 32642d01f323086ea03ac93418f8b626251ceafe..de4095dc744b12a30f1cdb1d8b8bb4bda994794d 100644
--- a/CHANGELOG.txt
+++ b/CHANGELOG.txt
@@ -1,4 +1,38 @@
 
+Drupal 7.9, 2011-10-26
+----------------------
+- Critical fixes to OpenID to spec violations that could allow for
+  impersonation in certain scenarios. Existing OpenID users should see
+  http://drupal.org/node/1120290#comment-5092796 for more information on
+  transitioning.
+- Fixed files getting lost when adding multiple files to multiple file fields
+  at the same time.
+- Improved usability of the clean URL test screens.
+- Restored height/width attributes on images run through the theme system.
+- Fixed usability bug with first password field being pre-filled by certain
+  browser plugins.
+- Fixed file_usage_list() so that it can return more than one result.
+- Fixed bug preventing preview of private images on node form.
+- Fixed PDO error when inserting an aggregator title longer than 255 characters.
+- Spelled out what TRADITIONAL means in MySQL sql_mode.
+- Deprecated "!=" operator for DBTNG; should be "<>".
+- Added two new API functions (menu_tree_set_path()/menu_tree_get_path()) were
+  added in order to enable setting the active menu trail for dynamically
+  generated menu paths.
+- Added new "fast 404" capability in settings.php to bypass Drupal bootstrap
+  when serving 404 pages for certain file types.
+- Added format_string() function which can perform string munging ala the t()
+  function without the overhead of the translation system.
+- Numerous #states system fixes.
+- Numerous EntityFieldQuery, DBTNG, and SQLite fixes.
+- Numerous Shortcut module fixes.
+- Numerous language system fixes.
+- Numerous token fixes.
+- Numerous CSS fixes.
+- Numerous upgrade path fixes.
+- Numerous minor string fixes.
+- Numerous notice fixes.
+
 Drupal 7.8, 2011-08-31
 ----------------------
 - Fixed critical upgrade path issue with multilingual sites, leading to lost
@@ -1059,7 +1093,7 @@ Drupal 4.5.0, 2004-10-18
 - Filter system:
     * Added support for using multiple input formats on the site
     * Expanded the embedded PHP-code feature so it can be used everywhere
-    * Added support for role-dependant filtering, through input formats
+    * Added support for role-dependent filtering, through input formats
 - UI translation:
     * Managing translations is now completely done through the administration interface
     * Added support for importing/exporting gettext .po files
diff --git a/LICENSE.txt b/LICENSE.txt
index 2c095c8d3f42488e8168f9710a4ffbfc4125a159..d159169d1050894d3ea3b98e1c965c4058208fe1 100644
--- a/LICENSE.txt
+++ b/LICENSE.txt
@@ -1,274 +1,339 @@
-GNU GENERAL PUBLIC LICENSE
-
-              Version 2, June 1991
-
-Copyright (C) 1989, 1991 Free Software Foundation, Inc. 675 Mass Ave,
-Cambridge, MA 02139, USA. Everyone is permitted to copy and distribute
-verbatim copies of this license document, but changing it is not allowed.
-
-                  Preamble
-
-The licenses for most software are designed to take away your freedom to
-share and change it. By contrast, the GNU General Public License is
-intended to guarantee your freedom to share and change free software--to
-make sure the software is free for all its users. This General Public License
-applies to most of the Free Software Foundation's software and to any other
-program whose authors commit to using it. (Some other Free Software
-Foundation software is covered by the GNU Library General Public License
-instead.) You can apply it to your programs, too.
-
-When we speak of free software, we are referring to freedom, not price. Our
-General Public Licenses are designed to make sure that you have the
-freedom to distribute copies of free software (and charge for this service if
-you wish), that you receive source code or can get it if you want it, that you
-can change the software or use pieces of it in new free programs; and that
-you know you can do these things.
-
-To protect your rights, we need to make restrictions that forbid anyone to
-deny you these rights or to ask you to surrender the rights. These restrictions
-translate to certain responsibilities for you if you distribute copies of the
-software, or if you modify it.
-
-For example, if you distribute copies of such a program, whether gratis or for
-a fee, you must give the recipients all the rights that you have. You must make
-sure that they, too, receive or can get the source code. And you must show
-them these terms so they know their rights.
-
-We protect your rights with two steps: (1) copyright the software, and (2)
-offer you this license which gives you legal permission to copy, distribute
-and/or modify the software.
-
-Also, for each author's protection and ours, we want to make certain that
-everyone understands that there is no warranty for this free software. If the
-software is modified by someone else and passed on, we want its recipients
-to know that what they have is not the original, so that any problems
-introduced by others will not reflect on the original authors' reputations.
-
-Finally, any free program is threatened constantly by software patents. We
-wish to avoid the danger that redistributors of a free program will individually
-obtain patent licenses, in effect making the program proprietary. To prevent
-this, we have made it clear that any patent must be licensed for everyone's
-free use or not licensed at all.
-
-The precise terms and conditions for copying, distribution and modification
-follow.
-
-           GNU GENERAL PUBLIC LICENSE
- TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND
-               MODIFICATION
-
-0. This License applies to any program or other work which contains a notice
-placed by the copyright holder saying it may be distributed under the terms
-of this General Public License. The "Program", below, refers to any such
-program or work, and a "work based on the Program" means either the
-Program or any derivative work under copyright law: that is to say, a work
-containing the Program or a portion of it, either verbatim or with
-modifications and/or translated into another language. (Hereinafter, translation
-is included without limitation in the term "modification".) Each licensee is
-addressed as "you".
-
-Activities other than copying, distribution and modification are not covered
-by this License; they are outside its scope. The act of running the Program is
-not restricted, and the output from the Program is covered only if its contents
-constitute a work based on the Program (independent of having been made
-by running the Program). Whether that is true depends on what the Program
-does.
-
-1. You may copy and distribute verbatim copies of the Program's source
-code as you receive it, in any medium, provided that you conspicuously and
-appropriately publish on each copy an appropriate copyright notice and
-disclaimer of warranty; keep intact all the notices that refer to this License
-and to the absence of any warranty; and give any other recipients of the
-Program a copy of this License along with the Program.
-
-You may charge a fee for the physical act of transferring a copy, and you
-may at your option offer warranty protection in exchange for a fee.
-
-2. You may modify your copy or copies of the Program or any portion of it,
-thus forming a work based on the Program, and copy and distribute such
-modifications or work under the terms of Section 1 above, provided that you
-also meet all of these conditions:
-
-a) You must cause the modified files to carry prominent notices stating that
-you changed the files and the date of any change.
-
-b) You must cause any work that you distribute or publish, that in whole or in
-part contains or is derived from the Program or any part thereof, to be
-licensed as a whole at no charge to all third parties under the terms of this
-License.
-
-c) If the modified program normally reads commands interactively when run,
-you must cause it, when started running for such interactive use in the most
-ordinary way, to print or display an announcement including an appropriate
-copyright notice and a notice that there is no warranty (or else, saying that
-you provide a warranty) and that users may redistribute the program under
-these conditions, and telling the user how to view a copy of this License.
-(Exception: if the Program itself is interactive but does not normally print such
-an announcement, your work based on the Program is not required to print
-an announcement.)
-
-These requirements apply to the modified work as a whole. If identifiable
-sections of that work are not derived from the Program, and can be
-reasonably considered independent and separate works in themselves, then
-this License, and its terms, do not apply to those sections when you distribute
-them as separate works. But when you distribute the same sections as part
-of a whole which is a work based on the Program, the distribution of the
-whole must be on the terms of this License, whose permissions for other
-licensees extend to the entire whole, and thus to each and every part
-regardless of who wrote it.
-
-Thus, it is not the intent of this section to claim rights or contest your rights to
-work written entirely by you; rather, the intent is to exercise the right to
-control the distribution of derivative or collective works based on the
-Program.
+                    GNU GENERAL PUBLIC LICENSE
+                       Version 2, June 1991
+
+ Copyright (C) 1989, 1991 Free Software Foundation, Inc.,
+ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ Everyone is permitted to copy and distribute verbatim copies
+ of this license document, but changing it is not allowed.
+
+                            Preamble
+
+  The licenses for most software are designed to take away your
+freedom to share and change it.  By contrast, the GNU General Public
+License is intended to guarantee your freedom to share and change free
+software--to make sure the software is free for all its users.  This
+General Public License applies to most of the Free Software
+Foundation's software and to any other program whose authors commit to
+using it.  (Some other Free Software Foundation software is covered by
+the GNU Lesser General Public License instead.)  You can apply it to
+your programs, too.
+
+  When we speak of free software, we are referring to freedom, not
+price.  Our General Public Licenses are designed to make sure that you
+have the freedom to distribute copies of free software (and charge for
+this service if you wish), that you receive source code or can get it
+if you want it, that you can change the software or use pieces of it
+in new free programs; and that you know you can do these things.
+
+  To protect your rights, we need to make restrictions that forbid
+anyone to deny you these rights or to ask you to surrender the rights.
+These restrictions translate to certain responsibilities for you if you
+distribute copies of the software, or if you modify it.
+
+  For example, if you distribute copies of such a program, whether
+gratis or for a fee, you must give the recipients all the rights that
+you have.  You must make sure that they, too, receive or can get the
+source code.  And you must show them these terms so they know their
+rights.
+
+  We protect your rights with two steps: (1) copyright the software, and
+(2) offer you this license which gives you legal permission to copy,
+distribute and/or modify the software.
+
+  Also, for each author's protection and ours, we want to make certain
+that everyone understands that there is no warranty for this free
+software.  If the software is modified by someone else and passed on, we
+want its recipients to know that what they have is not the original, so
+that any problems introduced by others will not reflect on the original
+authors' reputations.
+
+  Finally, any free program is threatened constantly by software
+patents.  We wish to avoid the danger that redistributors of a free
+program will individually obtain patent licenses, in effect making the
+program proprietary.  To prevent this, we have made it clear that any
+patent must be licensed for everyone's free use or not licensed at all.
+
+  The precise terms and conditions for copying, distribution and
+modification follow.
+
+                    GNU GENERAL PUBLIC LICENSE
+   TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
+
+  0. This License applies to any program or other work which contains
+a notice placed by the copyright holder saying it may be distributed
+under the terms of this General Public License.  The "Program", below,
+refers to any such program or work, and a "work based on the Program"
+means either the Program or any derivative work under copyright law:
+that is to say, a work containing the Program or a portion of it,
+either verbatim or with modifications and/or translated into another
+language.  (Hereinafter, translation is included without limitation in
+the term "modification".)  Each licensee is addressed as "you".
+
+Activities other than copying, distribution and modification are not
+covered by this License; they are outside its scope.  The act of
+running the Program is not restricted, and the output from the Program
+is covered only if its contents constitute a work based on the
+Program (independent of having been made by running the Program).
+Whether that is true depends on what the Program does.
+
+  1. You may copy and distribute verbatim copies of the Program's
+source code as you receive it, in any medium, provided that you
+conspicuously and appropriately publish on each copy an appropriate
+copyright notice and disclaimer of warranty; keep intact all the
+notices that refer to this License and to the absence of any warranty;
+and give any other recipients of the Program a copy of this License
+along with the Program.
+
+You may charge a fee for the physical act of transferring a copy, and
+you may at your option offer warranty protection in exchange for a fee.
+
+  2. You may modify your copy or copies of the Program or any portion
+of it, thus forming a work based on the Program, and copy and
+distribute such modifications or work under the terms of Section 1
+above, provided that you also meet all of these conditions:
+
+    a) You must cause the modified files to carry prominent notices
+    stating that you changed the files and the date of any change.
+
+    b) You must cause any work that you distribute or publish, that in
+    whole or in part contains or is derived from the Program or any
+    part thereof, to be licensed as a whole at no charge to all third
+    parties under the terms of this License.
+
+    c) If the modified program normally reads commands interactively
+    when run, you must cause it, when started running for such
+    interactive use in the most ordinary way, to print or display an
+    announcement including an appropriate copyright notice and a
+    notice that there is no warranty (or else, saying that you provide
+    a warranty) and that users may redistribute the program under
+    these conditions, and telling the user how to view a copy of this
+    License.  (Exception: if the Program itself is interactive but
+    does not normally print such an announcement, your work based on
+    the Program is not required to print an announcement.)
+
+These requirements apply to the modified work as a whole.  If
+identifiable sections of that work are not derived from the Program,
+and can be reasonably considered independent and separate works in
+themselves, then this License, and its terms, do not apply to those
+sections when you distribute them as separate works.  But when you
+distribute the same sections as part of a whole which is a work based
+on the Program, the distribution of the whole must be on the terms of
+this License, whose permissions for other licensees extend to the
+entire whole, and thus to each and every part regardless of who wrote it.
+
+Thus, it is not the intent of this section to claim rights or contest
+your rights to work written entirely by you; rather, the intent is to
+exercise the right to control the distribution of derivative or
+collective works based on the Program.
 
 In addition, mere aggregation of another work not based on the Program
-with the Program (or with a work based on the Program) on a volume of a
-storage or distribution medium does not bring the other work under the scope
-of this License.
-
-3. You may copy and distribute the Program (or a work based on it, under
-Section 2) in object code or executable form under the terms of Sections 1
-and 2 above provided that you also do one of the following:
-
-a) Accompany it with the complete corresponding machine-readable source
-code, which must be distributed under the terms of Sections 1 and 2 above
-on a medium customarily used for software interchange; or,
-
-b) Accompany it with a written offer, valid for at least three years, to give
-any third party, for a charge no more than your cost of physically performing
-source distribution, a complete machine-readable copy of the corresponding
-source code, to be distributed under the terms of Sections 1 and 2 above on
-a medium customarily used for software interchange; or,
-
-c) Accompany it with the information you received as to the offer to distribute
-corresponding source code. (This alternative is allowed only for
-noncommercial distribution and only if you received the program in object
-code or executable form with such an offer, in accord with Subsection b
-above.)
+with the Program (or with a work based on the Program) on a volume of
+a storage or distribution medium does not bring the other work under
+the scope of this License.
+
+  3. You may copy and distribute the Program (or a work based on it,
+under Section 2) in object code or executable form under the terms of
+Sections 1 and 2 above provided that you also do one of the following:
+
+    a) Accompany it with the complete corresponding machine-readable
+    source code, which must be distributed under the terms of Sections
+    1 and 2 above on a medium customarily used for software interchange; or,
+
+    b) Accompany it with a written offer, valid for at least three
+    years, to give any third party, for a charge no more than your
+    cost of physically performing source distribution, a complete
+    machine-readable copy of the corresponding source code, to be
+    distributed under the terms of Sections 1 and 2 above on a medium
+    customarily used for software interchange; or,
+
+    c) Accompany it with the information you received as to the offer
+    to distribute corresponding source code.  (This alternative is
+    allowed only for noncommercial distribution and only if you
+    received the program in object code or executable form with such
+    an offer, in accord with Subsection b above.)
 
 The source code for a work means the preferred form of the work for
-making modifications to it. For an executable work, complete source code
-means all the source code for all modules it contains, plus any associated
-interface definition files, plus the scripts used to control compilation and
-installation of the executable. However, as a special exception, the source
-code distributed need not include anything that is normally distributed (in
-either source or binary form) with the major components (compiler, kernel,
-and so on) of the operating system on which the executable runs, unless that
-component itself accompanies the executable.
-
-If distribution of executable or object code is made by offering access to
-copy from a designated place, then offering equivalent access to copy the
-source code from the same place counts as distribution of the source code,
-even though third parties are not compelled to copy the source along with the
-object code.
-
-4. You may not copy, modify, sublicense, or distribute the Program except as
-expressly provided under this License. Any attempt otherwise to copy,
-modify, sublicense or distribute the Program is void, and will automatically
-terminate your rights under this License. However, parties who have received
-copies, or rights, from you under this License will not have their licenses
-terminated so long as such parties remain in full compliance.
-
-5. You are not required to accept this License, since you have not signed it.
-However, nothing else grants you permission to modify or distribute the
-Program or its derivative works. These actions are prohibited by law if you
-do not accept this License. Therefore, by modifying or distributing the
-Program (or any work based on the Program), you indicate your acceptance
-of this License to do so, and all its terms and conditions for copying,
-distributing or modifying the Program or works based on it.
-
-6. Each time you redistribute the Program (or any work based on the
-Program), the recipient automatically receives a license from the original
-licensor to copy, distribute or modify the Program subject to these terms and
-conditions. You may not impose any further restrictions on the recipients'
-exercise of the rights granted herein. You are not responsible for enforcing
-compliance by third parties to this License.
-
-7. If, as a consequence of a court judgment or allegation of patent
-infringement or for any other reason (not limited to patent issues), conditions
-are imposed on you (whether by court order, agreement or otherwise) that
-contradict the conditions of this License, they do not excuse you from the
-conditions of this License. If you cannot distribute so as to satisfy
-simultaneously your obligations under this License and any other pertinent
-obligations, then as a consequence you may not distribute the Program at all.
-For example, if a patent license would not permit royalty-free redistribution
-of the Program by all those who receive copies directly or indirectly through
-you, then the only way you could satisfy both it and this License would be to
+making modifications to it.  For an executable work, complete source
+code means all the source code for all modules it contains, plus any
+associated interface definition files, plus the scripts used to
+control compilation and installation of the executable.  However, as a
+special exception, the source code distributed need not include
+anything that is normally distributed (in either source or binary
+form) with the major components (compiler, kernel, and so on) of the
+operating system on which the executable runs, unless that component
+itself accompanies the executable.
+
+If distribution of executable or object code is made by offering
+access to copy from a designated place, then offering equivalent
+access to copy the source code from the same place counts as
+distribution of the source code, even though third parties are not
+compelled to copy the source along with the object code.
+
+  4. You may not copy, modify, sublicense, or distribute the Program
+except as expressly provided under this License.  Any attempt
+otherwise to copy, modify, sublicense or distribute the Program is
+void, and will automatically terminate your rights under this License.
+However, parties who have received copies, or rights, from you under
+this License will not have their licenses terminated so long as such
+parties remain in full compliance.
+
+  5. You are not required to accept this License, since you have not
+signed it.  However, nothing else grants you permission to modify or
+distribute the Program or its derivative works.  These actions are
+prohibited by law if you do not accept this License.  Therefore, by
+modifying or distributing the Program (or any work based on the
+Program), you indicate your acceptance of this License to do so, and
+all its terms and conditions for copying, distributing or modifying
+the Program or works based on it.
+
+  6. Each time you redistribute the Program (or any work based on the
+Program), the recipient automatically receives a license from the
+original licensor to copy, distribute or modify the Program subject to
+these terms and conditions.  You may not impose any further
+restrictions on the recipients' exercise of the rights granted herein.
+You are not responsible for enforcing compliance by third parties to
+this License.
+
+  7. If, as a consequence of a court judgment or allegation of patent
+infringement or for any other reason (not limited to patent issues),
+conditions are imposed on you (whether by court order, agreement or
+otherwise) that contradict the conditions of this License, they do not
+excuse you from the conditions of this License.  If you cannot
+distribute so as to satisfy simultaneously your obligations under this
+License and any other pertinent obligations, then as a consequence you
+may not distribute the Program at all.  For example, if a patent
+license would not permit royalty-free redistribution of the Program by
+all those who receive copies directly or indirectly through you, then
+the only way you could satisfy both it and this License would be to
 refrain entirely from distribution of the Program.
 
-If any portion of this section is held invalid or unenforceable under any
-particular circumstance, the balance of the section is intended to apply and
-the section as a whole is intended to apply in other circumstances.
-
-It is not the purpose of this section to induce you to infringe any patents or
-other property right claims or to contest validity of any such claims; this
-section has the sole purpose of protecting the integrity of the free software
-distribution system, which is implemented by public license practices. Many
-people have made generous contributions to the wide range of software
-distributed through that system in reliance on consistent application of that
-system; it is up to the author/donor to decide if he or she is willing to
-distribute software through any other system and a licensee cannot impose
-that choice.
-
-This section is intended to make thoroughly clear what is believed to be a
-consequence of the rest of this License.
-
-8. If the distribution and/or use of the Program is restricted in certain
-countries either by patents or by copyrighted interfaces, the original copyright
-holder who places the Program under this License may add an explicit
-geographical distribution limitation excluding those countries, so that
-distribution is permitted only in or among countries not thus excluded. In such
-case, this License incorporates the limitation as if written in the body of this
-License.
-
-9. The Free Software Foundation may publish revised and/or new versions
-of the General Public License from time to time. Such new versions will be
-similar in spirit to the present version, but may differ in detail to address new
-problems or concerns.
-
-Each version is given a distinguishing version number. If the Program specifies
-a version number of this License which applies to it and "any later version",
-you have the option of following the terms and conditions either of that
-version or of any later version published by the Free Software Foundation. If
-the Program does not specify a version number of this License, you may
-choose any version ever published by the Free Software Foundation.
-
-10. If you wish to incorporate parts of the Program into other free programs
-whose distribution conditions are different, write to the author to ask for
-permission. For software which is copyrighted by the Free Software
-Foundation, write to the Free Software Foundation; we sometimes make
-exceptions for this. Our decision will be guided by the two goals of
-preserving the free status of all derivatives of our free software and of
-promoting the sharing and reuse of software generally.
-
-               NO WARRANTY
-
-11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE,
-THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT
-PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE
-STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR
-OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT
-WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED,
-INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
-OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
-PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND
-PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
-PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL
-NECESSARY SERVICING, REPAIR OR CORRECTION.
-
-12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR
-AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR
-ANY OTHER PARTY WHO MAY MODIFY AND/OR
-REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE
-LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL,
-SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES
-ARISING OUT OF THE USE OR INABILITY TO USE THE
-PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA
-OR DATA BEING RENDERED INACCURATE OR LOSSES
-SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE
-PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN
-IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF
-THE POSSIBILITY OF SUCH DAMAGES.
-
-          END OF TERMS AND CONDITIONS
+If any portion of this section is held invalid or unenforceable under
+any particular circumstance, the balance of the section is intended to
+apply and the section as a whole is intended to apply in other
+circumstances.
+
+It is not the purpose of this section to induce you to infringe any
+patents or other property right claims or to contest validity of any
+such claims; this section has the sole purpose of protecting the
+integrity of the free software distribution system, which is
+implemented by public license practices.  Many people have made
+generous contributions to the wide range of software distributed
+through that system in reliance on consistent application of that
+system; it is up to the author/donor to decide if he or she is willing
+to distribute software through any other system and a licensee cannot
+impose that choice.
+
+This section is intended to make thoroughly clear what is believed to
+be a consequence of the rest of this License.
+
+  8. If the distribution and/or use of the Program is restricted in
+certain countries either by patents or by copyrighted interfaces, the
+original copyright holder who places the Program under this License
+may add an explicit geographical distribution limitation excluding
+those countries, so that distribution is permitted only in or among
+countries not thus excluded.  In such case, this License incorporates
+the limitation as if written in the body of this License.
+
+  9. The Free Software Foundation may publish revised and/or new versions
+of the General Public License from time to time.  Such new versions will
+be similar in spirit to the present version, but may differ in detail to
+address new problems or concerns.
+
+Each version is given a distinguishing version number.  If the Program
+specifies a version number of this License which applies to it and "any
+later version", you have the option of following the terms and conditions
+either of that version or of any later version published by the Free
+Software Foundation.  If the Program does not specify a version number of
+this License, you may choose any version ever published by the Free Software
+Foundation.
+
+  10. If you wish to incorporate parts of the Program into other free
+programs whose distribution conditions are different, write to the author
+to ask for permission.  For software which is copyrighted by the Free
+Software Foundation, write to the Free Software Foundation; we sometimes
+make exceptions for this.  Our decision will be guided by the two goals
+of preserving the free status of all derivatives of our free software and
+of promoting the sharing and reuse of software generally.
+
+                            NO WARRANTY
+
+  11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
+FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW.  EXCEPT WHEN
+OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
+PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
+OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.  THE ENTIRE RISK AS
+TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU.  SHOULD THE
+PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
+REPAIR OR CORRECTION.
+
+  12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
+WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
+REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
+INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
+OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
+TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
+YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
+PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
+POSSIBILITY OF SUCH DAMAGES.
+
+                     END OF TERMS AND CONDITIONS
+
+            How to Apply These Terms to Your New Programs
+
+  If you develop a new program, and you want it to be of the greatest
+possible use to the public, the best way to achieve this is to make it
+free software which everyone can redistribute and change under these terms.
+
+  To do so, attach the following notices to the program.  It is safest
+to attach them to the start of each source file to most effectively
+convey the exclusion of warranty; and each file should have at least
+the "copyright" line and a pointer to where the full notice is found.
+
+    <one line to give the program's name and a brief idea of what it does.>
+    Copyright (C) <year>  <name of author>
+
+    This program is free software; you can redistribute it and/or modify
+    it under the terms of the GNU General Public License as published by
+    the Free Software Foundation; either version 2 of the License, or
+    (at your option) any later version.
+
+    This program is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+    GNU General Public License for more details.
+
+    You should have received a copy of the GNU General Public License along
+    with this program; if not, write to the Free Software Foundation, Inc.,
+    51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+Also add information on how to contact you by electronic and paper mail.
+
+If the program is interactive, make it output a short notice like this
+when it starts in an interactive mode:
+
+    Gnomovision version 69, Copyright (C) year name of author
+    Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
+    This is free software, and you are welcome to redistribute it
+    under certain conditions; type `show c' for details.
+
+The hypothetical commands `show w' and `show c' should show the appropriate
+parts of the General Public License.  Of course, the commands you use may
+be called something other than `show w' and `show c'; they could even be
+mouse-clicks or menu items--whatever suits your program.
+
+You should also get your employer (if you work as a programmer) or your
+school, if any, to sign a "copyright disclaimer" for the program, if
+necessary.  Here is a sample; alter the names:
+
+  Yoyodyne, Inc., hereby disclaims all copyright interest in the program
+  `Gnomovision' (which makes passes at compilers) written by James Hacker.
+
+  <signature of Ty Coon>, 1 April 1989
+  Ty Coon, President of Vice
+
+This General Public License does not permit incorporating your program into
+proprietary programs.  If your program is a subroutine library, you may
+consider it more useful to permit linking proprietary applications with the
+library.  If this is what you want to do, use the GNU Lesser General
+Public License instead of this License.
diff --git a/MAINTAINERS.txt b/MAINTAINERS.txt
index 09d7cb78aecb141934cf98ae2d11b570c69dd8f1..30fa8275b4b8d50ed07024382e26748a74acf50f 100644
--- a/MAINTAINERS.txt
+++ b/MAINTAINERS.txt
@@ -33,6 +33,7 @@ Batch system
 
 Cache system
 - Damien Tournoud 'DamZ' <http://drupal.org/user/22211>
+- Nathaniel Catchpole 'catch' <http://drupal.org/user/35733>
 
 Cron system
 - Károly Négyesi 'chx' <http://drupal.org/user/9446>
diff --git a/UPGRADE.txt b/UPGRADE.txt
index d4909d8effa6ba00207baeaf775fac3f58fda09d..c6fee9874c83bddc6a3802b5d56edf22a97e5bdb 100644
--- a/UPGRADE.txt
+++ b/UPGRADE.txt
@@ -1,4 +1,3 @@
-
 INTRODUCTION
 ------------
 This document describes how to:
@@ -25,6 +24,11 @@ First steps and definitions:
     applying it to your live site. Even minor updates can cause your site's
     behavior to change.
 
+  * Each new release of Drupal has release notes, which explain the changes made
+    since the previous version and any special instructions needed to update or
+    upgrade to the new version. You can find a link to the release notes for the
+    version you are upgrading or updating to on the Drupal project page
+    (http://drupal.org/project/drupal).
 
 UPGRADE PROBLEMS
 ----------------
@@ -40,7 +44,6 @@ If you encounter errors during this process,
 
 More in-depth information on upgrading can be found at http://drupal.org/upgrade
 
-
 MINOR VERSION UPDATES
 ---------------------
 To update from one minor 7.x version of Drupal to any later 7.x version, after
@@ -58,11 +61,18 @@ following the instructions in the INTRODUCTION section at the top of this file:
    If you made modifications to files like .htaccess or robots.txt, you will
    need to re-apply them from your backup, after the new files are in place.
 
-   Sometimes an update includes changes to settings.php (this will be noted in
-   the release announcement). If that's the case, replace your old settings.php
-   with the new one, and copy the site-specific entries (especially the lines
-   giving the database name, user, and password) from the old settings.php to
-   the new settings.php.
+   Sometimes an update includes changes to default.settings.php (this will be
+   noted in the release notes). If that's the case, follow these steps:
+
+   - Make a backup copy of your settings.php file, with a different file name.
+
+   - Make a copy of the new default.settings.php file, and name the copy
+     settings.php (overwriting your previous settings.php file).
+
+   - Copy the custom and site-specific entries from the backup you made into the
+     new settings.php file. You will definitely need the lines giving the
+     database information, and you will also want to copy in any other
+     customizations you have added.
 
 4. Download the latest Drupal 7.x release from http://drupal.org to a
    directory outside of your web root. Extract the archive and copy the files
@@ -110,7 +120,6 @@ following the instructions in the INTRODUCTION section at the top of this file:
    Disable the "Put site into maintenance mode" checkbox and save the
    configuration.
 
-
 MAJOR VERSION UPGRADE
 ---------------------
 To upgrade from a previous major version of Drupal to Drupal 7.x, after
@@ -221,4 +230,3 @@ following the instructions in the INTRODUCTION section at the top of this file:
 
 To get started with Drupal 7 administration, visit
 http://drupal.org/getting-started/7/admin
-
diff --git a/authorize.php b/authorize.php
index cd3df50e653828b78790354a560e64c4c3779762..3c0bd7b36e270d0ad6a27db88ee833e0fbea6788 100644
--- a/authorize.php
+++ b/authorize.php
@@ -35,7 +35,7 @@ define('DRUPAL_ROOT', getcwd());
 define('MAINTENANCE_MODE', 'update');
 
 /**
- * Render a 403 access denied page for authorize.php
+ * Renders a 403 access denied page for authorize.php.
  */
 function authorize_access_denied_page() {
   drupal_add_http_header('Status', '403 Forbidden');
@@ -45,7 +45,7 @@ function authorize_access_denied_page() {
 }
 
 /**
- * Determine if the current user is allowed to run authorize.php.
+ * Determines if the current user is allowed to run authorize.php.
  *
  * The killswitch in settings.php overrides all else, otherwise, the user must
  * have access to the 'administer software updates' permission.
@@ -74,7 +74,7 @@ drupal_bootstrap(DRUPAL_BOOTSTRAP_SESSION);
 global $conf;
 
 // We have to enable the user and system modules, even to check access and
-// display errors via the maintainence theme.
+// display errors via the maintenance theme.
 $module_list['system']['filename'] = 'modules/system/system.module';
 $module_list['user']['filename'] = 'modules/user/user.module';
 module_list(TRUE, FALSE, FALSE, $module_list);
@@ -145,7 +145,7 @@ if (authorize_access_allowed()) {
         l(t('Front page'), '<front>'),
       ));
     }
-	
+
     $output .= theme('item_list', array('items' => $links, 'title' => t('Next steps')));
   }
   // If a batch is running, let it run.
@@ -172,4 +172,3 @@ else {
 if (!empty($output)) {
   print theme('update_page', array('content' => $output, 'show_messages' => $show_messages));
 }
-
diff --git a/includes/actions.inc b/includes/actions.inc
index c2fd4d96c7ac1dd03b77b594832bb2ff4a791897..760de8300b38b838b750d21602cc37446c086e56 100644
--- a/includes/actions.inc
+++ b/includes/actions.inc
@@ -311,7 +311,7 @@ function actions_synchronize($delete_orphans = FALSE) {
       $link = l(t('Remove orphaned actions'), 'admin/config/system/actions/orphan');
       $count = count($actions_in_db);
       $orphans = implode(', ', $orphaned);
-      watchdog('actions', '@count orphaned actions (%orphans) exist in the actions table. !link', array('@count' => $count, '%orphans' => $orphans, '!link' => $link), WATCHDOG_WARNING);
+      watchdog('actions', '@count orphaned actions (%orphans) exist in the actions table. !link', array('@count' => $count, '%orphans' => $orphans, '!link' => $link), WATCHDOG_INFO);
     }
   }
 }
diff --git a/includes/bootstrap.inc b/includes/bootstrap.inc
index b2d1a8ab56b4a937e42b6beb737ace41dd66dc5e..6fcced70f9ce4b583c59177fcf635504c31ff4b9 100644
--- a/includes/bootstrap.inc
+++ b/includes/bootstrap.inc
@@ -8,7 +8,7 @@
 /**
  * The current system version.
  */
-define('VERSION', '7.8');
+define('VERSION', '7.9');
 
 /**
  * Core API compatibility.
@@ -418,7 +418,7 @@ abstract class DrupalCacheArray implements ArrayAccess {
  * Start the timer with the specified name. If you start and stop the same
  * timer multiple times, the measured intervals will be accumulated.
  *
- * @param name
+ * @param $name
  *   The name of the timer.
  */
 function timer_start($name) {
@@ -431,8 +431,9 @@ function timer_start($name) {
 /**
  * Read the current timer value without stopping the timer.
  *
- * @param name
+ * @param $name
  *   The name of the timer.
+ *
  * @return
  *   The current timer value in ms.
  */
@@ -454,8 +455,9 @@ function timer_read($name) {
 /**
  * Stop the timer with the specified name.
  *
- * @param name
+ * @param $name
  *   The name of the timer.
+ *
  * @return
  *   A timer array. The array contains the number of times the timer has been
  *   started and stopped (count) and the accumulated timer value in ms (time).
@@ -489,22 +491,22 @@ function timer_stop($name) {
  * With a site located at http://www.example.com:8080/mysite/test/, the file,
  * settings.php, is searched for in the following directories:
  *
- *  1. $confdir/8080.www.example.com.mysite.test
- *  2. $confdir/www.example.com.mysite.test
- *  3. $confdir/example.com.mysite.test
- *  4. $confdir/com.mysite.test
+ * - $confdir/8080.www.example.com.mysite.test
+ * - $confdir/www.example.com.mysite.test
+ * - $confdir/example.com.mysite.test
+ * - $confdir/com.mysite.test
  *
- *  5. $confdir/8080.www.example.com.mysite
- *  6. $confdir/www.example.com.mysite
- *  7. $confdir/example.com.mysite
- *  8. $confdir/com.mysite
+ * - $confdir/8080.www.example.com.mysite
+ * - $confdir/www.example.com.mysite
+ * - $confdir/example.com.mysite
+ * - $confdir/com.mysite
  *
- *  9. $confdir/8080.www.example.com
- * 10. $confdir/www.example.com
- * 11. $confdir/example.com
- * 12. $confdir/com
+ * - $confdir/8080.www.example.com
+ * - $confdir/www.example.com
+ * - $confdir/example.com
+ * - $confdir/com
  *
- * 13. $confdir/default
+ * - $confdir/default
  *
  * If a file named sites.php is present in the $confdir, it will be loaded
  * prior to scanning for directories. It should define an associative array
@@ -848,7 +850,7 @@ function drupal_settings_initialize() {
 function drupal_get_filename($type, $name, $filename = NULL) {
   // The location of files will not change during the request, so do not use
   // drupal_static().
-  static $files = array();
+  static $files = array(), $dirs = array();
 
   if (!isset($files[$type])) {
     $files[$type] = array();
@@ -894,16 +896,19 @@ function drupal_get_filename($type, $name, $filename = NULL) {
         $extension = $type;
       }
 
-      if (!function_exists('drupal_system_listing')) {
-        require_once DRUPAL_ROOT . '/includes/common.inc';
-      }
-      // Scan the appropriate directories for all files with the requested
-      // extension, not just the file we are currently looking for. This
-      // prevents unnecessary scans from being repeated when this function is
-      // called more than once in the same page request.
-      $matches = drupal_system_listing("/^" . DRUPAL_PHP_FUNCTION_PATTERN . "\.$extension$/", $dir, 'name', 0);
-      foreach ($matches as $matched_name => $file) {
-        $files[$type][$matched_name] = $file->uri;
+      if (!isset($dirs[$dir][$extension])) {
+        $dirs[$dir][$extension] = TRUE;
+        if (!function_exists('drupal_system_listing')) {
+          require_once DRUPAL_ROOT . '/includes/common.inc';
+        }
+        // Scan the appropriate directories for all files with the requested
+        // extension, not just the file we are currently looking for. This
+        // prevents unnecessary scans from being repeated when this function is
+        // called more than once in the same page request.
+        $matches = drupal_system_listing("/^" . DRUPAL_PHP_FUNCTION_PATTERN . "\.$extension$/", $dir, 'name', 0);
+        foreach ($matches as $matched_name => $file) {
+          $files[$type][$matched_name] = $file->uri;
+        }
       }
     }
   }
@@ -1417,10 +1422,11 @@ function drupal_unpack($obj, $field = 'data') {
  * The t() function serves two purposes. First, at run-time it translates
  * user-visible text into the appropriate language. Second, various mechanisms
  * that figure out what text needs to be translated work off t() -- the text
- * inside t() calls is added to the database of strings to be translated. So,
- * to enable a fully-translatable site, it is important that all human-readable
- * text that will be displayed on the site or sent to a user is passed through
- * the t() function, or a related function. See the
+ * inside t() calls is added to the database of strings to be translated.
+ * These strings are expected to be in English, so the first argument should
+ * always be in English. To enable a fully-translatable site, it is important
+ * that all human-readable text that will be displayed on the site or sent to
+ * a user is passed through the t() function, or a related function. See the
  * @link http://drupal.org/node/322729 Localization API @endlink pages for
  * more information, including recommendations on how to break up or not
  * break up strings for translation.
@@ -1451,15 +1457,7 @@ function drupal_unpack($obj, $field = 'data') {
  *   A string containing the English string to translate.
  * @param $args
  *   An associative array of replacements to make after translation.
- *   Occurrences in $string of any key in $args are replaced with the
- *   corresponding value, after sanitization. The sanitization function depends
- *   on the first character of the key:
- *   - !variable: Inserted as is. Use this for text that has already been
- *     sanitized.
- *   - @variable: Escaped to HTML using check_plain(). Use this for anything
- *     displayed on a page on the site.
- *   - %variable: Escaped as a placeholder for user-submitted content using
- *     drupal_placeholder(), which shows up as <em>emphasized</em> text.
+ *   See format_string().
  * @param $options
  *   An associative array of additional options, with the following elements:
  *   - 'langcode' (defaults to the current language): The language code to
@@ -1505,26 +1503,50 @@ function t($string, array $args = array(), array $options = array()) {
     return $string;
   }
   else {
-    // Transform arguments before inserting them.
-    foreach ($args as $key => $value) {
-      switch ($key[0]) {
-        case '@':
-          // Escaped only.
-          $args[$key] = check_plain($value);
-          break;
+    return format_string($string, $args);
+  }
+}
 
-        case '%':
-        default:
-          // Escaped and placeholder.
-          $args[$key] = drupal_placeholder($value);
-          break;
+/**
+ * Replace placeholders with sanitized values in a string.
+ *
+ * @param $string
+ *   A string containing placeholders.
+ * @param $args
+ *   An associative array of replacements to make. Occurrences in $string of
+ *   any key in $args are replaced with the corresponding value, after
+ *   sanitization. The sanitization function depends on the first character of
+ *   the key:
+ *   - !variable: Inserted as is. Use this for text that has already been
+ *     sanitized.
+ *   - @variable: Escaped to HTML using check_plain(). Use this for anything
+ *     displayed on a page on the site.
+ *   - %variable: Escaped as a placeholder for user-submitted content using
+ *     drupal_placeholder(), which shows up as <em>emphasized</em> text.
+ *
+ * @see t()
+ * @ingroup sanitization
+ */
+function format_string($string, array $args = array()) {
+  // Transform arguments before inserting them.
+  foreach ($args as $key => $value) {
+    switch ($key[0]) {
+      case '@':
+        // Escaped only.
+        $args[$key] = check_plain($value);
+        break;
 
-        case '!':
-          // Pass-through.
-      }
+      case '%':
+      default:
+        // Escaped and placeholder.
+        $args[$key] = drupal_placeholder($value);
+        break;
+
+      case '!':
+        // Pass-through.
     }
-    return strtr($string, $args);
   }
+  return strtr($string, $args);
 }
 
 /**
@@ -1581,11 +1603,12 @@ function drupal_validate_utf8($text) {
 }
 
 /**
- * Since $_SERVER['REQUEST_URI'] is only available on Apache, we
- * generate an equivalent using other environment variables.
+ * Returns the equivalent of Apache's $_SERVER['REQUEST_URI'] variable.
+ *
+ * Because $_SERVER['REQUEST_URI'] is only available on Apache, we generate an
+ * equivalent using other environment variables.
  */
 function request_uri() {
-
   if (isset($_SERVER['REQUEST_URI'])) {
     $uri = $_SERVER['REQUEST_URI'];
   }
@@ -2426,6 +2449,34 @@ function drupal_maintenance_theme() {
   _drupal_maintenance_theme();
 }
 
+/**
+ * Returns a simple 404 Not Found page.
+ *
+ * If fast 404 pages are enabled, and this is a matching page then print a
+ * simple 404 page and exit.
+ *
+ * This function is called from drupal_deliver_html_page() at the time when a
+ * a normal 404 page is generated, but it can also optionally be called directly
+ * from settings.php to prevent a Drupal bootstrap on these pages. See
+ * documentation in settings.php for the benefits and drawbacks of using this.
+ *
+ * Paths to dynamically-generated content, such as image styles, should also be
+ * accounted for in this function.
+ */
+function drupal_fast_404() {
+  $exclude_paths = variable_get('404_fast_paths_exclude', FALSE);
+  if ($exclude_paths && !preg_match($exclude_paths, $_GET['q'])) {
+    $fast_paths = variable_get('404_fast_paths', FALSE);
+    if ($fast_paths && preg_match($fast_paths, $_GET['q'])) {
+      drupal_add_http_header('Status', '404 Not Found');
+      $fast_404_html = variable_get('404_fast_html', '<html xmlns="http://www.w3.org/1999/xhtml"><head><title>404 Not Found</title></head><body><h1>Not Found</h1><p>The requested URL "@path" was not found on this server.</p></body></html>');
+      // Replace @path in the variable with the page path.
+      print strtr($fast_404_html, array('@path' => check_plain(request_uri())));
+      exit;
+    }
+  }
+}
+
 /**
  * Return TRUE if a Drupal installation is currently being attempted.
  */
@@ -2445,7 +2496,7 @@ function drupal_installation_attempted() {
  * non-installation time, such as while installing the module from the the
  * module administration page.
  *
- * Example useage:
+ * Example usage:
  * @code
  *   $t = get_t();
  *   $translated = $t('translate this');
@@ -2473,6 +2524,7 @@ function get_t() {
  * Initialize all the defined language types.
  */
 function drupal_language_initialize() {
+  global $language;
   $types = language_types();
 
   // Ensure the language is correctly returned, even without multilanguage
@@ -2492,6 +2544,9 @@ function drupal_language_initialize() {
     // environments.
     bootstrap_invoke_all('language_init');
   }
+
+  // Send appropriate HTTP-Header for browsers and search engines.
+  header('Content-Language: ' . $language->language);
 }
 
 /**
@@ -2527,9 +2582,18 @@ function language_types() {
 }
 
 /**
- * Get a list of languages set up indexed by the specified key
+ * Returns a list of installed languages, indexed by the specified key.
  *
- * @param $field The field to index the list with.
+ * @param $field
+ *   (optional) The field to index the list with.
+ *
+ * @return
+ *   An associative array, keyed on the values of $field.
+ *   - If $field is 'weight' or 'enabled', the array is nested, with the outer
+ *     array's values each being associative arrays with language codes as
+ *     keys and language objects as values.
+ *   - For all other values of $field, the array is only one level deep, and
+ *     the array's values are language objects.
  */
 function language_list($field = 'language') {
   $languages = &drupal_static(__FUNCTION__);
@@ -2774,7 +2838,7 @@ class SchemaCache extends DrupalCacheArray {
 
   public function __construct() {
     // Cache by request method.
-    parent::__construct('schema:runtime:' . $_SERVER['REQUEST_METHOD'] == 'GET', 'cache');
+    parent::__construct('schema:runtime:' . ($_SERVER['REQUEST_METHOD'] == 'GET'), 'cache');
   }
 
   protected function resolveCacheMiss($offset) {
diff --git a/includes/common.inc b/includes/common.inc
index 1846c5b8c36a2f16cadd16654ebe4a8d8727f3a3..ae03957177c2a5f640f0ebf6d58b4145e9328d96 100644
--- a/includes/common.inc
+++ b/includes/common.inc
@@ -860,7 +860,7 @@ function drupal_http_request($url, array $options = array()) {
 
   // If the server URL has a user then attempt to use basic authentication.
   if (isset($uri['user'])) {
-    $options['headers']['Authorization'] = 'Basic ' . base64_encode($uri['user'] . (!empty($uri['pass']) ? ":" . $uri['pass'] : ''));
+    $options['headers']['Authorization'] = 'Basic ' . base64_encode($uri['user'] . (isset($uri['pass']) ? ':' . $uri['pass'] : ''));
   }
 
   // If the database prefix is being used by SimpleTest to run the tests in a copied
@@ -2199,8 +2199,9 @@ function url($path = NULL, array $options = array()) {
  */
 function url_is_external($path) {
   $colonpos = strpos($path, ':');
-  // Only call the slow drupal_strip_dangerous_protocols() if $path contains a
-  // ':' before any / ? or #.
+  // Avoid calling drupal_strip_dangerous_protocols() if there is any
+  // slash (/), hash (#) or question_mark (?) before the colon (:)
+  // occurrence - if any - as this would clearly mean it is not a URL.
   return $colonpos !== FALSE && !preg_match('![/?#]!', substr($path, 0, $colonpos)) && drupal_strip_dangerous_protocols($path) == $path;
 }
 
@@ -2478,6 +2479,9 @@ function drupal_deliver_html_page($page_callback_result) {
 
         watchdog('page not found', check_plain($_GET['q']), NULL, WATCHDOG_WARNING);
 
+        // Check for and return a fast 404 page if configured.
+        drupal_fast_404();
+
         // Keep old path for reference, and to allow forms to redirect to it.
         if (!isset($_GET['destination'])) {
           $_GET['destination'] = $_GET['q'];
@@ -2494,7 +2498,7 @@ function drupal_deliver_html_page($page_callback_result) {
         if (empty($return) || $return == MENU_NOT_FOUND || $return == MENU_ACCESS_DENIED) {
           // Standard 404 handler.
           drupal_set_title(t('Page not found'));
-          $return = t('The requested page could not be found.');
+          $return = t('The requested page "@path" could not be found.', array('@path' => request_uri()));
         }
 
         drupal_set_page_content($return);
@@ -3018,7 +3022,7 @@ function drupal_sort_css_js($a, $b) {
  * are always groupable, and items of the 'external' type are never groupable.
  * This function also ensures that the process of grouping items does not change
  * their relative order. This requirement may result in multiple groups for the
- * same type, media, and browsers, if needed to accomodate other items in
+ * same type, media, and browsers, if needed to accommodate other items in
  * between.
  *
  * @param $css
@@ -5518,15 +5522,24 @@ function drupal_render_page($page) {
  *
  * Recursively iterates over each of the array elements, generating HTML code.
  *
- * HTML generation is controlled by two properties containing theme functions,
- * #theme and #theme_wrappers.
+ * Renderable arrays have two kinds of key/value pairs: properties and
+ * children. Properties have keys starting with '#' and their values influence
+ * how the array will be rendered. Children are all elements whose keys do not
+ * start with a '#'. Their values should be renderable arrays themselves,
+ * which will be rendered during the rendering of the parent array. The markup
+ * provided by the children is typically inserted into the markup generated by
+ * the parent array.
+ *
+ * HTML generation for a renderable array, and the treatment of any children,
+ * is controlled by two properties containing theme functions, #theme and
+ * #theme_wrappers.
  *
  * #theme is the theme function called first. If it is set and the element has
- * any children, they have to be rendered there. For elements that are not
- * allowed to have any children, e.g. buttons or textfields, it can be used to
- * render the element itself. If #theme is not present and the element has
- * children, they are rendered and concatenated into a string by
- * drupal_render_children().
+ * any children, it is the responsibility of the theme function to render
+ * these children. For elements that are not allowed to have any children,
+ * e.g. buttons or textfields, the theme function can be used to render the
+ * element itself. If #theme is not present and the element has children, they
+ * are rendered and concatenated into a string by drupal_render_children().
  *
  * The #theme_wrappers property contains an array of theme functions which will
  * be called, in order, after #theme has run. These can be used to add further
@@ -6125,10 +6138,13 @@ function element_child($key) {
 }
 
 /**
- * Return the children of an element, optionally sorted by weight.
+ * Identifies the children of an element array, optionally sorted by weight.
+ *
+ * The children of a element array are those key/value pairs whose key does
+ * not start with a '#'. See drupal_render() for details.
  *
  * @param $elements
- *   The element to be sorted.
+ *   The element array whose children are to be identified.
  * @param $sort
  *   Boolean to indicate whether the children should be sorted by weight.
  * @return
@@ -6166,7 +6182,7 @@ function element_children(&$elements, $sort = FALSE) {
 }
 
 /**
- * Return the visibile children of an element.
+ * Returns the visible children of an element.
  *
  * @param $elements
  *   The parent element.
@@ -7571,44 +7587,30 @@ function entity_prepare_view($entity_type, $entities, $langcode = NULL) {
  *   uri of its own.
  */
 function entity_uri($entity_type, $entity) {
-  // This check enables the URI of an entity to be easily overridden from what
-  // the callback for the entity type or bundle would return, and it helps
-  // minimize performance overhead when entity_uri() is called multiple times
-  // for the same entity.
-  if (!isset($entity->uri)) {
-    $info = entity_get_info($entity_type);
-    list($id, $vid, $bundle) = entity_extract_ids($entity_type, $entity);
-
-    // A bundle-specific callback takes precedence over the generic one for the
-    // entity type.
-    if (isset($info['bundles'][$bundle]['uri callback'])) {
-      $uri_callback = $info['bundles'][$bundle]['uri callback'];
-    }
-    elseif (isset($info['uri callback'])) {
-      $uri_callback = $info['uri callback'];
-    }
-    else {
-      $uri_callback = NULL;
-    }
+  $info = entity_get_info($entity_type);
+  list($id, $vid, $bundle) = entity_extract_ids($entity_type, $entity);
 
-    // Invoke the callback to get the URI. If there is no callback, set the
-    // entity's 'uri' property to FALSE to indicate that it is known to not have
-    // a URI.
-    if (isset($uri_callback) && function_exists($uri_callback)) {
-      $entity->uri = $uri_callback($entity);
-      if (!isset($entity->uri['options'])) {
-        $entity->uri['options'] = array();
-      }
-      // Pass the entity data to url() so that alter functions do not need to
-      // lookup this entity again.
-      $entity->uri['options']['entity_type'] = $entity_type;
-      $entity->uri['options']['entity'] = $entity;
-    }
-    else {
-      $entity->uri = FALSE;
-    }
+  // A bundle-specific callback takes precedence over the generic one for the
+  // entity type.
+  if (isset($info['bundles'][$bundle]['uri callback'])) {
+    $uri_callback = $info['bundles'][$bundle]['uri callback'];
+  }
+  elseif (isset($info['uri callback'])) {
+    $uri_callback = $info['uri callback'];
+  }
+  else {
+    return NULL;
+  }
+
+  // Invoke the callback to get the URI. If there is no callback, return NULL.
+  if (isset($uri_callback) && function_exists($uri_callback)) {
+    $uri = $uri_callback($entity);
+    // Pass the entity data to url() so that alter functions do not need to
+    // lookup this entity again.
+    $uri['options']['entity_type'] = $entity_type;
+    $uri['options']['entity'] = $entity;
+    return $uri;
   }
-  return $entity->uri ? $entity->uri : NULL;
 }
 
 /**
diff --git a/includes/database/database.inc b/includes/database/database.inc
index 610861429d1b0a102269dc1b3925ed71cfc293c4..33000aa706ec3dab523b7903e6b05c799f4c534b 100644
--- a/includes/database/database.inc
+++ b/includes/database/database.inc
@@ -152,7 +152,7 @@
  *   }
  *
  *   // $txn goes out of scope here.  Unless the transaction was rolled back, it
- *   // gets automatically commited here.
+ *   // gets automatically committed here.
  * }
  *
  * function my_other_function($id) {
@@ -1899,21 +1899,19 @@ class DatabaseTransaction {
 }
 
 /**
- * A prepared statement.
+ * Represents a prepared statement.
  *
- * Some methods in that class are purposely commented out. Due to a change in
+ * Some methods in that class are purposefully commented out. Due to a change in
  * how PHP defines PDOStatement, we can't define a signature for those methods
  * that will work the same way between versions older than 5.2.6 and later
- * versions.
- *
- * Please refer to http://bugs.php.net/bug.php?id=42452 for more details.
+ * versions.  See http://bugs.php.net/bug.php?id=42452 for more details.
  *
  * Child implementations should either extend PDOStatement:
  * @code
  * class DatabaseStatement_oracle extends PDOStatement implements DatabaseStatementInterface {}
  * @endcode
- * or implement their own class, but in that case they will also have to
- * implement the Iterator or IteratorArray interfaces before
+ * or define their own class. If defining their own class, they will also have
+ * to implement either the Iterator or IteratorAggregate interface before
  * DatabaseStatementInterface:
  * @code
  * class DatabaseStatement_oracle implements Iterator, DatabaseStatementInterface {}
@@ -1997,7 +1995,7 @@ interface DatabaseStatementInterface extends Traversable {
    *   The numeric index of the field to return. Defaults to the first field.
    *
    * @return
-   *   A single field from the next record.
+   *   A single field from the next record, or FALSE if there is no next record.
    */
   public function fetchField($index = 0);
 
@@ -2017,7 +2015,7 @@ interface DatabaseStatementInterface extends Traversable {
    * helper method, so one is added.
    *
    * @return
-   *   An associative array.
+   *   An associative array, or FALSE if there is no next row.
    */
   public function fetchAssoc();
 
@@ -2045,7 +2043,7 @@ interface DatabaseStatementInterface extends Traversable {
    *   The index of the column number to fetch.
    *
    * @return
-   *   An indexed array.
+   *   An indexed array, or an empty array if there is no result set.
    */
   public function fetchCol($index = 0);
 
@@ -2065,7 +2063,7 @@ interface DatabaseStatementInterface extends Traversable {
    *   The numeric index of the field to use as the array value.
    *
    * @return
-   *   An associative array.
+   *   An associative array, or an empty array if there is no result set.
    */
   public function fetchAllKeyed($key_index = 0, $value_index = 1);
 
@@ -2084,7 +2082,7 @@ interface DatabaseStatementInterface extends Traversable {
    *   set for the query will be used.
    *
    * @return
-   *   An associative array.
+   *   An associative array, or an empty array if there is no result set.
    */
   public function fetchAllAssoc($key, $fetch = NULL);
 }
diff --git a/includes/database/mysql/database.inc b/includes/database/mysql/database.inc
index 0d9158789bbadd196172444fd7b7fa8ed4b661ae..7d5d85998dbd53bafcf5458458c5c18bc96f1dc7 100644
--- a/includes/database/mysql/database.inc
+++ b/includes/database/mysql/database.inc
@@ -60,8 +60,10 @@ class DatabaseConnection_mysql extends DatabaseConnection {
     // This allows Drupal to run almost seamlessly on many different
     // kinds of database systems. These settings force MySQL to behave
     // the same as postgresql, or sqlite in regards to syntax interpretation
-    // and invalid data handling. See http://drupal.org/node/344575 for further discussion.
-    $this->exec("SET sql_mode='ANSI,TRADITIONAL'");
+    // and invalid data handling. See http://drupal.org/node/344575 for
+    // further discussion. Also, as MySQL 5.5 changed the meaning of
+    // TRADITIONAL we need to spell out the modes one by one.
+    $this->exec("SET sql_mode='ANSI,STRICT_TRANS_TABLES,STRICT_ALL_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER'");
   }
 
   public function queryRange($query, $from, $count, array $args = array(), array $options = array()) {
diff --git a/includes/database/prefetch.inc b/includes/database/prefetch.inc
index f378d35559ef77a43b3c5d951208e55881029021..4f2b19d1f3d1882c19dbef6264cfb52511ca149a 100644
--- a/includes/database/prefetch.inc
+++ b/includes/database/prefetch.inc
@@ -370,7 +370,7 @@ class DatabaseStatementPrefetch implements Iterator, DatabaseStatementInterface
     }
   }
 
-  public function fetchField($index = 0) {
+  public function fetchColumn($index = 0) {
     if (isset($this->currentRow) && isset($this->columnNames[$index])) {
       // We grab the value directly from $this->data, and format it.
       $return = $this->currentRow[$this->columnNames[$index]];
@@ -382,6 +382,10 @@ class DatabaseStatementPrefetch implements Iterator, DatabaseStatementInterface
     }
   }
 
+  public function fetchField($index = 0) {
+    return $this->fetchColumn($index);
+  }
+
   public function fetchObject($class_name = NULL, $constructor_args = array()) {
     if (isset($this->currentRow)) {
       if (!isset($class_name)) {
diff --git a/includes/database/query.inc b/includes/database/query.inc
index c7363f2381cd9a0d64da3f74d79d69aea9033d03..c779687679a7a0135b78a68264e87aeff3f2e611 100644
--- a/includes/database/query.inc
+++ b/includes/database/query.inc
@@ -839,7 +839,7 @@ class DeleteQuery extends Query implements QueryConditionInterface {
    * Executes the DELETE query.
    *
    * @return
-   *   The return value is dependant on the database connection.
+   *   The return value is dependent on the database connection.
    */
   public function execute() {
     $values = array();
diff --git a/includes/database/sqlite/database.inc b/includes/database/sqlite/database.inc
index 0fc0b5528f3a6f1a81d1a14c7af2576265c488f2..3e2490b00cab86bde2d47b00919ca1e457210a31 100644
--- a/includes/database/sqlite/database.inc
+++ b/includes/database/sqlite/database.inc
@@ -119,7 +119,7 @@ class DatabaseConnection_sqlite extends DatabaseConnection {
         try {
           $count = $this->query('SELECT COUNT(*) FROM ' . $prefix . '.sqlite_master WHERE type = :type AND name NOT LIKE :pattern', array(':type' => 'table', ':pattern' => 'sqlite_%'))->fetchField();
 
-          // We can prune the database file if it doens't have any tables.
+          // We can prune the database file if it doesn't have any tables.
           if ($count == 0) {
             // Detach the database.
             $this->query('DETACH DATABASE :schema', array(':schema' => $prefix));
diff --git a/includes/database/sqlite/schema.inc b/includes/database/sqlite/schema.inc
index 3c8cd3f554a170219677f4c5b2f17b75c2f8e84c..c5882f12715d9c31933961c94b4f009ed773cccd 100644
--- a/includes/database/sqlite/schema.inc
+++ b/includes/database/sqlite/schema.inc
@@ -672,9 +672,10 @@ class DatabaseSchema_sqlite extends DatabaseSchema {
     // Don't add the prefix, $table_expression already includes the prefix.
     $info = $this->getPrefixInfo($table_expression, FALSE);
 
-    // Can't use query placeholders because the query would have to be
-    // :prefixsqlite_master, which does not work.
-    $result = db_query("SELECT name FROM " . $info['schema'] . ".sqlite_master WHERE name LIKE :table_name", array(
+    // Can't use query placeholders for the schema because the query would have
+    // to be :prefixsqlite_master, which does not work.
+    $result = db_query("SELECT name FROM " . $info['schema'] . ".sqlite_master WHERE type = :type AND name LIKE :table_name", array(
+      ':type' => 'table',
       ':table_name' => $info['table'],
     ));
     return $result->fetchAllKeyed(0, 0);
diff --git a/includes/entity.inc b/includes/entity.inc
index 67225bc7e5850cbec9b64ecf56a7fa67f68e9966..07ee06162c80123bdc30563d4b9283408a24bce7 100644
--- a/includes/entity.inc
+++ b/includes/entity.inc
@@ -307,7 +307,7 @@ class DrupalDefaultEntityController implements DrupalEntityControllerInterface {
    * @param $queried_entities
    *   Associative array of query results, keyed on the entity ID.
    * @param $revision_id
-   *   ID of the revision that was loaded, or FALSE if teh most current revision
+   *   ID of the revision that was loaded, or FALSE if the most current revision
    *   was loaded.
    */
   protected function attachLoad(&$queried_entities, $revision_id = FALSE) {
@@ -606,18 +606,25 @@ class EntityFieldQuery {
    *   dependent on $operator.
    * @param $operator
    *   Possible values:
-   *   - '=', '!=', '>', '>=', '<', '<=', 'STARTS_WITH', 'CONTAINS': These
+   *   - '=', '<>', '>', '>=', '<', '<=', 'STARTS_WITH', 'CONTAINS': These
    *     operators expect $value to be a literal of the same type as the
    *     column.
    *   - 'IN', 'NOT IN': These operators expect $value to be an array of
    *     literals of the same type as the column.
    *   - 'BETWEEN': This operator expects $value to be an array of two literals
    *     of the same type as the column.
+   *   The operator can be omitted, and will default to 'IN' if the value is an
+   *   array, or to '=' otherwise.
    *
    * @return EntityFieldQuery
    *   The called object.
    */
   public function entityCondition($name, $value, $operator = NULL) {
+    // The '!=' operator is deprecated in favour of the '<>' operator since the
+    // latter is ANSI SQL compatible.
+    if ($operator == '!=') {
+      $operator = '<>';
+    }
     $this->entityConditions[$name] = array(
       'value' => $value,
       'operator' => $operator,
@@ -722,13 +729,15 @@ class EntityFieldQuery {
    *   element in the array is dependent on $operator.
    * @param $operator
    *   Possible values:
-   *   - '=', '!=', '>', '>=', '<', '<=', 'STARTS_WITH', 'CONTAINS': These
+   *   - '=', '<>', '>', '>=', '<', '<=', 'STARTS_WITH', 'CONTAINS': These
    *     operators expect $value to be a literal of the same type as the
    *     column.
    *   - 'IN', 'NOT IN': These operators expect $value to be an array of
    *     literals of the same type as the column.
    *   - 'BETWEEN': This operator expects $value to be an array of two literals
    *     of the same type as the column.
+   *   The operator can be omitted, and will default to 'IN' if the value is an
+   *   array, or to '=' otherwise.
    * @param $delta_group
    *   An arbitrary identifier: conditions in the same group must have the same
    *   $delta_group. For example, let's presume a multivalue field which has
@@ -747,6 +756,11 @@ class EntityFieldQuery {
    *   The called object.
    */
   protected function addFieldCondition(&$conditions, $field, $column = NULL, $value = NULL, $operator = NULL, $delta_group = NULL, $language_group = NULL) {
+    // The '!=' operator is deprecated in favour of the '<>' operator since the
+    // latter is ANSI SQL compatible.
+    if ($operator == '!=') {
+      $operator = '<>';
+    }
     if (is_scalar($field)) {
       $field_definition = field_info_field($field);
       if (empty($field_definition)) {
@@ -787,7 +801,7 @@ class EntityFieldQuery {
    *   array is dependent on $operator.
    * @param $operator
    *   Possible values:
-   *   - '=', '!=', '>', '>=', '<', '<=', 'STARTS_WITH', 'CONTAINS': These
+   *   - '=', '<>', '>', '>=', '<', '<=', 'STARTS_WITH', 'CONTAINS': These
    *     operators expect $value to be a literal of the same type as the
    *     column.
    *   - 'IN', 'NOT IN': These operators expect $value to be an array of
@@ -801,6 +815,11 @@ class EntityFieldQuery {
    *   The called object.
    */
   public function propertyCondition($column, $value, $operator = NULL) {
+    // The '!=' operator is deprecated in favour of the '<>' operator since the
+    // latter is ANSI SQL compatible.
+    if ($operator == '!=') {
+      $operator = '<>';
+    }
     $this->propertyConditions[] = array(
       'column' => $column,
       'value' => $value,
diff --git a/includes/errors.inc b/includes/errors.inc
index bd31bebed10e9be28843ac51a350200247fc9eb1..cb708d8604200ec2f90e93923ab3ac1da9d36fac 100644
--- a/includes/errors.inc
+++ b/includes/errors.inc
@@ -136,7 +136,7 @@ function _drupal_decode_exception($exception) {
 }
 
 /**
- * Render an error message for an exception without any possibility of a further exception occuring.
+ * Render an error message for an exception without any possibility of a further exception occurring.
  *
  * @param $exception
  *   The exception object that was thrown.
diff --git a/includes/file.inc b/includes/file.inc
index 4fb56e8a4a516a044087c4db15abaaa7d2dc50f4..40e8349a0903ae625580be90f48b59b8e6872bca 100644
--- a/includes/file.inc
+++ b/includes/file.inc
@@ -605,7 +605,8 @@ function file_save(stdClass $file) {
  *
  * @return
  *   A nested array with usage data. The first level is keyed by module name,
- *   the second by object type, the third has 'id' and 'count' keys.
+ *   the second by object type and the third by the object id. The value
+ *   of the third level contains the usage count.
  *
  * @see file_usage_add()
  * @see file_usage_delete()
@@ -618,7 +619,7 @@ function file_usage_list(stdClass $file) {
     ->execute();
   $references = array();
   foreach ($result as $usage) {
-    $references[$usage->module][$usage->type] = array('id' => $usage->id, 'count' => $usage->count);
+    $references[$usage->module][$usage->type][$usage->id] = $usage->count;
   }
   return $references;
 }
@@ -2191,27 +2192,32 @@ function drupal_unlink($uri, $context = NULL) {
 }
 
 /**
- * Returns the absolute path of a file or directory
+ * Returns the absolute local filesystem path of a stream URI.
  *
- * PHP's realpath() does not properly support streams, so this function
- * fills that gap. If a stream wrapped URI is provided, it will be passed
- * to the registered wrapper for handling. If the URI does not contain a
- * scheme or the wrapper implementation does not implement realpath, then
- * FALSE will be returned.
+ * This function was originally written to ease the conversion of 6.x code to
+ * use 7.x stream wrappers. However, it assumes that every URI may be resolved
+ * to an absolute local filesystem path, and this assumption fails when stream
+ * wrappers are used to support remote file storage. Remote stream wrappers
+ * may implement the realpath method by always returning FALSE. The use of
+ * drupal_realpath() is discouraged, and is slowly being removed from core
+ * functions where possible.
  *
- * @see http://php.net/manual/en/function.realpath.php
- *
- * Compatibility: normal paths and stream wrappers.
- * @see http://drupal.org/node/515192
+ * Only use this function if you know that the stream wrapper in the URI uses
+ * the local file system, and you need to pass an absolute path to a function
+ * that is incompatible with stream URIs.
  *
  * @param $uri
- *   A string containing the URI to verify.
+ *   A stream wrapper URI or a filesystem path, possibly including one or more
+ *   symbolic links.
  *
  * @return
- *   The absolute pathname, or FALSE on failure.
+ *   The absolute local filesystem path (with no symbolic links), or FALSE on
+ *   failure.
  *
- * @see realpath()
+ * @see DrupalStreamWrapperInterface::realpath()
+ * @see http://php.net/manual/function.realpath.php
  * @ingroup php_wrappers
+ * @todo: This function is deprecated, and should be removed wherever possible.
  */
 function drupal_realpath($uri) {
   // If this URI is a stream, pass it off to the appropriate stream wrapper.
diff --git a/includes/file.mimetypes.inc b/includes/file.mimetypes.inc
index 8509433bee6fd303a8af7adb34aab3eb7b39545d..7468a60af420ff812033022791c6e42f4524e626 100644
--- a/includes/file.mimetypes.inc
+++ b/includes/file.mimetypes.inc
@@ -373,6 +373,7 @@ function file_default_mimetype_mapping() {
       333 => 'video/vnd.mpegurl',
       347 => 'video/x-flv',
       334 => 'video/x-la-asf',
+      348 => 'video/x-m4v',
       335 => 'video/x-mng',
       336 => 'video/x-ms-asf',
       337 => 'video/x-ms-wm',
@@ -852,6 +853,7 @@ function file_default_mimetype_mapping() {
       'f4a' => 346,
       'f4b' => 346,
       'flv' => 347,
+      'm4v' => 348,
     ),
   );
 }
diff --git a/includes/form.inc b/includes/form.inc
index df1b2f73bc400519a8e8f76d899e6a2dbdf02b9a..e0bc9cba0b2d5c3e5879e345d4ca6d8c4ce5073a 100644
--- a/includes/form.inc
+++ b/includes/form.inc
@@ -76,7 +76,7 @@
  * workflow, see the
  * @link http://api.drupal.org/api/drupal/developer--topics--forms_api_reference.html Form API reference @endlink
  * and the
- * @link http://drupal.org/node/37775 Form API section of the handbook. @endlink
+ * @link http://drupal.org/node/37775 Form API documentation section. @endlink
  * In addition, there is a set of Form API tutorials in
  * @link form_example_tutorial.inc the Form Example Tutorial @endlink which
  * provide basics all the way up through multistep forms.
@@ -86,73 +86,7 @@
  * passed by reference to most functions, so they use it to communicate with
  * the form system and each other.
  *
- * The $form_state keys are:
- * - build_info: Do not change; internal information stored by Form API to be
- *   able to build and rebuild the form:
- *   - args: A list of arguments used to rebuild the form from cache.
- *   - files: A list of include files to be loaded to rebuild the form. See
- *     form_load_include().
- * - 'values': An associative array of values submitted to the form. The
- *   validation functions and submit functions use this array for nearly all
- *   their decision making. (Note that
- *   @link http://api.drupal.org/api/drupal/developer--topics--forms_api_reference.html/7#tree #tree @endlink
- *   determines whether the values are a flat array or an array whose structure
- *   parallels the $form array.)
- * - 'rebuild': If the submit function sets $form_state['rebuild'] to TRUE,
- *   submission is not completed and instead the form is rebuilt using any
- *   information that the submit function has made available to the form builder
- *   function via $form_state. This is commonly used for wizard-style
- *   multi-step forms, add-more buttons, and the like. For further information
- *   see drupal_build_form().
- * - 'redirect': $form_state['redirect'] is used to redirect the form on
- *   submission. It may either be a string containing the destination URL, or
- *   an array of arguments compatible with drupal_goto(). See
- *   drupal_redirect_form() for complete information.
- * - 'storage': $form_state['storage'] is not a special key, and no specific
- *   support is provided for it in the Form API, but by tradition it was
- *   the location where application-specific data was stored for communication
- *   between the submit, validation, and form builder functions, especially
- *   in a multi-step-style form. Form implementations may use any key(s) within
- *   $form_state (other than the keys listed here and other reserved ones used
- *   by Form API internals) for this kind of storage. The recommended way to
- *   ensure that the chosen key doesn't conflict with ones used by the Form API
- *   or other modules is to use the module name as the key name or a prefix for
- *   the key name. For example, the Node module uses $form_state['node'] in node
- *   editing forms to store information about the node being edited, and this
- *   information stays available across successive clicks of the "Preview"
- *   button as well as when the "Save" button is finally clicked.
- * - 'temporary': Since values for all non-reserved keys in $form_state persist
- *   throughout a multistep form sequence, the Form API provides the 'temporary'
- *   key for modules to use for communicating information across form-related
- *   functions during a single page request only. There is no use-case for this
- *   functionality in core.
- * - 'triggering_element': (read-only) The form element that triggered
- *   submission. This is the same as the deprecated
- *   $form_state['clicked_button']. It is the element that caused submission,
- *   which may or may not be a button (in the case of Ajax forms.) This is
- *   often used to distinguish between various buttons in a submit handler,
- *   and is also used in Ajax handlers.
- * - 'cache': The typical form workflow involves two page requests. During the
- *   first page request, a form is built and returned for the user to fill in.
- *   Then the user fills the form in and submits it, triggering a second page
- *   request in which the form must be built and processed. By default, $form
- *   and $form_state are built from scratch during each of these page requests.
- *   In some special use-cases, it is necessary or desired to persist the $form
- *   and $form_state variables from the initial page request to the one that
- *   processes the submission. A form builder function can set 'cache' to TRUE
- *   to do this. One example where this is needed is to handle Ajax submissions,
- *   so ajax_process_form() sets this for all forms that include an element with
- *   a #ajax property. (In Ajax, the handler has no way to build the form
- *   itself, so must rely on the cached version created on each page load, so
- *   it's a classic example of this use case.) Note that the persistence of
- *   $form and $form_state across successive submissions of a multi-step form
- *   happens automatically regardless of the value for 'cache'.
- * - 'input': The array of values as they were submitted by the user. These are
- *   raw and unvalidated, so should not be used without a thorough understanding
- *   of security implications. In almost all cases, code should use the data in
- *   the 'values' array exclusively. The most common use of this key is for
- *   multi-step forms that need to clear some of the user input when setting
- *   'rebuild'.
+ * See drupal_build_form() for documentation of $form_state keys.
  */
 
 /**
@@ -211,22 +145,25 @@ function drupal_get_form($form_id) {
  *   persist across page requests when the 'cache' or 'rebuild' flag is set.
  *   The following parameters may be set in $form_state to affect how the form
  *   is rendered:
- *   - build_info: A keyed array of build information that is necessary to
- *     rebuild the form from cache when the original context may no longer be
- *     available:
- *     - args: An array of arguments to pass to the form builder.
+ *   - build_info: Internal. An associative array of information stored by Form
+ *     API that is necessary to build and rebuild the form from cache when the
+ *     original context may no longer be available:
+ *     - args: A list of arguments to pass to the form constructor.
  *     - files: An optional array defining include files that need to be loaded
  *       for building the form. Each array entry may be the path to a file or
  *       another array containing values for the parameters 'type', 'module' and
  *       'name' as needed by module_load_include(). The files listed here are
  *       automatically loaded by form_get_cache(). By default the current menu
- *       router item's 'file' definition is added, if existent.
+ *       router item's 'file' definition is added, if any. Use
+ *       form_load_include() to add include files from a form constructor.
+ *   - rebuild_info: Internal. Similar to 'build_info', but pertaining to
+ *     drupal_rebuild_form().
  *   - rebuild: Normally, after the entire form processing is completed and
- *     submit handlers ran, a form is considered to be done and
+ *     submit handlers have run, a form is considered to be done and
  *     drupal_redirect_form() will redirect the user to a new page using a GET
  *     request (so a browser refresh does not re-submit the form). However, if
  *     'rebuild' has been set to TRUE, then a new copy of the form is
- *     immediately built and sent to the browser; instead of a redirect. This is
+ *     immediately built and sent to the browser, instead of a redirect. This is
  *     used for multi-step forms, such as wizards and confirmation forms.
  *     Normally, $form_state['rebuild'] is set by a submit handler, since it is
  *     usually logic within a submit handler that determines whether a form is
@@ -234,32 +171,107 @@ function drupal_get_form($form_id) {
  *     set $form_state['rebuild'] to cause the form processing to bypass submit
  *     handlers and rebuild the form instead, even if there are no validation
  *     errors.
- *   - input: An array of input that corresponds to $_POST or $_GET, depending
- *     on the 'method' chosen (see below).
+ *   - redirect: Used to redirect the form on submission. It may either be a
+ *     string containing the destination URL, or an array of arguments
+ *     compatible with drupal_goto(). See drupal_redirect_form() for complete
+ *     information.
+ *   - no_redirect: If set to TRUE the form will NOT perform a drupal_goto(),
+ *     even if 'redirect' is set.
  *   - method: The HTTP form method to use for finding the input for this form.
  *     May be 'post' or 'get'. Defaults to 'post'. Note that 'get' method
  *     forms do not use form ids so are always considered to be submitted, which
  *     can have unexpected effects. The 'get' method should only be used on
- *     forms that do not change data, as that is exclusively the domain of post.
- *   - no_redirect: If set to TRUE the form will NOT perform a drupal_goto(),
- *     even if 'redirect' is set.
+ *     forms that do not change data, as that is exclusively the domain of
+ *     'post.'
  *   - cache: If set to TRUE the original, unprocessed form structure will be
- *     cached, which allows to rebuild the entire form from cache.
+ *     cached, which allows the entire form to be rebuilt from cache. A typical
+ *     form workflow involves two page requests; first, a form is built and
+ *     rendered for the user to fill in. Then, the user fills the form in and
+ *     submits it, triggering a second page request in which the form must be
+ *     built and processed. By default, $form and $form_state are built from
+ *     scratch during each of these page requests. Often, it is necessary or
+ *     desired to persist the $form and $form_state variables from the initial
+ *     page request to the one that processes the submission. 'cache' can be set
+ *     to TRUE to do this. A prominent example is an Ajax-enabled form, in which
+ *     ajax_process_form() enables form caching for all forms that include an
+ *     element with the #ajax property. (The Ajax handler has no way to build
+ *     the form itself, so must rely on the cached version.) Note that the
+ *     persistence of $form and $form_state happens automatically for
+ *     (multi-step) forms having the 'rebuild' flag set, regardless of the value
+ *     for 'cache'.
  *   - no_cache: If set to TRUE the form will NOT be cached, even if 'cache' is
  *     set.
+ *   - values: An associative array of values submitted to the form. The
+ *     validation functions and submit functions use this array for nearly all
+ *     their decision making. (Note that
+ *     @link http://api.drupal.org/api/drupal/developer--topics--forms_api_reference.html/7#tree #tree @endlink
+ *     determines whether the values are a flat array or an array whose structure
+ *     parallels the $form array.)
+ *   - input: The array of values as they were submitted by the user. These are
+ *     raw and unvalidated, so should not be used without a thorough
+ *     understanding of security implications. In almost all cases, code should
+ *     use the data in the 'values' array exclusively. The most common use of
+ *     this key is for multi-step forms that need to clear some of the user
+ *     input when setting 'rebuild'. The values correspond to $_POST or $_GET,
+ *     depending on the 'method' chosen.
  *   - always_process: If TRUE and the method is GET, a form_id is not
  *     necessary. This should only be used on RESTful GET forms that do NOT
  *     write data, as this could lead to security issues. It is useful so that
  *     searches do not need to have a form_id in their query arguments to
  *     trigger the search.
- *   - must_validate: Ordinarily, a form is only validated once but there are
+ *   - must_validate: Ordinarily, a form is only validated once, but there are
  *     times when a form is resubmitted internally and should be validated
  *     again. Setting this to TRUE will force that to happen. This is most
- *     likely to occur during AHAH or Ajax operations.
+ *     likely to occur during Ajax operations.
+ *   - programmed: If TRUE, the form was submitted programmatically, usually
+ *     invoked via drupal_form_submit(). Defaults to FALSE.
+ *   - process_input: Boolean flag. TRUE signifies correct form submission.
+ *     This is always TRUE for programmed forms coming from drupal_form_submit()
+ *     (see 'programmed' key), or if the form_id coming from the $_POST data is
+ *     set and matches the current form_id.
+ *   - submitted: If TRUE, the form has been submitted. Defaults to FALSE.
+ *   - executed: If TRUE, the form was submitted and has been processed and
+ *     executed. Defaults to FALSE.
+ *   - triggering_element: (read-only) The form element that triggered
+ *     submission. This is the same as the deprecated
+ *     $form_state['clicked_button']. It is the element that caused submission,
+ *     which may or may not be a button (in the case of Ajax forms). This key is
+ *     often used to distinguish between various buttons in a submit handler,
+ *     and is also used in Ajax handlers.
+ *   - clicked_button: Deprecated. Use triggering_element instead.
+ *   - has_file_element: Internal. If TRUE, there is a file element and Form API
+ *     will set the appropriate 'enctype' HTML attribute on the form.
+ *   - groups: Internal. An array containing references to fieldsets to render
+ *     them within vertical tabs.
+ *   - storage: $form_state['storage'] is not a special key, and no specific
+ *     support is provided for it in the Form API. By tradition it was
+ *     the location where application-specific data was stored for communication
+ *     between the submit, validation, and form builder functions, especially
+ *     in a multi-step-style form. Form implementations may use any key(s)
+ *     within $form_state (other than the keys listed here and other reserved
+ *     ones used by Form API internals) for this kind of storage. The
+ *     recommended way to ensure that the chosen key doesn't conflict with ones
+ *     used by the Form API or other modules is to use the module name as the
+ *     key name or a prefix for the key name. For example, the Node module uses
+ *     $form_state['node'] in node editing forms to store information about the
+ *     node being edited, and this information stays available across successive
+ *     clicks of the "Preview" button as well as when the "Save" button is
+ *     finally clicked.
+ *   - buttons: A list containing copies of all submit and button elements in
+ *     the form.
+ *   - complete form: A reference to the $form variable containing the complete
+ *     form structure. #process, #after_build, #element_validate, and other
+ *     handlers being invoked on a form element may use this reference to access
+ *     other information in the form the element is contained in.
  *   - temporary: An array holding temporary data accessible during the current
- *     page request only. It may be used to temporary save any data that doesn't
- *     need to or shouldn't be cached during the whole form workflow, e.g. data
- *     that needs to be accessed during the current form build process only.
+ *     page request only. All $form_state properties that are not reserved keys
+ *     (see form_state_keys_no_cache()) persist throughout a multistep form
+ *     sequence. Form API provides this key for modules to communicate
+ *     information across form-related functions during a single page request.
+ *     It may be used to temporarily save data that does not need to or should
+ *     not be cached during the whole form workflow; e.g., data that needs to be
+ *     accessed during the current form build process only. There is no use-case
+ *     for this functionality in Drupal core.
  *   - wrapper_callback: Modules that wish to pre-populate certain forms with
  *     common elements, such as back/next/save buttons in multi-step form
  *     wizards, may define a form builder function name that returns a form
@@ -268,8 +280,8 @@ function drupal_get_form($form_id) {
  *     hook_forms() or have to invoke drupal_build_form() (instead of
  *     drupal_get_form()) on their own in a custom menu callback to prepare
  *     $form_state accordingly.
- *   Further $form_state properties controlling the redirection behavior after
- *   form submission may be found in drupal_redirect_form().
+ *   Information on how certain $form_state properties control redirection
+ *   behavior after form submission may be found in drupal_redirect_form().
  *
  * @return
  *   The rendered form. This function may also perform a redirect and hence may
@@ -907,7 +919,7 @@ function drupal_process_form($form_id, &$form, &$form_state) {
   // have set $form_state['cache'] to indicate that the form and form state
   // shall be cached. But the form may only be cached if the 'no_cache' property
   // is not set to TRUE. Only cache $form as it was prior to form_builder(),
-  // because form_builder() must run for each request to accomodate new user
+  // because form_builder() must run for each request to accommodate new user
   // input. Rebuilt forms are not cached here, because drupal_rebuild_form()
   // already takes care of that.
   if (!$form_state['rebuild'] && $form_state['cache'] && empty($form_state['no_cache'])) {
@@ -1082,8 +1094,12 @@ function drupal_validate_form($form_id, &$form, &$form_state) {
   // matches the current user's session.
   if (isset($form['#token'])) {
     if (!drupal_valid_token($form_state['values']['form_token'], $form['#token'])) {
+      $path = current_path();
+      $query = drupal_get_query_parameters();
+      $url = url($path, array('query' => $query));
+
       // Setting this error will cause the form to fail validation.
-      form_set_error('form_token', t('This form is outdated. Reload the page and try again. Contact the site administrator if the problem persists.'));
+      form_set_error('form_token', t('The form has become outdated. Copy any unsaved work in the form below and then <a href="@link">reload this page</a>.', array('@link' => $url)));
     }
   }
 
@@ -1925,7 +1941,7 @@ function _form_builder_handle_input_element($form_id, &$element, &$form_state) {
   // drupal_form_submit() must not be able to get around this. Forms that set
   // #access=FALSE on an element usually allow access for some users, so forms
   // submitted with drupal_form_submit() may bypass access restriction and be
-  // treated as high-privelege users instead.
+  // treated as high-privilege users instead.
   $process_input = empty($element['#disabled']) && ($form_state['programmed'] || ($form_state['process_input'] && (!isset($element['#access']) || $element['#access'])));
 
   // Set the element's #value property.
@@ -2388,11 +2404,13 @@ function form_type_token_value($element, $input = FALSE) {
 }
 
 /**
- * Change submitted form values during form validation.
+ * Changes submitted form values in $form_state.
  *
  * Use this function to change the submitted value of a form element in a form
  * validation function, so that the changed value persists in $form_state
- * through to the submission handlers.
+ * through the remaining validation and submission handlers. It does not change
+ * the value in $element['#value'], only in $form_state['values'], which is
+ * where submitted values are always stored.
  *
  * Note that form validation functions are specified in the '#validate'
  * component of the form array (the value of $form['#validate'] is an array of
@@ -2796,7 +2814,17 @@ function password_confirm_validate($element, &$element_state) {
  */
 function theme_date($variables) {
   $element = $variables['element'];
-  return '<div class="container-inline">' . drupal_render_children($element) . '</div>';
+
+  $attributes = array();
+  if (isset($element['#id'])) {
+    $attributes['id'] = $element['#id'];
+  }
+  if (!empty($element['#attributes']['class'])) {
+    $attributes['class'] = (array) $element['#attributes']['class'];
+  }
+  $attributes['class'][] = 'container-inline';
+
+  return '<div' . drupal_attributes($attributes) . '>' . drupal_render_children($element) . '</div>';
 }
 
 /**
diff --git a/includes/image.inc b/includes/image.inc
index b04943b5e619debb30387c3743e91425c8064b20..8dc36b995bc071533818c2b98677fdf32afb7fb3 100644
--- a/includes/image.inc
+++ b/includes/image.inc
@@ -160,7 +160,7 @@ function image_get_info($filepath, $toolkit = FALSE) {
  *   The target height, in pixels.
  *
  * @return
- *   TRUE or FALSE, based on success.
+ *   TRUE on success, FALSE on failure.
  *
  * @see image_load()
  * @see image_resize()
@@ -178,12 +178,13 @@ function image_scale_and_crop(stdClass $image, $width, $height) {
 }
 
 /**
- * Scales an image to the given width and height while maintaining aspect ratio.
+ * Scales image dimensions while maintaining aspect ratio.
  *
- * The resulting image can be smaller for one or both target dimensions.
+ * The resulting dimensions can be smaller for one or both target dimensions.
  *
- * @param $image
- *   An image object returned by image_load().
+ * @param $dimensions
+ *   Dimensions to be modified - an array with components width and height, in
+ *   pixels.
  * @param $width
  *   The target width, in pixels. This value is omitted then the scaling will
  *   based only on the height value.
@@ -195,13 +196,12 @@ function image_scale_and_crop(stdClass $image, $width, $height) {
  *   up. This generally results in a low quality image.
  *
  * @return
- *   TRUE or FALSE, based on success.
+ *   TRUE if $dimensions was modified, FALSE otherwise.
  *
- * @see image_load()
- * @see image_scale_and_crop()
+ * @see image_scale()
  */
-function image_scale(stdClass $image, $width = NULL, $height = NULL, $upscale = FALSE) {
-  $aspect = $image->info['height'] / $image->info['width'];
+function image_dimensions_scale(array &$dimensions, $width = NULL, $height = NULL, $upscale = FALSE) {
+  $aspect = $dimensions['height'] / $dimensions['width'];
 
   if ($upscale) {
     // Set width/height according to aspect ratio if either is empty.
@@ -214,19 +214,56 @@ function image_scale(stdClass $image, $width = NULL, $height = NULL, $upscale =
     $height = !empty($height) ? $height : 9999999;
 
     // Don't scale up.
-    if (round($width) >= $image->info['width'] && round($height) >= $image->info['height']) {
-      return TRUE;
+    if (round($width) >= $dimensions['width'] && round($height) >= $dimensions['height']) {
+      return FALSE;
     }
   }
 
   if ($aspect < $height / $width) {
-    $height = $width * $aspect;
+    $dimensions['width'] = $width;
+    $dimensions['height'] = (int) round($width * $aspect);
   }
   else {
-    $width = $height / $aspect;
+    $dimensions['width'] = (int) round($height / $aspect);
+    $dimensions['height'] = $height;
+  }
+
+  return TRUE;
+}
+
+/**
+ * Scales an image while maintaining aspect ratio.
+ *
+ * The resulting image can be smaller for one or both target dimensions.
+ *
+ * @param $image
+ *   An image object returned by image_load().
+ * @param $width
+ *   The target width, in pixels. This value is omitted then the scaling will
+ *   based only on the height value.
+ * @param $height
+ *   The target height, in pixels. This value is omitted then the scaling will
+ *   based only on the width value.
+ * @param $upscale
+ *   Boolean indicating that files smaller than the dimensions will be scaled
+ *   up. This generally results in a low quality image.
+ *
+ * @return
+ *   TRUE on success, FALSE on failure.
+ *
+ * @see image_dimensions_scale()
+ * @see image_load()
+ * @see image_scale_and_crop()
+ */
+function image_scale(stdClass $image, $width = NULL, $height = NULL, $upscale = FALSE) {
+  $dimensions = $image->info;
+
+  // Scale the dimensions - if they don't change then just return success.
+  if (!image_dimensions_scale($dimensions, $width, $height, $upscale)) {
+    return TRUE;
   }
 
-  return image_resize($image, $width, $height);
+  return image_resize($image, $dimensions['width'], $dimensions['height']);
 }
 
 /**
@@ -240,7 +277,7 @@ function image_scale(stdClass $image, $width = NULL, $height = NULL, $upscale =
  *   The target height, in pixels.
  *
  * @return
- *   TRUE or FALSE, based on success.
+ *   TRUE on success, FALSE on failure.
  *
  * @see image_load()
  * @see image_gd_resize()
@@ -267,7 +304,7 @@ function image_resize(stdClass $image, $width, $height) {
  *   be white.
  *
  * @return
- *   TRUE or FALSE, based on success.
+ *   TRUE on success, FALSE on failure.
  *
  * @see image_load()
  * @see image_gd_rotate()
@@ -291,7 +328,7 @@ function image_rotate(stdClass $image, $degrees, $background = NULL) {
  *   The target height, in pixels.
  *
  * @return
- *   TRUE or FALSE, based on success.
+ *   TRUE on success, FALSE on failure.
  *
  * @see image_load()
  * @see image_scale_and_crop()
@@ -315,7 +352,7 @@ function image_crop(stdClass $image, $x, $y, $width, $height) {
  *   An image object returned by image_load().
  *
  * @return
- *   TRUE or FALSE, based on success.
+ *   TRUE on success, FALSE on failure.
  *
  * @see image_load()
  * @see image_gd_desaturate()
@@ -379,7 +416,7 @@ function image_load($file, $toolkit = FALSE) {
  *   original image file will be overwritten.
  *
  * @return
- *   TRUE or FALSE, based on success.
+ *   TRUE on success, FALSE on failure.
  *
  * @see image_load()
  * @see image_gd_save()
diff --git a/includes/install.inc b/includes/install.inc
index 089cdee8f56b4a1bcae4dd6a07ffc6b3e8f2b4ce..516e146188812969dd7cfd5232ef8b4ea67864b5 100644
--- a/includes/install.inc
+++ b/includes/install.inc
@@ -1183,10 +1183,11 @@ function drupal_check_module($module) {
  *    dependencies[] = dblog
  * @endcode
  *
- * @param profile
+ * @param $profile
  *   Name of profile.
- * @param locale
+ * @param $locale
  *   Name of locale used (if any).
+ *
  * @return
  *   The info array.
  */
diff --git a/includes/locale.inc b/includes/locale.inc
index 6154cf3c355ce9e9c2e53b2761089ed86c846746..6ebb8972ca5b904b5529e4e1545ab9915b510e37 100644
--- a/includes/locale.inc
+++ b/includes/locale.inc
@@ -93,39 +93,82 @@ function locale_language_from_interface() {
  * otherwise we would cache a user-specific preference.
  *
  * @param $languages
- *   An array of valid language objects.
+ *   An array of language objects for enabled languages ordered by weight.
  *
  * @return
  *   A valid language code on success, FALSE otherwise.
  */
 function locale_language_from_browser($languages) {
-  // Specified by the user via the browser's Accept Language setting
+  if (empty($_SERVER['HTTP_ACCEPT_LANGUAGE'])) {
+    return FALSE;
+  }
+
+  // The Accept-Language header contains information about the language
+  // preferences configured in the user's browser / operating system.
+  // RFC 2616 (section 14.4) defines the Accept-Language header as follows:
+  //   Accept-Language = "Accept-Language" ":"
+  //                  1#( language-range [ ";" "q" "=" qvalue ] )
+  //   language-range  = ( ( 1*8ALPHA *( "-" 1*8ALPHA ) ) | "*" )
   // Samples: "hu, en-us;q=0.66, en;q=0.33", "hu,en-us;q=0.5"
-  $browser_langs = array();
-
-  if (isset($_SERVER['HTTP_ACCEPT_LANGUAGE'])) {
-    $browser_accept = explode(",", $_SERVER['HTTP_ACCEPT_LANGUAGE']);
-    foreach ($browser_accept as $langpart) {
-      // The language part is either a code or a code with a quality.
-      // We cannot do anything with a * code, so it is skipped.
-      // If the quality is missing, it is assumed to be 1 according to the RFC.
-      if (preg_match("!([a-z-]+)(;q=([0-9\\.]+))?!", trim($langpart), $found)) {
-        $browser_langs[$found[1]] = (isset($found[3]) ? (float) $found[3] : 1.0);
-      }
+  $browser_langcodes = array();
+  if (preg_match_all('@([a-zA-Z-]+|\*)(?:;q=([0-9.]+))?(?:$|\s*,\s*)@', trim($_SERVER['HTTP_ACCEPT_LANGUAGE']), $matches, PREG_SET_ORDER)) {
+    foreach ($matches as $match) {
+      // We can safely use strtolower() here, tags are ASCII.
+      // RFC2616 mandates that the decimal part is no more than three digits,
+      // so we multiply the qvalue by 1000 to avoid floating point comparisons.
+      $langcode = strtolower($match[1]);
+      $qvalue = isset($match[2]) ? (float) $match[2] : 1;
+      $browser_langcodes[$langcode] = (int) ($qvalue * 1000);
     }
   }
 
-  // Order the codes by quality
-  arsort($browser_langs);
+  // We should take pristine values from the HTTP headers, but Internet Explorer
+  // from version 7 sends only specific language tags (eg. fr-CA) without the
+  // corresponding generic tag (fr) unless explicitly configured. In that case,
+  // we assume that the lowest value of the specific tags is the value of the
+  // generic language to be as close to the HTTP 1.1 spec as possible.
+  // See http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.4 and
+  // http://blogs.msdn.com/b/ie/archive/2006/10/17/accept-language-header-for-internet-explorer-7.aspx
+  asort($browser_langcodes);
+  foreach ($browser_langcodes as $langcode => $qvalue) {
+    $generic_tag = strtok($langcode, '-');
+    if (!isset($browser_langcodes[$generic_tag])) {
+      $browser_langcodes[$generic_tag] = $qvalue;
+    }
+  }
+
+  // Find the enabled language with the greatest qvalue, following the rules
+  // of RFC 2616 (section 14.4). If several languages have the same qvalue,
+  // prefer the one with the greatest weight.
+  $best_match_langcode = FALSE;
+  $max_qvalue = 0;
+  foreach ($languages as $langcode => $language) {
+    // Language tags are case insensitive (RFC2616, sec 3.10).
+    $langcode = strtolower($langcode);
+
+    // If nothing matches below, the default qvalue is the one of the wildcard
+    // language, if set, or is 0 (which will never match).
+    $qvalue = isset($browser_langcodes['*']) ? $browser_langcodes['*'] : 0;
 
-  // Try to find the first preferred language we have
-  foreach ($browser_langs as $langcode => $q) {
-    if (isset($languages[$langcode])) {
-      return $langcode;
+    // Find the longest possible prefix of the browser-supplied language
+    // ('the language-range') that matches this site language ('the language tag').
+    $prefix = $langcode;
+    do {
+      if (isset($browser_langcodes[$prefix])) {
+        $qvalue = $browser_langcodes[$prefix];
+        break;
+      }
+    }
+    while ($prefix = substr($prefix, 0, strrpos($prefix, '-')));
+
+    // Find the best match.
+    if ($qvalue > $max_qvalue) {
+      $best_match_langcode = $language->language;
+      $max_qvalue = $qvalue;
     }
   }
 
-  return FALSE;
+  return $best_match_langcode;
 }
 
 /**
@@ -207,10 +250,16 @@ function locale_language_from_url($languages) {
 
     case LOCALE_LANGUAGE_NEGOTIATION_URL_DOMAIN:
       foreach ($languages as $language) {
-        $host = parse_url($language->domain, PHP_URL_HOST);
-        if ($host && ($_SERVER['HTTP_HOST'] == $host)) {
-          $language_url = $language->language;
-          break;
+        // Skip check if the language doesn't have a domain.
+        if ($language->domain) {
+          // Only compare the domains not the protocols or ports.
+          // Remove protocol and add http:// so parse_url works
+          $host = 'http://' . str_replace(array('http://', 'https://'), '', $language->domain);
+          $host = parse_url($host, PHP_URL_HOST);
+          if ($_SERVER['HTTP_HOST'] == $host) {
+            $language_url = $language->language;
+            break;
+          }
         }
       }
       break;
@@ -1394,10 +1443,40 @@ function _locale_parse_js_file($filepath) {
 
   // Match all calls to Drupal.t() in an array.
   // Note: \s also matches newlines with the 's' modifier.
-  preg_match_all('~[^\w]Drupal\s*\.\s*t\s*\(\s*(' . LOCALE_JS_STRING . ')\s*[,\)]~s', $file, $t_matches);
+  preg_match_all('~
+    [^\w]Drupal\s*\.\s*t\s*                       # match "Drupal.t" with whitespace
+    \(\s*                                         # match "(" argument list start
+    (' . LOCALE_JS_STRING . ')\s*                 # capture string argument
+    [,\)]                                         # match ")" or "," to finish
+    ~sx', $file, $t_matches);
 
   // Match all Drupal.formatPlural() calls in another array.
-  preg_match_all('~[^\w]Drupal\s*\.\s*formatPlural\s*\(\s*.+?\s*,\s*(' . LOCALE_JS_STRING . ')\s*,\s*((?:(?:\'(?:\\\\\'|[^\'])*@count(?:\\\\\'|[^\'])*\'|"(?:\\\\"|[^"])*@count(?:\\\\"|[^"])*")(?:\s*\+\s*)?)+)\s*[,\)]~s', $file, $plural_matches);
+  preg_match_all('~
+    [^\w]Drupal\s*\.\s*formatPlural\s*  # match "Drupal.formatPlural" with whitespace
+    \(                                  # match "(" argument list start
+    \s*.+?\s*,\s*                       # match count argument
+    (' . LOCALE_JS_STRING . ')\s*,\s*   # match singular string argument
+    (                             # capture plural string argument
+      (?:                         # non-capturing group to repeat string pieces
+        (?:
+          \'                      # match start of single-quoted string
+          (?:\\\\\'|[^\'])*       # match any character except unescaped single-quote
+          @count                  # match "@count"
+          (?:\\\\\'|[^\'])*       # match any character except unescaped single-quote
+          \'                      # match end of single-quoted string
+          |
+          "                       # match start of double-quoted string
+          (?:\\\\"|[^"])*         # match any character except unescaped double-quote
+          @count                  # match "@count"
+          (?:\\\\"|[^"])*         # match any character except unescaped double-quote
+          "                       # match end of double-quoted string
+        )
+        (?:\s*\+\s*)?             # match "+" with possible whitespace, for str concat
+      )+                          # match multiple because we supports concatenating strs
+    )\s*                          # end capturing of plural string argument
+    [,\)]
+    ~sx', $file, $plural_matches);
+
 
   // Loop through all matches and process them.
   $all_matches = array_merge($plural_matches[1], $t_matches[1]);
diff --git a/includes/menu.inc b/includes/menu.inc
index a32fa1310ebe166eb497d1f4abdc648be5004a46..dad65d727fbb53fe1e06cb2a9f4e843798a349c2 100644
--- a/includes/menu.inc
+++ b/includes/menu.inc
@@ -1133,6 +1133,45 @@ function menu_tree_all_data($menu_name, $link = NULL, $max_depth = NULL) {
   return $tree[$cid];
 }
 
+/**
+ * Set the path for determining the active trail of the specified menu tree.
+ *
+ * This path will also affect the breadcrumbs under some circumstances.
+ * Breadcrumbs are built using the preferred link returned by
+ * menu_link_get_preferred(). If the preferred link is inside one of the menus
+ * specified in calls to menu_tree_set_path(), the preferred link will be
+ * overridden by the corresponding path returned by menu_tree_get_path().
+ *
+ * Setting this path does not affect the main content; for that use
+ * menu_set_active_item() instead.
+ *
+ * @param $menu_name
+ *   The name of the affected menu tree.
+ * @param $path
+ *   The path to use when finding the active trail.
+ */
+function menu_tree_set_path($menu_name, $path = NULL) {
+  $paths = &drupal_static(__FUNCTION__);
+  if (isset($path)) {
+    $paths[$menu_name] = $path;
+  }
+  return isset($paths[$menu_name]) ? $paths[$menu_name] : NULL;
+}
+
+/**
+ * Get the path for determining the active trail of the specified menu tree.
+ *
+ * @param $menu_name
+ *   The menu name of the requested tree.
+ *
+ * @return
+ *   A string containing the path. If no path has been specified with
+ *   menu_tree_set_path(), NULL is returned.
+ */
+function menu_tree_get_path($menu_name) {
+  return menu_tree_set_path($menu_name);
+}
+
 /**
  * Get the data structure representing a named menu tree, based on the current page.
  *
@@ -1158,8 +1197,10 @@ function menu_tree_all_data($menu_name, $link = NULL, $max_depth = NULL) {
 function menu_tree_page_data($menu_name, $max_depth = NULL, $only_active_trail = FALSE) {
   $tree = &drupal_static(__FUNCTION__, array());
 
+  // Check if the active trail has been overridden for this menu tree.
+  $active_path = menu_tree_get_path($menu_name);
   // Load the menu item corresponding to the current page.
-  if ($item = menu_get_item()) {
+  if ($item = menu_get_item($active_path)) {
     if (isset($max_depth)) {
       $max_depth = min($max_depth, MENU_MAX_DEPTH);
     }
@@ -1198,8 +1239,9 @@ function menu_tree_page_data($menu_name, $max_depth = NULL, $only_active_trail =
         // If the item for the current page is accessible, build the tree
         // parameters accordingly.
         if ($item['access']) {
-          // Find a menu link corresponding to the current path.
-          if ($active_link = menu_link_get_preferred()) {
+          // Find a menu link corresponding to the current path. If $active_path
+          // is NULL, let menu_link_get_preferred() determine the path.
+          if ($active_link = menu_link_get_preferred($active_path)) {
             // The active link may only be taken into account to build the
             // active trail, if it resides in the requested menu. Otherwise,
             // we'd needlessly re-run _menu_build_tree() queries for every menu
@@ -1459,18 +1501,30 @@ function _menu_tree_check_access(&$tree) {
 }
 
 /**
- * Build the data representing a menu tree.
+ * Builds the data representing a menu tree.
  *
  * @param $links
- *   An array of links (associative arrays) ordered by p1..p9.
+ *   A flat array of menu links that are part of the menu. Each array element
+ *   is an associative array of information about the menu link, containing the
+ *   fields from the {menu_links} table, and optionally additional information
+ *   from the {menu_router} table, if the menu item appears in both tables.
+ *   This array must be ordered depth-first. See _menu_build_tree() for a sample
+ *   query.
  * @param $parents
- *   An array of the plid values that represent the path from the current page
- *   to the root of the menu tree.
+ *   An array of the menu link ID values that are in the path from the current
+ *   page to the root of the menu tree.
  * @param $depth
- *   The minimum depth of any link in the $links array.
+ *   The minimum depth to include in the returned menu tree.
  *
  * @return
- *   See menu_tree_page_data for a description of the data structure.
+ *   An array of menu links in the form of a tree. Each item in the tree is an
+ *   associative array containing:
+ *   - link: The menu link item from $links, with additional element
+ *     'in_active_trail' (TRUE if the link ID was in $parents).
+ *   - below: An array containing the sub-tree of this item, where each element
+ *     is a tree item array with 'link' and 'below' elements. This array will be
+ *     empty if the menu item has no items in its sub-tree having a depth
+ *     greater than or equal to $depth.
  */
 function menu_tree_data(array $links, array $parents = array(), $depth = 1) {
   // Reverse the array so we can use the more efficient array_pop() function.
@@ -2229,38 +2283,36 @@ function menu_get_active_menu_names() {
 /**
  * Set the active path, which determines which page is loaded.
  *
- * @param $path
- *   A Drupal path - not a path alias.
- *
  * Note that this may not have the desired effect unless invoked very early
  * in the page load, such as during hook_boot, or unless you call
  * menu_execute_active_handler() to generate your page output.
+ *
+ * @param $path
+ *   A Drupal path - not a path alias.
  */
 function menu_set_active_item($path) {
   $_GET['q'] = $path;
 }
 
 /**
- * Sets or gets the active trail (path to menu tree root) of the current page.
+ * Sets the active trail (path to menu tree root) of the current page.
+ *
+ * Any trail set by this function will only be used for functionality that calls
+ * menu_get_active_trail(). Drupal core only uses trails set here for
+ * breadcrumbs and the page title and not for menu trees or page content.
+ * Additionally, breadcrumbs set by drupal_set_breadcrumb() will override any
+ * trail set here.
+ *
+ * To affect the trail used by menu trees, use menu_tree_set_path(). To affect
+ * the page content, use menu_set_active_item() instead.
  *
  * @param $new_trail
- *   Menu trail to set, or NULL to use previously-set or calculated trail. If
- *   supplying a trail, use the same format as the return value (see below).
+ *   Menu trail to set; the value is saved in a static variable and can be
+ *   retrieved by menu_get_active_trail(). The format of this array should be
+ *   the same as the return value of menu_get_active_trail().
  *
  * @return
- *   Path to menu root of the current page, as an array of menu link items,
- *   starting with the site's home page. Each link item is an associative array
- *   with the following components:
- *   - title: Title of the item.
- *   - href: Drupal path of the item.
- *   - localized_options: Options for passing into the l() function.
- *   - type: A menu type constant, such as MENU_DEFAULT_LOCAL_TASK, or 0 to
- *     indicate it's not really in the menu (used for the home page item).
- *   If $new_trail is supplied, the value is saved in a static variable and
- *   returned. If $new_trail is not supplied, and there is a saved value from
- *   a previous call, the saved value is returned. If $new_trail is not supplied
- *   and there is no saved value, the path to the current page is calculated,
- *   saved as the static value, and returned.
+ *   The active trail. See menu_get_active_trail() for details.
  */
 function menu_set_active_trail($new_trail = NULL) {
   $trail = &drupal_static(__FUNCTION__);
@@ -2419,7 +2471,20 @@ function menu_link_get_preferred($path = NULL) {
 /**
  * Gets the active trail (path to root menu root) of the current page.
  *
- * See menu_set_active_trail() for details of return value.
+ * If a trail is supplied to menu_set_active_trail(), that value is returned. If
+ * a trail is not supplied to menu_set_active_trail(), the path to the current
+ * page is calculated and returned. The calculated trail is also saved as a
+ * static value for use by subsequent calls to menu_get_active_trail().
+ *
+ * @return
+ *   Path to menu root of the current page, as an array of menu link items,
+ *   starting with the site's home page. Each link item is an associative array
+ *   with the following components:
+ *   - title: Title of the item.
+ *   - href: Drupal path of the item.
+ *   - localized_options: Options for passing into the l() function.
+ *   - type: A menu type constant, such as MENU_DEFAULT_LOCAL_TASK, or 0 to
+ *     indicate it's not really in the menu (used for the home page item).
  */
 function menu_get_active_trail() {
   return menu_set_active_trail();
diff --git a/includes/module.inc b/includes/module.inc
index 779b668269eb69e7c0cd4a14915242248b67c3fe..66c77f57789efb08c0f19f042e546ef391a572b7 100644
--- a/includes/module.inc
+++ b/includes/module.inc
@@ -786,10 +786,9 @@ function module_implements_write_cache() {
  * @return
  *   The return value of the hook implementation.
  */
-function module_invoke() {
+function module_invoke($module, $hook) {
   $args = func_get_args();
-  $module = $args[0];
-  $hook = $args[1];
+  // Remove $module and $hook from the arguments.
   unset($args[0], $args[1]);
   if (module_hook($module, $hook)) {
     return call_user_func_array($module . '_' . $hook, $args);
@@ -808,9 +807,9 @@ function module_invoke() {
  *   An array of return values of the hook implementations. If modules return
  *   arrays from their implementations, those are merged into one array.
  */
-function module_invoke_all() {
+function module_invoke_all($hook) {
   $args = func_get_args();
-  $hook = $args[0];
+  // Remove $hook from the arguments.
   unset($args[0]);
   $return = array();
   foreach (module_implements($hook) as $module) {
diff --git a/includes/pager.inc b/includes/pager.inc
index 7a3a7be30c0b7b56e3237910edb98c0f09c88f11..a5d3e6be03c9c643670b1b9f0b6da4084be09a92 100644
--- a/includes/pager.inc
+++ b/includes/pager.inc
@@ -200,7 +200,7 @@ function pager_find_page($element = 0) {
  * to theme('pager') will render a pager that correctly corresponds to the
  * items being displayed.
  *
- * If the items being displayed result from a database query peformed using
+ * If the items being displayed result from a database query performed using
  * Drupal's database API, and if you have control over the construction of the
  * database query, you do not need to call this function directly; instead, you
  * can simply extend the query object with the 'PagerDefault' extender before
diff --git a/includes/session.inc b/includes/session.inc
index 9061f461ca2de6fbb4247a0cacf5dcf4099725ef..6415989cc1d31d5284c680cf6b3d08f0f1d57b6e 100644
--- a/includes/session.inc
+++ b/includes/session.inc
@@ -49,21 +49,23 @@ function _drupal_session_close() {
 }
 
 /**
- * Session handler assigned by session_set_save_handler().
+ * Reads an entire session from the database (internal use only).
  *
- * This function will be called by PHP to retrieve the current user's
- * session data, which is stored in the database. It also loads the
- * current user's appropriate roles into the user object.
+ * Also initializes the $user object for the user associated with the session.
+ * This function is registered with session_set_save_handler() to support
+ * database-backed sessions. It is called on every page load when PHP sets
+ * up the $_SESSION superglobal.
  *
- * This function should not be called directly. Session data should
- * instead be accessed via the $_SESSION superglobal.
+ * This function is an internal function and must not be called directly.
+ * Doing so may result in logging out the current user, corrupting session data
+ * or other unexpected behavior. Session data must always be accessed via the
+ * $_SESSION superglobal.
  *
  * @param $sid
- *   Session ID.
+ *   The session ID of the session to retrieve.
  *
  * @return
- *   Either an array of the session data, or an empty string, if no data
- *   was found or the user is anonymous.
+ *   The user's session, or an empty string if no session exists.
  */
 function _drupal_session_read($sid) {
   global $user, $is_https;
@@ -140,21 +142,22 @@ function _drupal_session_read($sid) {
 }
 
 /**
- * Session handler assigned by session_set_save_handler().
+ * Writes an entire session to the database (internal use only).
  *
- * This function will be called by PHP to store the current user's
- * session, which Drupal saves to the database.
+ * This function is registered with session_set_save_handler() to support
+ * database-backed sessions.
  *
- * This function should not be called directly. Session data should
- * instead be accessed via the $_SESSION superglobal.
+ * This function is an internal function and must not be called directly.
+ * Doing so may result in corrupted session data or other unexpected behavior.
+ * Session data must always be accessed via the $_SESSION superglobal.
  *
  * @param $sid
- *   Session ID.
+ *   The session ID of the session to write to.
  * @param $value
- *   Serialized array of the session data.
+ *   Session data to write as a serialized string.
  *
  * @return
- *   This function will always return TRUE.
+ *   Always returns TRUE.
  */
 function _drupal_session_write($sid, $value) {
   global $user, $is_https;
diff --git a/includes/stream_wrappers.inc b/includes/stream_wrappers.inc
index 9a9b06171a92c73228df7c33c067a4c9e47b4237..e47668e3aff656749a176a75460a61ca4e4ff589 100644
--- a/includes/stream_wrappers.inc
+++ b/includes/stream_wrappers.inc
@@ -356,10 +356,18 @@ abstract class DrupalLocalStreamWrapper implements DrupalStreamWrapperInterface
   }
 
   /**
-   * Return the local filesystem path.
-   *
-   * @param $uri
-   *   Optional URI, supplied when doing a move or rename.
+   * Returns the canonical absolute path of the URI, if possible.
+   *
+   * @param string $uri
+   *   (optional) The stream wrapper URI to be converted to a canonical
+   *   absolute path. This may point to a directory or another type of file.
+   *
+   * @return string|false
+   *   If $uri is not set, returns the canonical absolute path of the URI
+   *   previously set by the DrupalStreamWrapperInterface::setUri() function.
+   *   If $uri is set and valid for this class, returns its canonical absolute
+   *   path, as determined by the realpath() function. If $uri is set but not
+   *   valid, returns FALSE.
    */
   protected function getLocalPath($uri = NULL) {
     if (!isset($uri)) {
diff --git a/includes/theme.inc b/includes/theme.inc
index 6c2b6406903af92effbfd9c27c482d1f10572d7a..252eec08182400d69a9c5335e3187cd92e1a711e 100644
--- a/includes/theme.inc
+++ b/includes/theme.inc
@@ -275,7 +275,7 @@ function _theme_registry_callback($callback = NULL, array $arguments = array())
  * @param $base_theme
  *   An array of loaded $theme objects representing the ancestor themes in
  *   oldest first order.
- * @param theme_engine
+ * @param $theme_engine
  *   The name of the theme engine.
  */
 function _theme_load_registry($theme, $base_theme = NULL, $theme_engine = NULL) {
@@ -512,22 +512,33 @@ function _theme_process_registry(&$cache, $name, $type, $theme, $path) {
 }
 
 /**
- * Rebuild the theme registry cache.
+ * Build the theme registry cache.
  *
  * @param $theme
  *   The loaded $theme object as returned by list_themes().
  * @param $base_theme
  *   An array of loaded $theme objects representing the ancestor themes in
  *   oldest first order.
- * @param theme_engine
+ * @param $theme_engine
  *   The name of the theme engine.
  */
 function _theme_build_registry($theme, $base_theme, $theme_engine) {
   $cache = array();
   // First, process the theme hooks advertised by modules. This will
-  // serve as the basic registry.
-  foreach (module_implements('theme') as $module) {
-    _theme_process_registry($cache, $module, 'module', $module, drupal_get_path('module', $module));
+  // serve as the basic registry. Since the list of enabled modules is the same
+  // regardless of the theme used, this is cached in its own entry to save
+  // building it for every theme.
+  if ($cached = cache_get('theme_registry:build:modules')) {
+    $cache = $cached->data;
+  }
+  else {
+    foreach (module_implements('theme') as $module) {
+      _theme_process_registry($cache, $module, 'module', $module, drupal_get_path('module', $module));
+    }
+    // Only cache this registry if all modules are loaded.
+    if (module_load_all(NULL)) {
+      cache_set('theme_registry:build:modules', $cache);
+    }
   }
 
   // Process each base theme.
@@ -1388,7 +1399,8 @@ function theme_link($variables) {
  *     - html: (optional) Whether or not 'title' is HTML. If set, the title
  *       will not be passed through check_plain().
  *     - attributes: (optional) Attributes for the anchor, or for the <span> tag
- *       used in its place if no 'href' is supplied.
+ *       used in its place if no 'href' is supplied. If element 'class' is
+ *       included, it must be an array of one or more class names.
  *     If the 'href' element is supplied, the entire link array is passed to l()
  *     as its $options parameter.
  *   - attributes: A keyed array of attributes for the UL containing the
@@ -1902,11 +1914,12 @@ function theme_feed_icon($variables) {
  */
 function theme_html_tag($variables) {
   $element = $variables['element'];
+  $attributes = isset($element['#attributes']) ? drupal_attributes($element['#attributes']) : '';
   if (!isset($element['#value'])) {
-    return '<' . $element['#tag'] . drupal_attributes($element['#attributes']) . " />\n";
+    return '<' . $element['#tag'] . $attributes . " />\n";
   }
   else {
-    $output = '<' . $element['#tag'] . drupal_attributes($element['#attributes']) . '>';
+    $output = '<' . $element['#tag'] . $attributes . '>';
     if (isset($element['#value_prefix'])) {
       $output .= $element['#value_prefix'];
     }
@@ -2085,7 +2098,7 @@ function template_preprocess(&$variables, $hook) {
 }
 
 /**
- * Returns hook-independant variables to template_preprocess().
+ * Returns hook-independent variables to template_preprocess().
  */
 function _template_preprocess_default_variables() {
   global $user;
diff --git a/includes/update.inc b/includes/update.inc
index 08c945a4f8b206d36c684646f52101208301ed9b..f23ff1b1f1734136582471f5643d8e83de47f8c5 100644
--- a/includes/update.inc
+++ b/includes/update.inc
@@ -1428,7 +1428,7 @@ function update_retrieve_dependencies() {
   $return = array();
   // Get a list of installed modules, arranged so that we invoke their hooks in
   // the same order that module_invoke_all() does.
-  $modules = db_query("SELECT name FROM {system} WHERE type = 'module' AND schema_version != :schema ORDER BY weight ASC, name ASC", array(':schema' => SCHEMA_UNINSTALLED))->fetchCol();
+  $modules = db_query("SELECT name FROM {system} WHERE type = 'module' AND schema_version <> :schema ORDER BY weight ASC, name ASC", array(':schema' => SCHEMA_UNINSTALLED))->fetchCol();
   foreach ($modules as $module) {
     $function = $module . '_update_dependencies';
     if (function_exists($function)) {
diff --git a/includes/utility.inc b/includes/utility.inc
index 254313f7338c4a7ec9415883fd529c341291572a..df6c48fb92cb03d1288deac5eafeef249bfa1814 100644
--- a/includes/utility.inc
+++ b/includes/utility.inc
@@ -11,7 +11,7 @@
  * @param $var
  *   The variable to export.
  * @param $prefix
- *   A prefix that will be added at the begining of every lines of the output.
+ *   A prefix that will be added at the beginning of every lines of the output.
  * @return
  *   The variable exported in a way compatible to Drupal's coding standards.
  */
diff --git a/misc/drupal.js b/misc/drupal.js
index 3cebbd28458dedcc7c9c37f39aa72b23ef1bb661..7e2cc4d7b425b6b8ed751b51c78a09fcf28f65d5 100644
--- a/misc/drupal.js
+++ b/misc/drupal.js
@@ -111,6 +111,8 @@ Drupal.detachBehaviors = function (context, settings, trigger) {
 
 /**
  * Encode special characters in a plain-text string for display as HTML.
+ *
+ * @ingroup sanitization
  */
 Drupal.checkPlain = function (str) {
   var character, regex,
@@ -125,6 +127,45 @@ Drupal.checkPlain = function (str) {
   return str;
 };
 
+/**
+ * Replace placeholders with sanitized values in a string.
+ *
+ * @param str
+ *   A string with placeholders.
+ * @param args
+ *   An object of replacements pairs to make. Incidences of any key in this
+ *   array are replaced with the corresponding value. Based on the first
+ *   character of the key, the value is escaped and/or themed:
+ *    - !variable: inserted as is
+ *    - @variable: escape plain text to HTML (Drupal.checkPlain)
+ *    - %variable: escape text and theme as a placeholder for user-submitted
+ *      content (checkPlain + Drupal.theme('placeholder'))
+ *
+ * @see Drupal.t()
+ * @ingroup sanitization
+ */
+Drupal.formatString = function(str, args) {
+  // Transform arguments before inserting them.
+  for (var key in args) {
+    switch (key.charAt(0)) {
+      // Escaped only.
+      case '@':
+        args[key] = Drupal.checkPlain(args[key]);
+      break;
+      // Pass-through.
+      case '!':
+        break;
+      // Escaped and placeholder.
+      case '%':
+      default:
+        args[key] = Drupal.theme('placeholder', args[key]);
+        break;
+    }
+    str = str.replace(key, args[key]);
+  }
+  return str;
+}
+
 /**
  * Translate strings to the page language or a given language.
  *
@@ -135,11 +176,7 @@ Drupal.checkPlain = function (str) {
  * @param args
  *   An object of replacements pairs to make after translation. Incidences
  *   of any key in this array are replaced with the corresponding value.
- *   Based on the first character of the key, the value is escaped and/or themed:
- *    - !variable: inserted as is
- *    - @variable: escape plain text to HTML (Drupal.checkPlain)
- *    - %variable: escape text and theme as a placeholder for user-submitted
- *      content (checkPlain + Drupal.theme('placeholder'))
+ *   See Drupal.formatString().
  * @return
  *   The translated string.
  */
@@ -150,24 +187,7 @@ Drupal.t = function (str, args) {
   }
 
   if (args) {
-    // Transform arguments before inserting them.
-    for (var key in args) {
-      switch (key.charAt(0)) {
-        // Escaped only.
-        case '@':
-          args[key] = Drupal.checkPlain(args[key]);
-        break;
-        // Pass-through.
-        case '!':
-          break;
-        // Escaped and placeholder.
-        case '%':
-        default:
-          args[key] = Drupal.theme('placeholder', args[key]);
-          break;
-      }
-      str = str.replace(key, args[key]);
-    }
+    str = Drupal.formatString(str, args);
   }
   return str;
 };
@@ -193,11 +213,7 @@ Drupal.t = function (str, args) {
  * @param args
  *   An object of replacements pairs to make after translation. Incidences
  *   of any key in this array are replaced with the corresponding value.
- *   Based on the first character of the key, the value is escaped and/or themed:
- *    - !variable: inserted as is
- *    - @variable: escape plain text to HTML (Drupal.checkPlain)
- *    - %variable: escape text and theme as a placeholder for user-submitted
- *      content (checkPlain + Drupal.theme('placeholder'))
+ *   See Drupal.formatString().
  *   Note that you do not need to include @count in this array.
  *   This replacement is done automatically for the plural case.
  * @return
diff --git a/misc/favicon.ico b/misc/favicon.ico
index bfa1c996f26cb47776b27da40f151c71e637b715..3417ec244e8dc4be38ac8a6da044533ac6790773 100644
Binary files a/misc/favicon.ico and b/misc/favicon.ico differ
diff --git a/misc/states.js b/misc/states.js
index ec070c9a676a79f26a17833e74dae7501e1c031d..9b98d5dd292b3085f3a35f41597c26f3064728d1 100644
--- a/misc/states.js
+++ b/misc/states.js
@@ -63,6 +63,13 @@ states.Dependent.comparisons = {
   'Function': function (reference, value) {
     // The "reference" variable is a comparison function.
     return reference(value);
+  },
+  'Number': function (reference, value) {
+    // If "reference" is a number and "value" is a string, then cast reference
+    // as a string before applying the strict comparison in compare(). Otherwise
+    // numeric keys in the form's #states array fail to match string values
+    // returned from jQuery's val().
+    return (value.constructor.name === 'String') ? compare(String(reference), value) : compare(reference, value);
   }
 };
 
diff --git a/misc/tableselect.js b/misc/tableselect.js
index a50110e94ecb1c47ab52f70254cecf43d052bf83..1abda24d951767176f0e9e088b2a592d5458a123 100644
--- a/misc/tableselect.js
+++ b/misc/tableselect.js
@@ -36,8 +36,8 @@ Drupal.tableSelect = function () {
     }
   });
 
-  // For each of the checkboxes within the table.
-  checkboxes = $('td input:checkbox', table).click(function (e) {
+  // For each of the checkboxes within the table that are not disabled.
+  checkboxes = $('td input:checkbox:enabled', table).click(function (e) {
     // Either add or remove the selected class based on the state of the check all checkbox.
     $(this).parents('tr:first')[ this.checked ? 'addClass' : 'removeClass' ]('selected');
 
diff --git a/modules/aggregator/aggregator-item.tpl.php b/modules/aggregator/aggregator-item.tpl.php
index c5dd70c67b5d0af3128171f72ea1ce0c63cfc49e..e9ad1e0d75607795d782ffd1e3d8485aaa30d80f 100644
--- a/modules/aggregator/aggregator-item.tpl.php
+++ b/modules/aggregator/aggregator-item.tpl.php
@@ -24,19 +24,19 @@
   </h3>
 
   <div class="feed-item-meta">
-  <?php if ($source_url) : ?>
+  <?php if ($source_url): ?>
     <a href="<?php print $source_url; ?>" class="feed-item-source"><?php print $source_title; ?></a> -
   <?php endif; ?>
     <span class="feed-item-date"><?php print $source_date; ?></span>
   </div>
 
-<?php if ($content) : ?>
+<?php if ($content): ?>
   <div class="feed-item-body">
     <?php print $content; ?>
   </div>
 <?php endif; ?>
 
-<?php if ($categories) : ?>
+<?php if ($categories): ?>
   <div class="feed-item-categories">
     <?php print t('Categories'); ?>: <?php print implode(', ', $categories); ?>
   </div>
diff --git a/modules/aggregator/aggregator-summary-item.tpl.php b/modules/aggregator/aggregator-summary-item.tpl.php
index 1c8299938be08f6ca0ce40ab4aeeb56b81f79986..fcd57c7a4629316e027754a3f8a2dec28a778304 100644
--- a/modules/aggregator/aggregator-summary-item.tpl.php
+++ b/modules/aggregator/aggregator-summary-item.tpl.php
@@ -18,6 +18,6 @@
 <a href="<?php print $feed_url; ?>"><?php print $feed_title; ?></a>
 <span class="age"><?php print $feed_age; ?></span>
 
-<?php if ($source_url) : ?>,
-<span class="source"><a href="<?php print $source_url; ?>"><?php print $source_title; ?></a></span>
+<?php if ($source_url): ?>,
+  <span class="source"><a href="<?php print $source_url; ?>"><?php print $source_title; ?></a></span>
 <?php endif; ?>
diff --git a/modules/aggregator/aggregator.info b/modules/aggregator/aggregator.info
index b2d5abd95a676fdcf295ce9f8ded2e03ac6b4748..bc576576a5e0b27860c2eb99b990111563adbf2d 100644
--- a/modules/aggregator/aggregator.info
+++ b/modules/aggregator/aggregator.info
@@ -7,8 +7,8 @@ files[] = aggregator.test
 configure = admin/config/services/aggregator/settings
 stylesheets[all][] = aggregator.css
 
-; Information added by drupal.org packaging script on 2011-08-31
-version = "7.8"
+; Information added by drupal.org packaging script on 2011-10-26
+version = "7.9"
 project = "drupal"
-datestamp = "1314817616"
+datestamp = "1319660730"
 
diff --git a/modules/aggregator/aggregator.pages.inc b/modules/aggregator/aggregator.pages.inc
index 53ecb3684e612756c767d8a3eba8429036f3750c..8074ae82e8ee348c86abf7a6017923834603c264 100644
--- a/modules/aggregator/aggregator.pages.inc
+++ b/modules/aggregator/aggregator.pages.inc
@@ -89,30 +89,61 @@ function aggregator_page_category_form($form, $form_state, $category) {
 }
 
 /**
- * Load feed items
+ * Loads and optionally filters feed items.
  *
  * @param $type
- *   The filter for the items. Possible values: 'sum', 'source', 'category'
+ *   The type of filter for the items. Possible values are:
+ *   - sum: No filtering.
+ *   - source: Filter the feed items, limiting the result to items from a
+ *     single source.
+ *   - category: Filter the feed items by category.
  * @param $data
- *   Feed or category data for filtering
+ *   Feed or category data used for filtering. The type and value of $data
+ *   depends on $type:
+ *   - source: $data is an object with $data->fid identifying the feed used to
+ *     as filter.
+ *   - category: $data is an array with $data['cid'] being the category id to
+ *     filter on.
+ *   The $data parameter is not used when $type is 'sum'.
+ *
  * @return
  *   An array of the feed items.
  */
 function aggregator_feed_items_load($type, $data = NULL) {
   $items = array();
-  $range_limit = 20;
   switch ($type) {
     case 'sum':
-      $result = db_query_range('SELECT i.*, f.title AS ftitle, f.link AS flink FROM {aggregator_item} i INNER JOIN {aggregator_feed} f ON i.fid = f.fid ORDER BY i.timestamp DESC, i.iid DESC', 0, $range_limit);
+      $query = db_select('aggregator_item', 'i');
+      $query->join('aggregator_feed', 'f', 'i.fid = f.fid');
+      $query->fields('i');
+      $query->addField('f', 'title', 'ftitle');
+      $query->addField('f', 'link', 'flink');
       break;
     case 'source':
-      $result = db_query_range('SELECT * FROM {aggregator_item} WHERE fid = :fid ORDER BY timestamp DESC, iid DESC', 0, $range_limit, array(':fid' => $data->fid));
+      $query = db_select('aggregator_item', 'i');
+      $query
+        ->fields('i')
+        ->condition('i.fid', $data->fid);
       break;
     case 'category':
-      $result = db_query_range('SELECT i.*, f.title AS ftitle, f.link AS flink FROM {aggregator_category_item} c LEFT JOIN {aggregator_item} i ON c.iid = i.iid LEFT JOIN {aggregator_feed} f ON i.fid = f.fid WHERE cid = :cid ORDER BY timestamp DESC, i.iid DESC', 0, $range_limit, array(':cid' => $data['cid']));
+      $query = db_select('aggregator_category_item', 'c');
+      $query->leftJoin('aggregator_item', 'i', 'c.iid = i.iid');
+      $query->leftJoin('aggregator_feed', 'f', 'i.fid = f.fid');
+      $query
+        ->fields('i')
+        ->condition('cid', $data['cid']);
+      $query->addField('f', 'title', 'ftitle');
+      $query->addField('f', 'link', 'flink');
       break;
   }
 
+  $result = $query
+    ->extend('PagerDefault')
+    ->limit(20)
+    ->orderBy('i.timestamp', 'DESC')
+    ->orderBy('i.iid', 'DESC')
+    ->execute();
+
   foreach ($result as $item) {
     $item->categories = db_query('SELECT c.title, c.cid FROM {aggregator_category_item} ci LEFT JOIN {aggregator_category} c ON ci.cid = c.cid WHERE ci.iid = :iid ORDER BY c.title', array(':iid' => $item->iid))->fetchAll();
     $items[] = $item;
@@ -507,7 +538,14 @@ function template_preprocess_aggregator_feed_source(&$variables) {
   $feed = $variables['feed'];
 
   $variables['source_icon'] = theme('feed_icon', array('url' => $feed->url, 'title' => t('!title feed', array('!title' => $feed->title))));
-  $variables['source_image'] = $feed->image;
+
+  if (!empty($feed->image) && !empty($feed->title) && !empty($feed->link)) {
+    $variables['source_image'] = l(theme('image', array('path' => $feed->image, 'alt' => $feed->title)), $feed->link, array('html' => TRUE, 'attributes' => array('class' => 'feed-image')));
+  }
+  else {
+    $variables['source_image'] = '';
+  }
+
   $variables['source_description'] = aggregator_filter_xss($feed->description);
   $variables['source_url'] = check_url(url($feed->link, array('absolute' => TRUE)));
 
diff --git a/modules/aggregator/aggregator.parser.inc b/modules/aggregator/aggregator.parser.inc
index cffd1c3aa49a2a5dc4815e682c7b2b79dc6ab35a..e9f1d2e8a86500e7bf93a666a48ee6f74bf4ba43 100644
--- a/modules/aggregator/aggregator.parser.inc
+++ b/modules/aggregator/aggregator.parser.inc
@@ -35,19 +35,12 @@ function aggregator_aggregator_parse($feed) {
       $image[$key] = trim($value);
     }
 
-    if (!empty($image['link']) && !empty($image['url']) && !empty($image['title'])) {
-      $image = l(theme('image', array('path' => $image['url'], 'alt' => $image['title'])), $image['link'], array('html' => TRUE));
-    }
-    else {
-      $image = '';
-    }
-
     $etag = empty($feed->http_headers['etag']) ? '' : $feed->http_headers['etag'];
 
     // Add parsed data to the feed object.
-    $feed->link = !empty($channel['LINK']) ? $channel['LINK'] : '';
-    $feed->description = !empty($channel['DESCRIPTION']) ? $channel['DESCRIPTION'] : '';
-    $feed->image = $image;
+    $feed->link = !empty($channel['link']) ? $channel['link'] : '';
+    $feed->description = !empty($channel['description']) ? $channel['description'] : '';
+    $feed->image = !empty($image['url']) ? $image['url'] : '';
     $feed->etag = $etag;
     $feed->modified = $modified;
 
diff --git a/modules/aggregator/aggregator.processor.inc b/modules/aggregator/aggregator.processor.inc
index 6eb2c662fab594efb7b567fec5e1046231286b18..79261b6186b3ea09153f53d3868aee7e31f4ca64 100644
--- a/modules/aggregator/aggregator.processor.inc
+++ b/modules/aggregator/aggregator.processor.inc
@@ -37,6 +37,9 @@ function aggregator_aggregator_process($feed) {
         if (!$item['timestamp']) {
           $item['timestamp'] = isset($entry->timestamp) ? $entry->timestamp : REQUEST_TIME;
         }
+
+        // Make sure the item title fits in 255 varchar column.
+        $item['title'] = truncate_utf8($item['title'], 255, TRUE, TRUE);
         aggregator_save_item(array('iid' => (isset($entry->iid) ? $entry->iid : ''), 'fid' => $feed->fid, 'timestamp' => $item['timestamp'], 'title' => $item['title'], 'link' => $item['link'], 'author' => $item['author'], 'description' => $item['description'], 'guid' => $item['guid']));
       }
     }
diff --git a/modules/aggregator/aggregator.test b/modules/aggregator/aggregator.test
index 1ab12dc2e704046aa272e126de0f58d3ff3b207c..0d1e31ba545b1097335370c2439b9dd120a1e5eb 100644
--- a/modules/aggregator/aggregator.test
+++ b/modules/aggregator/aggregator.test
@@ -266,10 +266,16 @@ EOF;
     return $GLOBALS['base_url'] . '/' . drupal_get_path('module', 'aggregator') . '/tests/aggregator_test_atom.xml';
   }
 
-  function createSampleNodes() {
+  /**
+   * Creates sample article nodes.
+   *
+   * @param $count
+   *   (optional) The number of nodes to generate.
+   */
+  function createSampleNodes($count = 5) {
     $langcode = LANGUAGE_NONE;
-    // Post 5 articles.
-    for ($i = 0; $i < 5; $i++) {
+    // Post $count article nodes.
+    for ($i = 0; $i < $count; $i++) {
       $edit = array();
       $edit['title'] = $this->randomName();
       $edit["body[$langcode][0][value]"] = $this->randomName();
@@ -807,6 +813,28 @@ class AggregatorRenderingTestCase extends AggregatorTestCase {
     $correct_titles = $this->xpath('//h1[normalize-space(text())=:title]', array(':title' => $feed->title));
     $this->assertFalse(empty($correct_titles), t('Aggregator feed page is available and has the correct title.'));
   }
+
+  /**
+   * Create a feed and check that feed's page.
+   */
+  public function testFeedPage() {
+    // Increase the number of items published in the rss.xml feed so we have
+    // enough articles to test paging.
+    variable_set('feed_default_items', 30);
+
+    // Create a feed with 30 items.
+    $this->createSampleNodes(30);
+    $feed = $this->createFeed();
+    $this->updateFeedItems($feed, 30);
+
+    // Check for the presence of a pager.
+    $this->drupalGet('aggregator/sources/' . $feed->fid);
+    $elements = $this->xpath("//ul[@class=:class]", array(':class' => 'pager'));
+    $this->assertTrue(!empty($elements), t('Individual source page contains a pager.'));
+
+    // Reset the number of items in rss.xml to the default value.
+    variable_set('feed_default_items', 10);
+  }
 }
 
 /**
diff --git a/modules/aggregator/tests/aggregator_test.info b/modules/aggregator/tests/aggregator_test.info
index a7577825829ed798f442e7ea9ab6542e0ca23592..99756c56108c4e8c922d56e000f97400f5622bb1 100644
--- a/modules/aggregator/tests/aggregator_test.info
+++ b/modules/aggregator/tests/aggregator_test.info
@@ -5,8 +5,8 @@ version = VERSION
 core = 7.x
 hidden = TRUE
 
-; Information added by drupal.org packaging script on 2011-08-31
-version = "7.8"
+; Information added by drupal.org packaging script on 2011-10-26
+version = "7.9"
 project = "drupal"
-datestamp = "1314817616"
+datestamp = "1319660730"
 
diff --git a/modules/aggregator/tests/aggregator_test_rss091.xml b/modules/aggregator/tests/aggregator_test_rss091.xml
index 1fd5320d3e984b002c40d2d4ebc1c96b144b6906..f39a2732c03459b79be2b51ca4f6b1f4dc117be7 100644
--- a/modules/aggregator/tests/aggregator_test_rss091.xml
+++ b/modules/aggregator/tests/aggregator_test_rss091.xml
@@ -22,7 +22,7 @@
       <description>First example feed item description.</description>
     </item>
     <item>
-      <title>Second example feed item title</title>
+      <title>Second example feed item title. This title is extremely long so that it exceeds the 255 character limit for titles in feed item storage. In fact it's so long that this sentence isn't long enough so I'm rambling a bit to make it longer, nearly there now. Ah now it's long enough so I'll shut up.</title>
       <link>http://example.com/example-turns-two</link>
       <description>Second example feed item description.</description>
     </item>
diff --git a/modules/block/block.admin.inc b/modules/block/block.admin.inc
index c91cc80fc8905c1d7ca0e722a212de750875b907..f86fe96b90475c2f3b83e733cc1dd015c2a5028e 100644
--- a/modules/block/block.admin.inc
+++ b/modules/block/block.admin.inc
@@ -77,7 +77,7 @@ function block_admin_display_prepare_blocks($theme) {
  */
 function block_admin_display_form($form, &$form_state, $blocks, $theme, $block_regions = NULL) {
 
-  drupal_add_css(drupal_get_path('module', 'block') . '/block.css');
+  $form['#attached']['css'] = array(drupal_get_path('module', 'block') . '/block.css');
 
   // Get a list of block regions if one was not provided.
   if (!isset($block_regions)) {
@@ -276,7 +276,7 @@ function block_admin_configure($form, &$form_state, $module, $delta) {
     '#maxlength' => 64,
     '#description' => $block->module == 'block' ? t('The title of the block as shown to the user.') : t('Override the default title for the block. Use <em>!placeholder</em> to display no title, or leave blank to use the default block title.', array('!placeholder' => '&lt;none&gt;')),
     '#default_value' => isset($block->title) ? $block->title : '',
-    '#weight' => -18,
+    '#weight' => -19,
   );
 
   // Module-specific block configuration.
diff --git a/modules/block/block.info b/modules/block/block.info
index e1a3a4b990c42a9ced9f2933962faca22f2f8dad..ce537b5e321e7dd7424a6997238450d6071e48ac 100644
--- a/modules/block/block.info
+++ b/modules/block/block.info
@@ -6,8 +6,8 @@ core = 7.x
 files[] = block.test
 configure = admin/structure/block
 
-; Information added by drupal.org packaging script on 2011-08-31
-version = "7.8"
+; Information added by drupal.org packaging script on 2011-10-26
+version = "7.9"
 project = "drupal"
-datestamp = "1314817616"
+datestamp = "1319660730"
 
diff --git a/modules/block/block.module b/modules/block/block.module
index 4f498d3c684572b7e0959481301794d51be65586..754febd271d84b13bb94e15b11465efd6a8c6c9d 100644
--- a/modules/block/block.module
+++ b/modules/block/block.module
@@ -500,7 +500,7 @@ function block_custom_block_form($edit = array()) {
     '#maxlength' => 64,
     '#description' => t('A brief description of your block. Used on the <a href="@overview">Blocks administration page</a>.', array('@overview' => url('admin/structure/block'))),
     '#required' => TRUE,
-    '#weight' => -19,
+    '#weight' => -18,
   );
   $form['body_field']['#weight'] = -17;
   $form['body_field']['body'] = array(
@@ -668,7 +668,7 @@ function block_list($region) {
  *   Name of the module that implements the block to load.
  * @param $delta
  *   Unique ID of the block within the context of $module. Pass NULL to return
- *   an empty $block object for $module.
+ *   an empty block object for $module.
  *
  * @return
  *   A block object.
diff --git a/modules/block/block.test b/modules/block/block.test
index 03f3048b4eb619cb548e1d1e2d8e9251c9a77b0f..21666871987ba28e7a3e88c50890325d6459896d 100644
--- a/modules/block/block.test
+++ b/modules/block/block.test
@@ -83,7 +83,7 @@ class BlockTestCase extends DrupalWebTestCase {
     $this->assertTrue(array_key_exists('subject', $data) && empty($data['subject']), t('block_block_view() provides an empty block subject, since custom blocks do not have default titles.'));
     $this->assertEqual(check_markup($custom_block['body[value]'], $format), $data['content'], t('block_block_view() provides correct block content.'));
 
-    // Check if the block can be moved to all availble regions.
+    // Check whether the block can be moved to all available regions.
     $custom_block['module'] = 'block';
     $custom_block['delta'] = $bid;
     foreach ($this->regions as $region) {
@@ -307,7 +307,7 @@ class BlockTestCase extends DrupalWebTestCase {
     // Check to see if the block was created by checking that it's in the database.
     $this->assertNotNull($bid, t('Block found in database'));
 
-    // Check if the block can be moved to all availble regions.
+    // Check whether the block can be moved to all available regions.
     foreach ($this->regions as $region) {
       $this->moveBlockToRegion($block, $region);
     }
@@ -321,7 +321,7 @@ class BlockTestCase extends DrupalWebTestCase {
     $this->assertText(t('The block settings have been updated.'), t('Block successfully move to disabled region.'));
     $this->assertNoText(t($block['title']), t('Block no longer appears on page.'));
 
-    // Confirm that the regions xpath is not availble
+    // Confirm that the region's xpath is not available.
     $xpath = $this->buildXPathQuery('//div[@id=:id]/*', array(':id' => 'block-block-' . $bid));
     $this->assertNoFieldByXPath($xpath, FALSE, t('Custom block found in no regions.'));
 
diff --git a/modules/block/tests/block_test.info b/modules/block/tests/block_test.info
index 9225e0c81e24a7d01d39b85c0c1a8fa5654aca76..92334aa061296e6b8c159a23cf3495933764ed9d 100644
--- a/modules/block/tests/block_test.info
+++ b/modules/block/tests/block_test.info
@@ -5,8 +5,8 @@ version = VERSION
 core = 7.x
 hidden = TRUE
 
-; Information added by drupal.org packaging script on 2011-08-31
-version = "7.8"
+; Information added by drupal.org packaging script on 2011-10-26
+version = "7.9"
 project = "drupal"
-datestamp = "1314817616"
+datestamp = "1319660730"
 
diff --git a/modules/blog/blog.info b/modules/blog/blog.info
index 433ea6c2996b45b57f5fd9c23574b5d453125c44..0c898fa5bdc01915571cda527919b20e83b487e4 100644
--- a/modules/blog/blog.info
+++ b/modules/blog/blog.info
@@ -5,8 +5,8 @@ version = VERSION
 core = 7.x
 files[] = blog.test
 
-; Information added by drupal.org packaging script on 2011-08-31
-version = "7.8"
+; Information added by drupal.org packaging script on 2011-10-26
+version = "7.9"
 project = "drupal"
-datestamp = "1314817616"
+datestamp = "1319660730"
 
diff --git a/modules/book/book-all-books-block.tpl.php b/modules/book/book-all-books-block.tpl.php
index d22ff2ccc972f478228890fdc23949354578f69b..626a5f26482a7110e20efce066dfe3899588dd71 100644
--- a/modules/book/book-all-books-block.tpl.php
+++ b/modules/book/book-all-books-block.tpl.php
@@ -11,8 +11,8 @@
  *   render() on each to print it as an unordered list.
  */
 ?>
-<?php foreach ($book_menus as $book_id => $menu) : ?>
-<div id="book-block-menu-<?php print $book_id; ?>" class="book-block-menu">
-  <?php print render($menu); ?>
-</div>
+<?php foreach ($book_menus as $book_id => $menu): ?>
+  <div id="book-block-menu-<?php print $book_id; ?>" class="book-block-menu">
+    <?php print render($menu); ?>
+  </div>
 <?php endforeach; ?>
diff --git a/modules/book/book-export-html.tpl.php b/modules/book/book-export-html.tpl.php
index 180f3ae7783ff4db419a5f4f2d17d8ae2a14d0d5..4b25a766e18ce915b9e47cd1fabec4223f5e41fd 100644
--- a/modules/book/book-export-html.tpl.php
+++ b/modules/book/book-export-html.tpl.php
@@ -40,7 +40,7 @@
      */
     $div_close = '';
     ?>
-    <?php for ($i = 1; $i < $depth; $i++) : ?>
+    <?php for ($i = 1; $i < $depth; $i++): ?>
       <div class="section-<?php print $i; ?>">
       <?php $div_close .= '</div>'; ?>
     <?php endfor; ?>
diff --git a/modules/book/book-navigation.tpl.php b/modules/book/book-navigation.tpl.php
index e5883dc56ec8eda576784c06a385da2c1ecb5c67..5d8e9aa7fcb6e89125e511ab8306154c4b5f2387 100644
--- a/modules/book/book-navigation.tpl.php
+++ b/modules/book/book-navigation.tpl.php
@@ -35,13 +35,13 @@
 
     <?php if ($has_links): ?>
     <div class="page-links clearfix">
-      <?php if ($prev_url) : ?>
+      <?php if ($prev_url): ?>
         <a href="<?php print $prev_url; ?>" class="page-previous" title="<?php print t('Go to previous page'); ?>"><?php print t('‹ ') . $prev_title; ?></a>
       <?php endif; ?>
-      <?php if ($parent_url) : ?>
+      <?php if ($parent_url): ?>
         <a href="<?php print $parent_url; ?>" class="page-up" title="<?php print t('Go to parent page'); ?>"><?php print t('up'); ?></a>
       <?php endif; ?>
-      <?php if ($next_url) : ?>
+      <?php if ($next_url): ?>
         <a href="<?php print $next_url; ?>" class="page-next" title="<?php print t('Go to next page'); ?>"><?php print $next_title . t(' ›'); ?></a>
       <?php endif; ?>
     </div>
diff --git a/modules/book/book.info b/modules/book/book.info
index 0b1e0643edc61f47022a4aca74ee4c7fde8e445d..1332bb718e103b87f08b49304de898e82140530c 100644
--- a/modules/book/book.info
+++ b/modules/book/book.info
@@ -7,8 +7,8 @@ files[] = book.test
 configure = admin/content/book/settings
 stylesheets[all][] = book.css
 
-; Information added by drupal.org packaging script on 2011-08-31
-version = "7.8"
+; Information added by drupal.org packaging script on 2011-10-26
+version = "7.9"
 project = "drupal"
-datestamp = "1314817616"
+datestamp = "1319660730"
 
diff --git a/modules/book/book.module b/modules/book/book.module
index beb17214c9fa9fe638348cadc711f1ff978d442e..595d87d2ded0362961997e20cadebe60f6482fff 100644
--- a/modules/book/book.module
+++ b/modules/book/book.module
@@ -281,7 +281,7 @@ function book_block_view($delta = '') {
     // Only display this block when the user is browsing a book.
   $select = db_select('node', 'n')
     ->fields('n', array('title'))
-    ->condition('nid', $node->book['bid'])
+    ->condition('n.nid', $node->book['bid'])
     ->addTag('node_access');
     $title = $select->execute()->fetchField();
     // Only show the block if the user has view access for the top-level node.
diff --git a/modules/book/book.test b/modules/book/book.test
index cc61778b9d321f1e4f0b27d14752d4ab7e57dc99..6c351b8ecf8f3b6e68f377fb114a415697a6573a 100644
--- a/modules/book/book.test
+++ b/modules/book/book.test
@@ -24,12 +24,15 @@ class BookTestCase extends DrupalWebTestCase {
   }
 
   function setUp() {
-    parent::setUp('book');
+    parent::setUp(array('book', 'node_access_test'));
+
+    // node_access_test requires a node_access_rebuild().
+    node_access_rebuild();
 
     // Create users.
     $this->book_author = $this->drupalCreateUser(array('create new books', 'create book content', 'edit own book content', 'add content to books'));
-    $this->web_user = $this->drupalCreateUser(array('access printer-friendly version'));
-    $this->admin_user = $this->drupalCreateUser(array('create new books', 'create book content', 'edit own book content', 'add content to books', 'administer blocks'));
+    $this->web_user = $this->drupalCreateUser(array('access printer-friendly version', 'node test view'));
+    $this->admin_user = $this->drupalCreateUser(array('create new books', 'create book content', 'edit own book content', 'add content to books', 'administer blocks', 'administer permissions'));
   }
 
   /**
@@ -274,6 +277,12 @@ class BookTestCase extends DrupalWebTestCase {
     $this->drupalPost('admin/structure/block', $edit, t('Save blocks'));
     $this->assertText(t('The block settings have been updated.'), t('Block successfully move to footer region.'));
 
+     // Give anonymous users the permission 'node test view'.
+     $edit = array();
+     $edit['1[node test view]'] = TRUE;
+     $this->drupalPost('admin/people/permissions/1', $edit, t('Save permissions'));
+     $this->assertText(t('The changes have been saved.'), t("Permission 'node test view' successfully assigned to anonymous users."));
+
     // Test correct display of the block.
     $nodes = $this->createBook();
     $this->drupalGet('<front>');
@@ -281,4 +290,46 @@ class BookTestCase extends DrupalWebTestCase {
     $this->assertText($this->book->title, t('Link to book root (@title) is displayed.', array('@title' => $nodes[0]->title)));
     $this->assertNoText($nodes[0]->title, t('No links to individual book pages are displayed.'));
   }
+
+  /**
+   * Test the book navigation block when an access module is enabled.
+   */
+   function testNavigationBlockOnAccessModuleEnabled() {
+     $this->drupalLogin($this->admin_user);
+     $edit = array();
+
+     // Set the block title.
+     $block_title = $this->randomName(16);
+     $edit['title'] = $block_title;
+
+     // Set block display to 'Show block only on book pages'.
+     $edit['book_block_mode'] = 'book pages';
+     $this->drupalPost('admin/structure/block/manage/book/navigation/configure', $edit, t('Save block'));
+     $this->assertText(t('The block configuration has been saved.'), t('Block configuration set.'));
+
+     // Set the block to a region to confirm block is available.
+     $edit = array();
+     $edit['blocks[book_navigation][region]'] = 'footer';
+     $this->drupalPost('admin/structure/block', $edit, t('Save blocks'));
+     $this->assertText(t('The block settings have been updated.'), t('Block successfully move to footer region.'));
+
+     // Give anonymous users the permission 'node test view'.
+     $edit = array();
+     $edit['1[node test view]'] = TRUE;
+     $this->drupalPost('admin/people/permissions/1', $edit, t('Save permissions'));
+     $this->assertText(t('The changes have been saved.'), t('Permission \'node test view\' successfully assigned to anonymous users.'));
+
+     // Create a book.
+     $this->createBook();
+
+     // Test correct display of the block to registered users.
+     $this->drupalLogin($this->web_user);
+     $this->drupalGet('node/' . $this->book->nid);
+     $this->assertText($block_title, t('Book navigation block is displayed to registered users.'));
+     $this->drupalLogout();
+
+     // Test correct display of the block to anonymous users.
+     $this->drupalGet('node/' . $this->book->nid);
+     $this->assertText($block_title, t('Book navigation block is displayed to anonymous users.'));
+   }
 }
diff --git a/modules/color/color.info b/modules/color/color.info
index 5e89d15442805210c84b1c2e9b3c0f0c26b82d44..48a7a9e9dadc95cf35aed9de5a8da875a7d48d5d 100644
--- a/modules/color/color.info
+++ b/modules/color/color.info
@@ -5,8 +5,8 @@ version = VERSION
 core = 7.x
 files[] = color.test
 
-; Information added by drupal.org packaging script on 2011-08-31
-version = "7.8"
+; Information added by drupal.org packaging script on 2011-10-26
+version = "7.9"
 project = "drupal"
-datestamp = "1314817616"
+datestamp = "1319660730"
 
diff --git a/modules/comment/comment.info b/modules/comment/comment.info
index d4654cea6493df8f242bb5ddc546a22f82530b9f..7593ed21f2f646de2f3e2de6d6e9e309518bea61 100644
--- a/modules/comment/comment.info
+++ b/modules/comment/comment.info
@@ -9,8 +9,8 @@ files[] = comment.test
 configure = admin/content/comment
 stylesheets[all][] = comment.css
 
-; Information added by drupal.org packaging script on 2011-08-31
-version = "7.8"
+; Information added by drupal.org packaging script on 2011-10-26
+version = "7.9"
 project = "drupal"
-datestamp = "1314817616"
+datestamp = "1319660730"
 
diff --git a/modules/comment/comment.install b/modules/comment/comment.install
index cda3c308d5f485f4225ae5db08c012bffe61eb40..121ec22a1c7d2225678a665a6670a462e029cf8a 100644
--- a/modules/comment/comment.install
+++ b/modules/comment/comment.install
@@ -370,6 +370,27 @@ function comment_update_7008() {
  * @} End of "addtogroup updates-6.x-to-7.x"
  */
 
+/**
+ * @addtogroup updates-7.x-extra
+ * @{
+ */
+
+/**
+ * Change the last_comment_timestamp column description.
+ */
+function comment_update_7009() {
+  db_change_field('node_comment_statistics', 'last_comment_timestamp', 'last_comment_timestamp', array(
+    'type' => 'int',
+    'not null' => TRUE,
+    'default' => 0,
+    'description' => 'The Unix timestamp of the last comment that was posted within this node, from {comment}.changed.',
+  ));
+}
+
+/**
+ * @} End of "addtogroup updates-7.x-extra"
+ */
+
 /**
  * Implements hook_schema().
  */
@@ -506,7 +527,7 @@ function comment_schema() {
         'type' => 'int',
         'not null' => TRUE,
         'default' => 0,
-        'description' => 'The Unix timestamp of the last comment that was posted within this node, from {comment}.timestamp.',
+        'description' => 'The Unix timestamp of the last comment that was posted within this node, from {comment}.changed.',
       ),
       'last_comment_name' => array(
         'type' => 'varchar',
diff --git a/modules/comment/comment.module b/modules/comment/comment.module
index c17c5a6beaff3390e097df6f1a56682e78768f53..239cd5bec704471f6b3a8035fbec1e30896da9c3 100644
--- a/modules/comment/comment.module
+++ b/modules/comment/comment.module
@@ -92,7 +92,7 @@ function comment_help($path, $arg) {
  * Implements hook_entity_info().
  */
 function comment_entity_info() {
-  $return =  array(
+  $return = array(
     'comment' => array(
       'label' => t('Comment'),
       'base table' => 'comment',
@@ -118,6 +118,9 @@ function comment_entity_info() {
   foreach (node_type_get_names() as $type => $name) {
     $return['comment']['bundles']['comment_node_' . $type] = array(
       'label' => t('@node_type comment', array('@node_type' => $name)),
+      // Provide the node type/bundle name for other modules, so it does not
+      // have to be extracted manually from the bundle name.
+      'node bundle' => $type,
       'admin' => array(
         // Place the Field UI paths for comments one level below the
         // corresponding paths for nodes, so that they appear in the same set
@@ -542,7 +545,7 @@ function comment_new_page_count($num_comments, $new_replies, $node) {
   elseif ($flat) {
     // Flat comments.
     $count = $num_comments - $new_replies;
-    $pageno =  $count / $comments_per_page;
+    $pageno = $count / $comments_per_page;
   }
   else {
     // Threaded comments: we build a query with a subquery to find the first
@@ -575,7 +578,7 @@ function comment_new_page_count($num_comments, $new_replies, $node) {
       ':thread' => $first_thread,
     ))->fetchField();
 
-    $pageno =  $count / $comments_per_page;
+    $pageno = $count / $comments_per_page;
   }
 
   if ($pageno >= 1) {
@@ -1439,7 +1442,7 @@ function comment_save($comment) {
 
   $transaction = db_transaction();
   try {
-    $defaults =  array(
+    $defaults = array(
       'mail' => '',
       'homepage' => '',
       'name' => '',
@@ -1633,6 +1636,9 @@ function comment_delete_multiple($cids) {
  *   values those fields must have. Instead, it is preferable to use
  *   EntityFieldQuery to retrieve a list of entity IDs loadable by
  *   this function.
+ * @param $reset
+ *   Whether to reset the internal static entity cache. Note that the static
+ *   cache is disabled in comment_entity_info() by default.
  *
  * @return
  *   An array of comment objects, indexed by comment ID.
@@ -1642,8 +1648,8 @@ function comment_delete_multiple($cids) {
  *
  * @todo Remove $conditions in Drupal 8.
  */
-function comment_load_multiple($cids = array(), $conditions = array()) {
-  return entity_load('comment', $cids, $conditions);
+function comment_load_multiple($cids = array(), $conditions = array(), $reset = FALSE) {
+  return entity_load('comment', $cids, $conditions, $reset);
 }
 
 /**
@@ -1651,11 +1657,15 @@ function comment_load_multiple($cids = array(), $conditions = array()) {
  *
  * @param $cid
  *   The identifying comment id.
+ * @param $reset
+ *   Whether to reset the internal static entity cache. Note that the static
+ *   cache is disabled in comment_entity_info() by default.
+ *
  * @return
  *   The comment object.
  */
-function comment_load($cid) {
-  $comment = comment_load_multiple(array($cid));
+function comment_load($cid, $reset = FALSE) {
+  $comment = comment_load_multiple(array($cid), array(), $reset);
   return $comment ? $comment[$cid] : FALSE;
 }
 
@@ -1711,7 +1721,7 @@ function comment_num_new($nid, $timestamp = 0) {
     $timestamp = ($timestamp > NODE_NEW_LIMIT ? $timestamp : NODE_NEW_LIMIT);
 
     // Use the timestamp to retrieve the number of new comments.
-    return db_query('SELECT COUNT(cid) FROM {comment} WHERE nid = :nid  AND created > :timestamp AND status = :status', array(
+    return db_query('SELECT COUNT(cid) FROM {comment} WHERE nid = :nid AND created > :timestamp AND status = :status', array(
       ':nid' => $nid,
       ':timestamp' => $timestamp,
       ':status' => COMMENT_PUBLISHED,
@@ -2279,13 +2289,13 @@ function template_preprocess_comment(&$variables) {
 
   // Set status to a string representation of comment->status.
   if (isset($comment->in_preview)) {
-    $variables['status']  = 'comment-preview';
+    $variables['status'] = 'comment-preview';
   }
   else {
-    $variables['status']  = ($comment->status == COMMENT_NOT_PUBLISHED) ? 'comment-unpublished' : 'comment-published';
+    $variables['status'] = ($comment->status == COMMENT_NOT_PUBLISHED) ? 'comment-unpublished' : 'comment-published';
   }
   // Gather comment classes.
-  if ($comment->uid === 0) {
+  if ($comment->uid == 0) {
     $variables['classes_array'][] = 'comment-by-anonymous';
   }
   else {
diff --git a/modules/comment/comment.test b/modules/comment/comment.test
index c9478f4917cfc7798a23402414488013ea4a630c..f4e57c110ccd2b215f52c259b4021cc803a0a52c 100644
--- a/modules/comment/comment.test
+++ b/modules/comment/comment.test
@@ -331,6 +331,8 @@ class CommentInterfaceTest extends CommentHelperCase {
     $comment = $this->postComment($this->node, $comment_text);
     $comment_loaded = comment_load($comment->id);
     $this->assertTrue($this->commentExists($comment), t('Comment found.'));
+    $by_viewer_class = $this->xpath('//a[@id=:comment_id]/following-sibling::div[1][contains(@class, "comment-by-viewer")]', array(':comment_id' => 'comment-' . $comment->id));
+    $this->assertTrue(!empty($by_viewer_class), t('HTML class for comments by viewer found.'));
 
     // Set comments to have subject and preview to required.
     $this->drupalLogout();
@@ -417,6 +419,11 @@ class CommentInterfaceTest extends CommentHelperCase {
     $this->assertTrue($this->commentExists($reply, TRUE), t('Page two exists. %s'));
     $this->setCommentsPerPage(50);
 
+    // Create comment #5 to assert HTML class.
+    $comment = $this->postComment($this->node, $this->randomName(), $this->randomName());
+    $by_node_author_class = $this->xpath('//a[@id=:comment_id]/following-sibling::div[1][contains(@class, "comment-by-node-author")]', array(':comment_id' => 'comment-' . $comment->id));
+    $this->assertTrue(!empty($by_node_author_class), t('HTML class for node author found.'));
+
     // Attempt to post to node with comments disabled.
     $this->node = $this->drupalCreateNode(array('type' => 'article', 'promote' => 1, 'comment' => COMMENT_NODE_HIDDEN));
     $this->assertTrue($this->node, t('Article node created.'));
@@ -963,6 +970,8 @@ class CommentAnonymous extends CommentHelperCase {
     // Post anonymous comment without contact info.
     $anonymous_comment1 = $this->postComment($this->node, $this->randomName(), $this->randomName());
     $this->assertTrue($this->commentExists($anonymous_comment1), t('Anonymous comment without contact info found.'));
+    $anonymous_class = $this->xpath('//a[@id=:comment_id]/following-sibling::div[1][contains(@class, "comment-by-anonymous")]', array(':comment_id' => 'comment-' . $anonymous_comment1->id));
+    $this->assertTrue(!empty($anonymous_class), t('HTML class for anonymous comments found.'));
 
     // Allow contact info.
     $this->drupalLogin($this->admin_user);
diff --git a/modules/comment/comment.tokens.inc b/modules/comment/comment.tokens.inc
index d62b7e2f8f05971cd8476118f80c224bd4da1cda..c495ec35d6635375a653e3353dd6d4759b04a61d 100644
--- a/modules/comment/comment.tokens.inc
+++ b/modules/comment/comment.tokens.inc
@@ -155,9 +155,11 @@ function comment_tokens($type, $tokens, array $data = array(), array $options =
           break;
 
         case 'body':
-          $item = $comment->comment_body[LANGUAGE_NONE][0];
-          $instance = field_info_instance('comment', 'body', 'comment_body');
-          $replacements[$original] = $sanitize ? _text_sanitize($instance, LANGUAGE_NONE, $item, 'value') : $item['value'];
+          if ($items = field_get_items('comment', $comment, 'comment_body', $language_code)) {
+            $instance = field_info_instance('comment', 'body', 'comment_body');
+            $field_langcode = field_language('comment', $comment, 'comment_body', $language_code);
+            $replacements[$original] = $sanitize ? _text_sanitize($instance, $field_langcode, $items[0], 'value') : $items[0]['value'];
+          }
           break;
 
         // Comment related URLs.
diff --git a/modules/contact/contact.info b/modules/contact/contact.info
index b495d537bccf2bb6a16853597864052734fbe104..57ddb59ab0e7426c6d720ec83aacc8f20356f2f7 100644
--- a/modules/contact/contact.info
+++ b/modules/contact/contact.info
@@ -6,8 +6,8 @@ core = 7.x
 files[] = contact.test
 configure = admin/structure/contact
 
-; Information added by drupal.org packaging script on 2011-08-31
-version = "7.8"
+; Information added by drupal.org packaging script on 2011-10-26
+version = "7.9"
 project = "drupal"
-datestamp = "1314817616"
+datestamp = "1319660730"
 
diff --git a/modules/contact/contact.test b/modules/contact/contact.test
index bc44f5a04339843f5e786eb4e5a464a4b633b940..129eb30ce34320d29400d610104da242ae625935 100644
--- a/modules/contact/contact.test
+++ b/modules/contact/contact.test
@@ -262,7 +262,7 @@ class ContactSitewideTestCase extends DrupalWebTestCase {
     foreach ($categories as $category) {
       $category_name = db_query("SELECT category FROM {contact} WHERE cid = :cid", array(':cid' => $category))->fetchField();
       $this->drupalPost('admin/structure/contact/delete/' . $category, array(), t('Delete'));
-      $this->assertRaw(t('Category %category has been deleted.', array('%category' => $category_name)), t('Category deleted sucessfully.'));
+      $this->assertRaw(t('Category %category has been deleted.', array('%category' => $category_name)), t('Category deleted successfully.'));
     }
   }
 
diff --git a/modules/contextual/contextual.css b/modules/contextual/contextual.css
index e49eb3755b9d77941e99a9a9295df2b2357715be..fd715147f2e311912acb43e5d0c73dafab3af0ed 100644
--- a/modules/contextual/contextual.css
+++ b/modules/contextual/contextual.css
@@ -45,7 +45,6 @@ div.contextual-links-active a.contextual-links-trigger {
   background-position: 2px -18px;
 }
 div.contextual-links-active a.contextual-links-trigger {
-  background-position: 2px -18px;
   background-color: #fff;
   border-color: #ccc;
   border-bottom: none;
diff --git a/modules/contextual/contextual.info b/modules/contextual/contextual.info
index e07c458d8ac24dc37d5d6ffeb1e779e00f962191..0a25b495345abd6626bc2844953909e23f6ca10a 100644
--- a/modules/contextual/contextual.info
+++ b/modules/contextual/contextual.info
@@ -4,8 +4,8 @@ package = Core
 version = VERSION
 core = 7.x
 
-; Information added by drupal.org packaging script on 2011-08-31
-version = "7.8"
+; Information added by drupal.org packaging script on 2011-10-26
+version = "7.9"
 project = "drupal"
-datestamp = "1314817616"
+datestamp = "1319660730"
 
diff --git a/modules/dashboard/dashboard.info b/modules/dashboard/dashboard.info
index 47b3e729b00eeecfa60c2197bbaa29da5824a090..9425f434c7ef08b96ee90b387d77ff4c6822e9a9 100644
--- a/modules/dashboard/dashboard.info
+++ b/modules/dashboard/dashboard.info
@@ -7,8 +7,8 @@ files[] = dashboard.test
 dependencies[] = block
 configure = admin/dashboard/customize
 
-; Information added by drupal.org packaging script on 2011-08-31
-version = "7.8"
+; Information added by drupal.org packaging script on 2011-10-26
+version = "7.9"
 project = "drupal"
-datestamp = "1314817616"
+datestamp = "1319660730"
 
diff --git a/modules/dblog/dblog.css b/modules/dblog/dblog.css
index ff310e3baa20e38d13b59332bd9b491ae1a0e8f0..88f4ba01b8ad39facb296f7300c8eedadaacb422 100644
--- a/modules/dblog/dblog.css
+++ b/modules/dblog/dblog.css
@@ -1,4 +1,3 @@
-
 .form-item-type,
 .form-item-severity {
   float: left; /* LTR */
@@ -52,7 +51,9 @@ table#admin-dblog td.icon {
 table#admin-dblog tr.dblog-warning td.icon {
   background-image: url(../../misc/message-16-warning.png);
 }
-table#admin-dblog tr.dblog-error td.icon {
+table#admin-dblog tr.dblog-error td.icon,
+table#admin-dblog tr.dblog-critical td.icon,
+table#admin-dblog tr.dblog-alert td.icon,
+table#admin-dblog tr.dblog-emerg td.icon {
   background-image: url(../../misc/message-16-error.png);
 }
-
diff --git a/modules/dblog/dblog.info b/modules/dblog/dblog.info
index d56ea691d8fd51cdb4f21f85786725f383b97bf1..c379a61b478c27cc75fad7bd20c9bfda128af714 100644
--- a/modules/dblog/dblog.info
+++ b/modules/dblog/dblog.info
@@ -5,8 +5,8 @@ version = VERSION
 core = 7.x
 files[] = dblog.test
 
-; Information added by drupal.org packaging script on 2011-08-31
-version = "7.8"
+; Information added by drupal.org packaging script on 2011-10-26
+version = "7.9"
 project = "drupal"
-datestamp = "1314817616"
+datestamp = "1319660730"
 
diff --git a/modules/field/field.api.php b/modules/field/field.api.php
index 88f9231ac8ce711cee6e21b17a52c2859e40a0ed..74eae62ab50a75ce7b4cf02be18d92fd64265ff9 100644
--- a/modules/field/field.api.php
+++ b/modules/field/field.api.php
@@ -2531,7 +2531,7 @@ function hook_field_purge_field($field) {
  * @param $instance
  *   The instance being purged.
  */
-function hook_field_purge_field_instance($instance) {
+function hook_field_purge_instance($instance) {
   db_delete('my_module_field_instance_info')
     ->condition('id', $instance['id'])
     ->execute();
diff --git a/modules/field/field.crud.inc b/modules/field/field.crud.inc
index a6aaab1265f8e5f9879ada778eb55b4b5709ce6a..e34c0c5282b2d4185857ce377a6e82b6b1788f01 100644
--- a/modules/field/field.crud.inc
+++ b/modules/field/field.crud.inc
@@ -727,7 +727,7 @@ function field_read_instances($params = array(), $include_additional = array())
  *   An instance structure.
  * @param $field_cleanup
  *   If TRUE, the field will be deleted as well if its last instance is being
- *   deleted. If FALSE, it is the caller's responsability to handle the case of
+ *   deleted. If FALSE, it is the caller's responsibility to handle the case of
  *   fields left without instances. Defaults to TRUE.
  */
 function field_delete_instance($instance, $field_cleanup = TRUE) {
diff --git a/modules/field/field.form.inc b/modules/field/field.form.inc
index 80c1daca6b5bdc0ad1fb9403ce0c1584fdf4e8fb..4b92501fcab3d233a4311060757f9a4d07be0507 100644
--- a/modules/field/field.form.inc
+++ b/modules/field/field.form.inc
@@ -273,7 +273,7 @@ function theme_field_multiple_value_form($variables) {
   if ($element['#cardinality'] > 1 || $element['#cardinality'] == FIELD_CARDINALITY_UNLIMITED) {
     $table_id = drupal_html_id($element['#field_name'] . '_values');
     $order_class = $element['#field_name'] . '-delta-order';
-    $required = !empty($element['#required']) ? '<span class="form-required" title="' . t('This field is required. ') . '">*</span>' : '';
+    $required = !empty($element['#required']) ? theme('form_required_marker', $variables) : '';
 
     $header = array(
       array(
diff --git a/modules/field/field.info b/modules/field/field.info
index faeb72aa7e806d6ceb9aa1077d750f43f009404c..41e1783de214c9ee3e34b15fcbfac48a0a84d297 100644
--- a/modules/field/field.info
+++ b/modules/field/field.info
@@ -10,8 +10,8 @@ dependencies[] = field_sql_storage
 required = TRUE
 stylesheets[all][] = theme/field.css
 
-; Information added by drupal.org packaging script on 2011-08-31
-version = "7.8"
+; Information added by drupal.org packaging script on 2011-10-26
+version = "7.9"
 project = "drupal"
-datestamp = "1314817616"
+datestamp = "1319660730"
 
diff --git a/modules/field/field.module b/modules/field/field.module
index d99fcd0d65f53e1fda28fe8b5cc757742d390f6e..d110c4878506468085c209569dbaf1d4bb6755c0 100644
--- a/modules/field/field.module
+++ b/modules/field/field.module
@@ -221,6 +221,9 @@ require_once DRUPAL_ROOT . '/modules/field/field.form.inc';
  *     - other_mode
  *        - ...
  *
+ * The (default) render arrays produced for field instances are documented at
+ * field_attach_view().
+ *
  * Bundles are represented by two strings, an entity type and a bundle name.
  *
  * - @link field_types Field Types API @endlink. Defines field types,
@@ -515,7 +518,6 @@ function field_get_default_value($entity_type, $entity, $field, $instance, $lang
  */
 function _field_filter_items($field, $items) {
   $function = $field['module'] . '_field_is_empty';
-  function_exists($function);
   foreach ((array) $items as $delta => $item) {
     // Explicitly break if the function is undefined.
     if ($function($item, $field)) {
diff --git a/modules/field/modules/field_sql_storage/field_sql_storage.info b/modules/field/modules/field_sql_storage/field_sql_storage.info
index 537bc675a0e48f987860839566953e67e0a2bbc3..fd33d00af081e182a266e70ec9341da958f7a1bd 100644
--- a/modules/field/modules/field_sql_storage/field_sql_storage.info
+++ b/modules/field/modules/field_sql_storage/field_sql_storage.info
@@ -7,8 +7,8 @@ dependencies[] = field
 files[] = field_sql_storage.test
 required = TRUE
 
-; Information added by drupal.org packaging script on 2011-08-31
-version = "7.8"
+; Information added by drupal.org packaging script on 2011-10-26
+version = "7.9"
 project = "drupal"
-datestamp = "1314817616"
+datestamp = "1319660730"
 
diff --git a/modules/field/modules/field_sql_storage/field_sql_storage.module b/modules/field/modules/field_sql_storage/field_sql_storage.module
index 10bae64b59728ca30b1e64fe8c1b983de1e719fb..2ed783507d855f14ed87e921d6e6f0db9b2279d3 100644
--- a/modules/field/modules/field_sql_storage/field_sql_storage.module
+++ b/modules/field/modules/field_sql_storage/field_sql_storage.module
@@ -236,13 +236,37 @@ function field_sql_storage_field_update_forbid($field, $prior_field, $has_data)
 function field_sql_storage_field_storage_update_field($field, $prior_field, $has_data) {
   if (! $has_data) {
     // There is no data. Re-create the tables completely.
-    $prior_schema = _field_sql_storage_schema($prior_field);
-    foreach ($prior_schema as $name => $table) {
-      db_drop_table($name, $table);
+
+    if (Database::getConnection()->supportsTransactionalDDL()) {
+      // If the database supports transactional DDL, we can go ahead and rely
+      // on it. If not, we will have to rollback manually if something fails.
+      $transaction = db_transaction();
+    }
+
+    try {
+      $prior_schema = _field_sql_storage_schema($prior_field);
+      foreach ($prior_schema as $name => $table) {
+        db_drop_table($name, $table);
+      }
+      $schema = _field_sql_storage_schema($field);
+      foreach ($schema as $name => $table) {
+        db_create_table($name, $table);
+      }
     }
-    $schema = _field_sql_storage_schema($field);
-    foreach ($schema as $name => $table) {
-      db_create_table($name, $table);
+    catch (Exception $e) {
+      if (Database::getConnection()->supportsTransactionalDDL()) {
+        $transaction->rollback();
+      }
+      else {
+        // Recreate tables.
+        $prior_schema = _field_sql_storage_schema($prior_field);
+        foreach ($prior_schema as $name => $table) {
+          if (!db_table_exists($name)) {
+            db_create_table($name, $table);
+          }
+        }
+      }
+      throw $e;
     }
   }
   else {
@@ -493,7 +517,7 @@ function field_sql_storage_field_storage_query(EntityFieldQuery $query) {
       $select_query->fields($table_alias, array('entity_type', 'entity_id', 'revision_id', 'bundle'));
       $field_base_table = $table_alias;
     }
-    if ($field['cardinality'] != 1) {
+    if ($field['cardinality'] != 1 || $field['translatable']) {
       $select_query->distinct();
     }
   }
diff --git a/modules/field/modules/field_sql_storage/field_sql_storage.test b/modules/field/modules/field_sql_storage/field_sql_storage.test
index f94344fa208b4744257b90bf6ac31c821276c19e..773de3d072dc03c2d76b5a94ac2be11301832196 100644
--- a/modules/field/modules/field_sql_storage/field_sql_storage.test
+++ b/modules/field/modules/field_sql_storage/field_sql_storage.test
@@ -305,6 +305,31 @@ class FieldSqlStorageTestCase extends DrupalWebTestCase {
     }
   }
 
+  /**
+   * Test that failure to create fields is handled gracefully.
+   */
+  function testFieldUpdateFailure() {
+    // Create a text field.
+    $field = array('field_name' => 'test_text', 'type' => 'text', 'settings' => array('max_length' => 255));
+    $field = field_create_field($field);
+
+    // Attempt to update the field in a way that would break the storage.
+    $prior_field = $field;
+    $field['settings']['max_length'] = -1;
+    try {
+      field_update_field($field);
+      $this->fail(t('Update succeeded.'));
+    }
+    catch (Exception $e) {
+      $this->pass(t('Update properly failed.'));
+    }
+
+    // Ensure that the field tables are still there.
+    foreach (_field_sql_storage_schema($prior_field) as $table_name => $table_info) {
+      $this->assertTrue(db_table_exists($table_name), t('Table %table exists.', array('%table' => $table_name)));
+    }
+  }
+
   /**
    * Test adding and removing indexes while data is present.
    */
diff --git a/modules/field/modules/list/list.info b/modules/field/modules/list/list.info
index 9431ee62fcfb406941260725ef2ae4262f6c128c..01d6a11abfa5fd332f977ecf014c2047d6091ee2 100644
--- a/modules/field/modules/list/list.info
+++ b/modules/field/modules/list/list.info
@@ -7,8 +7,8 @@ dependencies[] = field
 dependencies[] = options
 files[] = tests/list.test
 
-; Information added by drupal.org packaging script on 2011-08-31
-version = "7.8"
+; Information added by drupal.org packaging script on 2011-10-26
+version = "7.9"
 project = "drupal"
-datestamp = "1314817616"
+datestamp = "1319660730"
 
diff --git a/modules/field/modules/list/list.module b/modules/field/modules/list/list.module
index 2518ebcfc29c1960a635a732e3c547da16822a6c..1d72be44a5d8ebb15e4b146b9e2ab969b70cceeb 100644
--- a/modules/field/modules/list/list.module
+++ b/modules/field/modules/list/list.module
@@ -248,7 +248,7 @@ function list_allowed_values($field) {
  * Parses a string of 'allowed values' into an array.
  *
  * @param $string
- *   The list of allowed values in string format descibed in
+ *   The list of allowed values in string format described in
  *   list_allowed_values_string().
  * @param $field_type
  *   The field type. Either 'list_number' or 'list_text'.
diff --git a/modules/field/modules/list/tests/list.test b/modules/field/modules/list/tests/list.test
index dec09560f8761eeccc31b5aa646815ebd618ba65..765901a849932f29a352fa35649a2fa8e72713c3 100644
--- a/modules/field/modules/list/tests/list.test
+++ b/modules/field/modules/list/tests/list.test
@@ -303,7 +303,7 @@ class ListFieldUITestCase extends FieldTestCase {
     $this->field_name = 'field_list_boolean';
     $this->createListField('list_boolean');
 
-    // Check that the seperate 'On' and 'Off' form fields work.
+    // Check that the separate 'On' and 'Off' form fields work.
     $on = $this->randomName();
     $off = $this->randomName();
     $allowed_values = array(1 => $on, 0 => $off);
diff --git a/modules/field/modules/list/tests/list_test.info b/modules/field/modules/list/tests/list_test.info
index 86bec875a1507bde5104a63d829df8bbd3628577..2647d2a3fbf9667b2f56f6f6857c9e2aba3ad1b5 100644
--- a/modules/field/modules/list/tests/list_test.info
+++ b/modules/field/modules/list/tests/list_test.info
@@ -5,8 +5,8 @@ package = Testing
 version = VERSION
 hidden = TRUE
 
-; Information added by drupal.org packaging script on 2011-08-31
-version = "7.8"
+; Information added by drupal.org packaging script on 2011-10-26
+version = "7.9"
 project = "drupal"
-datestamp = "1314817616"
+datestamp = "1319660730"
 
diff --git a/modules/field/modules/number/number.info b/modules/field/modules/number/number.info
index a716f1363e37e3c74faf6d3938dbb0ed2830d187..10c6efa85f4779d00d6890c1bcea46d8290b1f71 100644
--- a/modules/field/modules/number/number.info
+++ b/modules/field/modules/number/number.info
@@ -6,8 +6,8 @@ core = 7.x
 dependencies[] = field
 files[] = number.test
 
-; Information added by drupal.org packaging script on 2011-08-31
-version = "7.8"
+; Information added by drupal.org packaging script on 2011-10-26
+version = "7.9"
 project = "drupal"
-datestamp = "1314817616"
+datestamp = "1319660730"
 
diff --git a/modules/field/modules/number/number.module b/modules/field/modules/number/number.module
index fd536730836f5821123e4f682a466de40f15558b..ad5514570a5a6399a977111a06aa55fd478e01a6 100644
--- a/modules/field/modules/number/number.module
+++ b/modules/field/modules/number/number.module
@@ -181,11 +181,18 @@ function number_field_is_empty($item, $field) {
  */
 function number_field_formatter_info() {
   return array(
+    // The 'Default' formatter is different for integer fields on the one hand,
+    // and for decimal and float fields on the other hand, in order to be able
+    // to use different default values for the settings.
     'number_integer' => array(
       'label' => t('Default'),
       'field types' => array('number_integer'),
       'settings' =>  array(
         'thousand_separator' => ' ',
+        // The 'decimal_separator' and 'scale' settings are not configurable
+        // through the UI, and will therefore keep their default values. They
+        // are only present so that the 'number_integer' and 'number_decimal'
+        // formatters can use the same code.
         'decimal_separator' => '.',
         'scale' => 0,
         'prefix_suffix' => TRUE,
@@ -215,40 +222,42 @@ function number_field_formatter_settings_form($field, $instance, $view_mode, $fo
   $display = $instance['display'][$view_mode];
   $settings = $display['settings'];
 
-  $options = array(
-    ''  => t('<none>'),
-    '.' => t('Decimal point'),
-    ',' => t('Comma'),
-    ' ' => t('Space'),
-  );
-  $element['thousand_separator'] = array(
-    '#type' => 'select',
-    '#title' => t('Thousand marker'),
-    '#options' => $options,
-    '#default_value' => $settings['thousand_separator'],
-  );
-
-  if ($display['type'] == 'number_decimal' || $display['type'] == 'number_float') {
-    $element['decimal_separator'] = array(
-      '#type' => 'select',
-      '#title' => t('Decimal marker'),
-      '#options' => array('.' => t('Decimal point'), ',' => t('Comma')),
-      '#default_value' => $settings['decimal_separator'],
+  if ($display['type'] == 'number_decimal' || $display['type'] == 'number_integer') {
+    $options = array(
+      ''  => t('<none>'),
+      '.' => t('Decimal point'),
+      ',' => t('Comma'),
+      ' ' => t('Space'),
     );
-    $element['scale'] = array(
+    $element['thousand_separator'] = array(
       '#type' => 'select',
-      '#title' => t('Scale'),
-      '#options' => drupal_map_assoc(range(0, 10)),
-      '#default_value' => $settings['scale'],
-      '#description' => t('The number of digits to the right of the decimal.'),
+      '#title' => t('Thousand marker'),
+      '#options' => $options,
+      '#default_value' => $settings['thousand_separator'],
     );
-  }
 
-  $element['prefix_suffix'] = array(
-    '#type' => 'checkbox',
-    '#title' => t('Display prefix and suffix.'),
-    '#default_value' => $settings['prefix_suffix'],
-  );
+    if ($display['type'] == 'number_decimal') {
+      $element['decimal_separator'] = array(
+        '#type' => 'select',
+        '#title' => t('Decimal marker'),
+        '#options' => array('.' => t('Decimal point'), ',' => t('Comma')),
+        '#default_value' => $settings['decimal_separator'],
+      );
+      $element['scale'] = array(
+        '#type' => 'select',
+        '#title' => t('Scale'),
+        '#options' => drupal_map_assoc(range(0, 10)),
+        '#default_value' => $settings['scale'],
+        '#description' => t('The number of digits to the right of the decimal.'),
+      );
+    }
+
+    $element['prefix_suffix'] = array(
+      '#type' => 'checkbox',
+      '#title' => t('Display prefix and suffix.'),
+      '#default_value' => $settings['prefix_suffix'],
+    );
+  }
 
   return $element;
 }
@@ -261,9 +270,11 @@ function number_field_formatter_settings_summary($field, $instance, $view_mode)
   $settings = $display['settings'];
 
   $summary = array();
-  $summary[] = number_format(1234.1234567890, $settings['scale'], $settings['decimal_separator'], $settings['thousand_separator']);
-  if ($settings['prefix_suffix']) {
-    $summary[] = t('Display with prefix and suffix.');
+  if ($display['type'] == 'number_decimal' || $display['type'] == 'number_integer') {
+    $summary[] = number_format(1234.1234567890, $settings['scale'], $settings['decimal_separator'], $settings['thousand_separator']);
+    if ($settings['prefix_suffix']) {
+      $summary[] = t('Display with prefix and suffix.');
+    }
   }
 
   return implode('<br />', $summary);
diff --git a/modules/field/modules/number/number.test b/modules/field/modules/number/number.test
index 3b0cbafae3247b87e3e666005b3518a6f28ce2a3..e96be42a70e0199feae435353b203e2848d1373f 100644
--- a/modules/field/modules/number/number.test
+++ b/modules/field/modules/number/number.test
@@ -23,7 +23,7 @@ class NumberFieldTestCase extends DrupalWebTestCase {
 
   function setUp() {
     parent::setUp('field_test');
-    $this->web_user = $this->drupalCreateUser(array('access field_test content', 'administer field_test content'));
+    $this->web_user = $this->drupalCreateUser(array('access field_test content', 'administer field_test content', 'administer content types'));
     $this->drupalLogin($this->web_user);
   }
 
@@ -93,4 +93,41 @@ class NumberFieldTestCase extends DrupalWebTestCase {
       );
     }
   }
+
+  /**
+   * Test number_integer field.
+   */
+  function testNumberIntegerField() {
+    // Display the "Add content type" form.
+    $this->drupalGet('admin/structure/types/add');
+
+    // Add a content type.
+    $name = $this->randomName();
+    $type = drupal_strtolower($name);
+    $edit = array('name' => $name, 'type' => $type);
+    $this->drupalPost(NULL, $edit, t('Save and add fields'));
+
+    // Add an integer field to the newly-created type.
+    $label = $this->randomName();
+    $field_name = drupal_strtolower($label);
+    $edit = array(
+      'fields[_add_new_field][label]'=> $label,
+      'fields[_add_new_field][field_name]' => $field_name,
+      'fields[_add_new_field][type]' => 'number_integer',
+      'fields[_add_new_field][widget_type]' => 'number',
+    );
+    $this->drupalPost(NULL, $edit, t('Save'));
+
+    // Set the formatter to "number_integer" and to "unformatted", and just
+    // check that the settings summary does not generate warnings.
+    $this->drupalGet("admin/structure/types/manage/$type/display");
+    $edit = array(
+      "fields[field_$field_name][type]" => 'number_integer',
+    );
+    $this->drupalPost(NULL, $edit, t('Save'));
+    $edit = array(
+      "fields[field_$field_name][type]" => 'number_unformatted',
+    );
+    $this->drupalPost(NULL, $edit, t('Save'));
+  }
 }
diff --git a/modules/field/modules/options/options.api.php b/modules/field/modules/options/options.api.php
index dfbb631c64ab97057d52d62c1da01a368075abb3..68374446e423467f87673061e84fd6b276005561 100644
--- a/modules/field/modules/options/options.api.php
+++ b/modules/field/modules/options/options.api.php
@@ -15,6 +15,11 @@
  *
  * @param $field
  *   The field definition.
+ * @param $instance
+ *   (optional) The instance definition. The hook might be called without an
+ *   $instance parameter in contexts where no specific instance can be targeted.
+ *   It is recommended to only use instance level properties to filter out
+ *   values from a list defined by field level properties.
  *
  * @return
  *   The array of options for the field. Array keys are the values to be
@@ -25,7 +30,7 @@
  *   widget. The HTML tags defined in _field_filter_xss_allowed_tags() are
  *   allowed, other tags will be filtered.
  */
-function hook_options_list($field) {
+function hook_options_list($field, $instance = NULL) {
   // Sample structure.
   $options = array(
     0 => t('Zero'),
diff --git a/modules/field/modules/options/options.info b/modules/field/modules/options/options.info
index ccd8ae50bf5a8b58871ac1fc24901f0dc5922c51..a8494fd27fae626a074863c529fdf0d195e4e4a7 100644
--- a/modules/field/modules/options/options.info
+++ b/modules/field/modules/options/options.info
@@ -6,8 +6,8 @@ core = 7.x
 dependencies[] = field
 files[] = options.test
 
-; Information added by drupal.org packaging script on 2011-08-31
-version = "7.8"
+; Information added by drupal.org packaging script on 2011-10-26
+version = "7.9"
 project = "drupal"
-datestamp = "1314817616"
+datestamp = "1319660730"
 
diff --git a/modules/field/modules/options/options.module b/modules/field/modules/options/options.module
index 385f3f47f6a7e92cda1698a5cec2bba94fb698ae..d4d05eca2948f0ff01325a12d6609900d10c90b7 100644
--- a/modules/field/modules/options/options.module
+++ b/modules/field/modules/options/options.module
@@ -231,7 +231,7 @@ function _options_properties($type, $multiple, $required, $has_value) {
  */
 function _options_get_options($field, $instance, $properties) {
   // Get the list of options.
-  $options = (array) module_invoke($field['module'], 'options_list', $field);
+  $options = (array) module_invoke($field['module'], 'options_list', $field, $instance);
 
   // Sanitize the options.
   _options_prepare_options($options, $properties);
diff --git a/modules/field/modules/text/text.info b/modules/field/modules/text/text.info
index e8cb4238fed01c20ed0af5c356acfbca3c3a347f..f0cfd47ff3b5559de05fded73c49b6f91c4edc4d 100644
--- a/modules/field/modules/text/text.info
+++ b/modules/field/modules/text/text.info
@@ -7,8 +7,8 @@ dependencies[] = field
 files[] = text.test
 required = TRUE
 
-; Information added by drupal.org packaging script on 2011-08-31
-version = "7.8"
+; Information added by drupal.org packaging script on 2011-10-26
+version = "7.9"
 project = "drupal"
-datestamp = "1314817616"
+datestamp = "1319660730"
 
diff --git a/modules/field/tests/field_test.info b/modules/field/tests/field_test.info
index 1b9d5617b2ee90b87cd01cd95db96f16554f2c6e..3d1bb45f8a4313e0fca5069c3d85ade19adf7d8c 100644
--- a/modules/field/tests/field_test.info
+++ b/modules/field/tests/field_test.info
@@ -6,8 +6,8 @@ files[] = field_test.entity.inc
 version = VERSION
 hidden = TRUE
 
-; Information added by drupal.org packaging script on 2011-08-31
-version = "7.8"
+; Information added by drupal.org packaging script on 2011-10-26
+version = "7.9"
 project = "drupal"
-datestamp = "1314817616"
+datestamp = "1319660730"
 
diff --git a/modules/field/tests/field_test.storage.inc b/modules/field/tests/field_test.storage.inc
index 3ca322dd74e0f084df8debe5a9cbb3d573685b73..a26af17655259bbcfb784353dd9b167bf80f2de8 100644
--- a/modules/field/tests/field_test.storage.inc
+++ b/modules/field/tests/field_test.storage.inc
@@ -282,7 +282,7 @@ function field_test_field_storage_query($field_id, $conditions, $count, &$cursor
           case '=':
             $match = $match && $row->{$column} == $value;
             break;
-          case '!=':
+          case '<>':
           case '<':
           case '<=':
           case '>':
diff --git a/modules/field/theme/field.tpl.php b/modules/field/theme/field.tpl.php
index e4cd85cd025b4803fc9fa8e7d674b91386cb8f16..9e76e3b9c12f4beb600b7efd859a26500e7ce09b 100644
--- a/modules/field/theme/field.tpl.php
+++ b/modules/field/theme/field.tpl.php
@@ -49,11 +49,11 @@ After copying this file to your theme's folder and customizing it, remove this
 HTML comment.
 -->
 <div class="<?php print $classes; ?> clearfix"<?php print $attributes; ?>>
-  <?php if (!$label_hidden) : ?>
+  <?php if (!$label_hidden): ?>
     <div class="field-label"<?php print $title_attributes; ?>><?php print $label ?>:&nbsp;</div>
   <?php endif; ?>
   <div class="field-items"<?php print $content_attributes; ?>>
-    <?php foreach ($items as $delta => $item) : ?>
+    <?php foreach ($items as $delta => $item): ?>
       <div class="field-item <?php print $delta % 2 ? 'odd' : 'even'; ?>"<?php print $item_attributes[$delta]; ?>><?php print render($item); ?></div>
     <?php endforeach; ?>
   </div>
diff --git a/modules/field_ui/field_ui.admin.inc b/modules/field_ui/field_ui.admin.inc
index 828d64ca865d44a0806f4ff129edde7ad598548b..693e8153d92cd9db4f786308080b0d9f5fc82699 100644
--- a/modules/field_ui/field_ui.admin.inc
+++ b/modules/field_ui/field_ui.admin.inc
@@ -254,12 +254,17 @@ function theme_field_ui_table($variables) {
         $row += $element['#attributes'];
       }
 
+      // Render children as table cells.
       foreach (element_children($element) as $cell_key) {
-        $cell = array('data' => drupal_render($element[$cell_key]));
-        if (isset($element[$cell_key]['#cell_attributes'])) {
-          $cell += $element[$cell_key]['#cell_attributes'];
+        $child = &$element[$cell_key];
+        // Do not render a cell for children of #type 'value'.
+        if (!(isset($child['#type']) && $child['#type'] == 'value')) {
+          $cell = array('data' => drupal_render($child));
+          if (isset($child['#cell_attributes'])) {
+            $cell += $child['#cell_attributes'];
+          }
+          $row['data'][] = $cell;
         }
-        $row['data'][] = $cell;
       }
       $table['rows'][] = $row;
     }
@@ -519,6 +524,8 @@ function field_ui_field_overview_form($form, &$form_state, $entity_type, $bundle
         '#cell_attributes' => array('colspan' => 3),
         '#prefix' => '<div class="add-new-placeholder">&nbsp;</div>',
       ),
+      // Place the 'translatable' property as an explicit value so that contrib
+      // modules can form_alter() the value for newly created fields.
       'translatable' => array(
         '#type' => 'value',
         '#value' => FALSE,
@@ -792,7 +799,7 @@ function field_ui_field_overview_form_submit($form, &$form_state) {
       $form_state['fields_added']['_add_new_field'] = $field['field_name'];
     }
     catch (Exception $e) {
-      drupal_set_message(t('There was a problem creating field %label: @message.', array('%label' => $instance['label'], '@message' => $e->getMessage())));
+      drupal_set_message(t('There was a problem creating field %label: @message.', array('%label' => $instance['label'], '@message' => $e->getMessage())), 'error');
     }
   }
 
@@ -822,7 +829,7 @@ function field_ui_field_overview_form_submit($form, &$form_state) {
         $form_state['fields_added']['_add_existing_field'] = $instance['field_name'];
       }
       catch (Exception $e) {
-        drupal_set_message(t('There was a problem creating field instance %label: @message.', array('%label' => $instance['label'], '@message' => $e->getMessage())));
+        drupal_set_message(t('There was a problem creating field instance %label: @message.', array('%label' => $instance['label'], '@message' => $e->getMessage())), 'error');
       }
     }
   }
@@ -1590,10 +1597,8 @@ function field_ui_field_settings_form_submit($form, &$form_state) {
     drupal_set_message(t('Updated field %label field settings.', array('%label' => $instance['label'])));
     $form_state['redirect'] = field_ui_next_destination($entity_type, $bundle);
   }
-  catch (FieldException $e) {
+  catch (Exception $e) {
     drupal_set_message(t('Attempt to update field %label failed: %message.', array('%label' => $instance['label'], '%message' => $e->getMessage())), 'error');
-    // TODO: Where do we go from here?
-    $form_state['redirect'] = field_ui_next_destination($entity_type, $bundle);
   }
 }
 
@@ -1664,7 +1669,7 @@ function field_ui_widget_type_form_submit($form, &$form_state) {
     field_update_instance($instance);
     drupal_set_message(t('Changed the widget for field %label.', array('%label' => $instance['label'])));
   }
-  catch (FieldException $e) {
+  catch (Exception $e) {
     drupal_set_message(t('There was a problem changing the widget for field %label.', array('%label' => $instance['label'])));
   }
 
@@ -1992,7 +1997,13 @@ function field_ui_field_edit_form_submit($form, &$form_state) {
   // Update any field settings that have changed.
   $field_source = field_info_field($instance['field_name']);
   $field = array_merge($field_source, $field);
-  field_update_field($field);
+  try {
+    field_update_field($field);
+  }
+  catch (Exception $e) {
+    drupal_set_message(t('Attempt to update field %label failed: %message.', array('%label' => $instance['label'], '%message' => $e->getMessage())), 'error');
+    return;
+  }
 
   // Handle the default value.
   if (isset($form['instance']['default_value_widget'])) {
diff --git a/modules/field_ui/field_ui.api.php b/modules/field_ui/field_ui.api.php
index b6446520a549b516ecb376fd12abac10206bb441..2340125122b2551e59119c36308c27ed4caead5e 100644
--- a/modules/field_ui/field_ui.api.php
+++ b/modules/field_ui/field_ui.api.php
@@ -82,7 +82,7 @@ function hook_field_instance_settings_form($field, $instance) {
         t('No'),
         t('Yes'),
       ),
-      '#description' => t('Display the summary to allow the user to input a summary value. Hide the summary to automatically fill it with a trimmed portion from the main post. '),
+      '#description' => t('Display the summary to allow the user to input a summary value. Hide the summary to automatically fill it with a trimmed portion from the main post.'),
       '#default_value' => !empty($settings['display_summary']) ? $settings['display_summary'] :  0,
     );
   }
diff --git a/modules/field_ui/field_ui.info b/modules/field_ui/field_ui.info
index 1c494d2a3b01eab847ee90622fd80cc9674690d4..430ea0600ef6760a8a2dea113393f050f03bd427 100644
--- a/modules/field_ui/field_ui.info
+++ b/modules/field_ui/field_ui.info
@@ -6,8 +6,8 @@ core = 7.x
 dependencies[] = field
 files[] = field_ui.test
 
-; Information added by drupal.org packaging script on 2011-08-31
-version = "7.8"
+; Information added by drupal.org packaging script on 2011-10-26
+version = "7.9"
 project = "drupal"
-datestamp = "1314817616"
+datestamp = "1319660730"
 
diff --git a/modules/field_ui/field_ui.module b/modules/field_ui/field_ui.module
index 27ef3c2d7ded82e31dd2f6c4c93b119f9d134828..3be23c88953c1f2ffecf0b4e94859e22191d144c 100644
--- a/modules/field_ui/field_ui.module
+++ b/modules/field_ui/field_ui.module
@@ -17,7 +17,7 @@ function field_ui_help($path, $arg) {
       $output .= '<h3>' . t('Uses') . '</h3>';
       $output .= '<dl>';
       $output .= '<dt>' . t('Planning fields') . '</dt>';
-      $output .= '<dd>' . t('There are several decisions you will need to make before definining a field for content, comments, etc.:') . '<dl>';
+      $output .= '<dd>' . t('There are several decisions you will need to make before defining a field for content, comments, etc.:') . '<dl>';
       $output .= '<dt>' . t('What the field will be called') . '</dt>';
       $output .= '<dd>' . t('A field has a <em>label</em> (the name displayed in the user interface) and a <em>machine name</em> (the name used internally). The label can be changed after you create the field, if needed, but the machine name cannot be changed after you have created the field.') . '</li>';
       $output .= '<dt>' . t('What type of data the field will store') . '</dt>';
@@ -47,6 +47,17 @@ function field_ui_help($path, $arg) {
   }
 }
 
+/**
+ * Implements hook_field_attach_rename_bundle().
+ */
+function field_ui_field_attach_rename_bundle($entity_type, $bundle_old, $bundle_new) {
+  // The Field UI relies on entity_get_info() to build menu items for entity
+  // field administration pages. Clear the entity info cache and ensure that
+  // the menu is rebuilt.
+  entity_info_cache_clear();
+  menu_rebuild();
+}
+
 /**
  * Implements hook_menu().
  */
diff --git a/modules/field_ui/field_ui.test b/modules/field_ui/field_ui.test
index 9ff6c17203f55749aab5c4b23c92d984a9b50926..e7c5e18e796bdbdb7bd8ad7edbc5ee3c3882fade 100644
--- a/modules/field_ui/field_ui.test
+++ b/modules/field_ui/field_ui.test
@@ -26,7 +26,7 @@ class FieldUITestCase extends DrupalWebTestCase {
     $this->drupalLogin($admin_user);
 
     // Create content type, with underscores.
-    $type_name =  strtolower($this->randomName(8)) . '_' .'test';
+    $type_name = strtolower($this->randomName(8)) . '_test';
     $type = $this->drupalCreateContentType(array('name' => $type_name, 'type' => $type_name));
     $this->type = $type->type;
     // Store a valid URL name, with hyphens instead of underscores.
@@ -343,7 +343,7 @@ class FieldUIManageFieldsTestCase extends FieldUITestCase {
     $this->fieldUIAddNewField($bundle_path1, $edit1);
 
     // Create an additional node type.
-    $type_name2 =  strtolower($this->randomName(8)) . '_' .'test';
+    $type_name2 = strtolower($this->randomName(8)) . '_test';
     $type2 = $this->drupalCreateContentType(array('name' => $type_name2, 'type' => $type_name2));
     $type_name2 = $type2->type;
     $hyphen_type2 = str_replace('_', '-', $type_name2);
@@ -411,6 +411,21 @@ class FieldUIManageFieldsTestCase extends FieldUITestCase {
     $this->drupalGet($bundle_path);
     $this->assertFalse($this->xpath('//select[@id="edit-add-existing-field-field-name"]//option[@value=:field_name]', array(':field_name' => $field_name)), t("The 'add existing field' select respects field types 'no_ui' property."));
   }
+
+  /**
+   * Tests renaming a bundle.
+   */
+  function testRenameBundle() {
+    $type2 = strtolower($this->randomName(8)) . '_' .'test';
+    $hyphen_type2 = str_replace('_', '-', $type2);
+
+    $options = array(
+      'type' => $type2,
+    );
+    $this->drupalPost('admin/structure/types/manage/' . $this->hyphen_type, $options, t('Save content type'));
+
+    $this->drupalGet('admin/structure/types/manage/' . $hyphen_type2 . '/fields');
+  }
 }
 
 /**
diff --git a/modules/file/file.field.inc b/modules/file/file.field.inc
index 2af3cb620be789c4a413dff770eface5327f0ca3..35696dda62c08bae63dd0ef6b25d1ec551ec487e 100644
--- a/modules/file/file.field.inc
+++ b/modules/file/file.field.inc
@@ -428,7 +428,7 @@ function file_field_widget_settings_form($field, $instance) {
       'bar' => t('Bar with progress meter'),
     ),
     '#default_value' => $settings['progress_indicator'],
-    '#description' => t('The throbber display does not show the status of uploads but takes up space. The progress bar is helpful for monitoring progress on large uploads.'),
+    '#description' => t('The throbber display does not show the status of uploads but takes up less space. The progress bar is helpful for monitoring progress on large uploads.'),
     '#weight' => 16,
     '#access' => file_progress_implementation(),
   );
@@ -447,37 +447,18 @@ function file_field_widget_form(&$form, &$form_state, $field, $instance, $langco
     'description' => '',
   );
 
-  // Retrieve any values set in $form_state, as will be the case during Ajax
-  // rebuilds of this form.
-  if (isset($form_state['values'])) {
-    $path = array_merge($element['#field_parents'], array($field['field_name'], $langcode));
-    $path_exists = FALSE;
-    $values = drupal_array_get_nested_value($form_state['values'], $path, $path_exists);
-    if ($path_exists) {
-      $items = $values;
-      drupal_array_set_nested_value($form_state['values'], $path, NULL);
-    }
-  }
-
-  foreach ($items as $delta => $item) {
-    $items[$delta] = array_merge($defaults, $items[$delta]);
-    // Remove any items from being displayed that are not needed.
-    if ($items[$delta]['fid'] == 0) {
-      unset($items[$delta]);
-    }
+  // Load the items for form rebuilds from the field state as they might not be
+  // in $form_state['values'] because of validation limitations. Also, they are
+  // only passed in as $items when editing existing entities.
+  $field_state = field_form_get_state($element['#field_parents'], $field['field_name'], $langcode, $form_state);
+  if (isset($field_state['items'])) {
+    $items = $field_state['items'];
   }
 
-  // Re-index deltas after removing empty items.
-  $items = array_values($items);
-
-  // Update order according to weight.
-  $items = _field_sort_items($field, $items);
-
   // Essentially we use the managed_file type, extended with some enhancements.
   $element_info = element_info('managed_file');
   $element += array(
     '#type' => 'managed_file',
-    '#default_value' => isset($items[$delta]) ? $items[$delta] : $defaults,
     '#upload_location' => file_field_widget_uri($field, $instance),
     '#upload_validators' => file_field_widget_upload_validators($field, $instance),
     '#value_callback' => 'file_field_widget_value',
@@ -487,6 +468,8 @@ function file_field_widget_form(&$form, &$form_state, $field, $instance, $langco
   );
 
   if ($field['cardinality'] == 1) {
+    // Set the default value.
+    $element['#default_value'] = !empty($items) ? $items[0] : $defaults;
     // If there's only one field, return it as delta 0.
     if (empty($element['#default_value']['fid'])) {
       $element['#description'] = theme('file_upload_help', array('description' => $element['#description'], 'upload_validators' => $element['#upload_validators']));
@@ -495,15 +478,15 @@ function file_field_widget_form(&$form, &$form_state, $field, $instance, $langco
   }
   else {
     // If there are multiple values, add an element for each existing one.
-    $delta = -1;
-    foreach ($items as $delta => $item) {
+    foreach ($items as $item) {
       $elements[$delta] = $element;
       $elements[$delta]['#default_value'] = $item;
       $elements[$delta]['#weight'] = $delta;
+      $delta++;
     }
-    // And then add one more empty row for new uploads.
-    $delta++;
-    if ($field['cardinality'] == FIELD_CARDINALITY_UNLIMITED || $delta < $field['cardinality']) {
+    // And then add one more empty row for new uploads except when this is a
+    // programmed form as it is not necessary.
+    if (($field['cardinality'] == FIELD_CARDINALITY_UNLIMITED || $delta < $field['cardinality']) && empty($form_state['programmed'])) {
       $elements[$delta] = $element;
       $elements[$delta]['#default_value'] = $defaults;
       $elements[$delta]['#weight'] = $delta;
@@ -757,6 +740,32 @@ function file_field_widget_submit($form, &$form_state) {
   // so nothing is lost in doing this.
   $parents = array_slice($form_state['triggering_element']['#parents'], 0, -2);
   drupal_array_set_nested_value($form_state['input'], $parents, NULL);
+
+  $button = $form_state['triggering_element'];
+
+  // Go one level up in the form, to the widgets container.
+  $element = drupal_array_get_nested_value($form, array_slice($button['#array_parents'], 0, -1));
+  $field_name = $element['#field_name'];
+  $langcode = $element['#language'];
+  $parents = $element['#field_parents'];
+
+  $submitted_values = drupal_array_get_nested_value($form_state['values'], array_slice($button['#array_parents'], 0, -2));
+  foreach ($submitted_values as $delta => $submitted_value) {
+    if (!$submitted_value['fid']) {
+      unset($submitted_values[$delta]);
+    }
+  }
+
+  // Re-index deltas after removing empty items.
+  $submitted_values = array_values($submitted_values);
+
+  // Update form_state values.
+  drupal_array_set_nested_value($form_state['values'], array_slice($button['#array_parents'], 0, -2), $submitted_values);
+
+  // Update items.
+  $field_state = field_form_get_state($parents, $field_name, $langcode, $form_state);
+  $field_state['items'] = $submitted_values;
+  field_form_set_state($parents, $field_name, $langcode, $form_state, $field_state);
 }
 
 /**
diff --git a/modules/file/file.info b/modules/file/file.info
index bbfe41cd43c2e0a947f12d62eb21ccdd68c72fb9..844563ba3c73bcb41d075438910544214baab6ae 100644
--- a/modules/file/file.info
+++ b/modules/file/file.info
@@ -6,8 +6,8 @@ core = 7.x
 dependencies[] = field
 files[] = tests/file.test
 
-; Information added by drupal.org packaging script on 2011-08-31
-version = "7.8"
+; Information added by drupal.org packaging script on 2011-10-26
+version = "7.9"
 project = "drupal"
-datestamp = "1314817616"
+datestamp = "1319660730"
 
diff --git a/modules/file/file.module b/modules/file/file.module
index 83de0f622aeeade27aec8837420f2d769cf480aa..5d7b17af555a971018e8081c60ae36828fedb6da 100644
--- a/modules/file/file.module
+++ b/modules/file/file.module
@@ -142,10 +142,13 @@ function file_file_download($uri, $field_type = 'file') {
   // Find out which (if any) fields of this type contain the file.
   $references = file_get_file_references($file, NULL, FIELD_LOAD_CURRENT, $field_type);
 
-  // If there are no references, stop processing, to avoid returning headers
-  // for files controlled by other modules.
-  if (empty($references)) {
-    return;
+  // Stop processing if there are no references in order to avoid returning
+  // headers for files controlled by other modules. Make an exception for
+  // temporary files where the host entity has not yet been saved (for example,
+  // an image preview on a node/add form) in which case, allow download by the
+  // file's owner.
+  if (empty($references) && ($file->status == FILE_STATUS_PERMANENT || $file->uid != $user->uid)) {
+      return;
   }
 
   // Default to allow access.
@@ -643,9 +646,18 @@ function file_managed_file_save_upload($element) {
 function theme_file_managed_file($variables) {
   $element = $variables['element'];
 
+  $attributes = array();
+  if (isset($element['#id'])) {
+    $attributes['id'] = $element['#id'];
+  }
+  if (!empty($element['#attributes']['class'])) {
+    $attributes['class'] = (array) $element['#attributes']['class'];
+  }
+  $attributes['class'][] = 'form-managed-file';
+
   // This wrapper is required to apply JS behaviors and CSS styling.
   $output = '';
-  $output .= '<div class="form-managed-file">';
+  $output .= '<div' . drupal_attributes($attributes) . '>';
   $output .= drupal_render_children($element);
   $output .= '</div>';
   return $output;
diff --git a/modules/file/tests/file.test b/modules/file/tests/file.test
index ef250eff9fb25df1a251a6696793e0b8212f5f03..59f6e0cb0bc841fe7297aa673da58cea354e3de5 100644
--- a/modules/file/tests/file.test
+++ b/modules/file/tests/file.test
@@ -380,7 +380,7 @@ class FileFieldWidgetTestCase extends FileFieldTestCase {
   }
 
   /**
-   * Tests upload and remove buttons, with and without Ajax, for a multi-valued File field.
+   * Tests upload and remove buttons, with and without Ajax, for multiple multi-valued File field.
    */
   function testMultiValuedWidget() {
     // Use 'page' instead of 'article', so that the 'article' image field does
@@ -389,77 +389,106 @@ class FileFieldWidgetTestCase extends FileFieldTestCase {
     // using a custom node type.
     $type_name = 'page';
     $field_name = strtolower($this->randomName());
+    $field_name2 = strtolower($this->randomName());
     $this->createFileField($field_name, $type_name, array('cardinality' => 3));
+    $this->createFileField($field_name2, $type_name, array('cardinality' => 3));
+
     $field = field_info_field($field_name);
     $instance = field_info_instance('node', $field_name, $type_name);
 
+    $field2 = field_info_field($field_name2);
+    $instance2 = field_info_instance('node', $field_name2, $type_name);
+
     $test_file = $this->getTestFile('text');
 
     foreach (array('nojs', 'js') as $type) {
-      // Visit the node creation form, and upload 3 files. Since the field has
-      // cardinality of 3, ensure the "Upload" button is displayed until after
-      // the 3rd file, and after that, isn't displayed.
+      // Visit the node creation form, and upload 3 files for each field. Since
+      // the field has cardinality of 3, ensure the "Upload" button is displayed
+      // until after the 3rd file, and after that, isn't displayed. Because
+      // SimpleTest triggers the last button with a given name, so upload to the
+      // second field first.
       // @todo This is only testing a non-Ajax upload, because drupalPostAJAX()
       //   does not yet emulate jQuery's file upload.
+      //
       $this->drupalGet("node/add/$type_name");
-      for ($delta = 0; $delta < 3; $delta++) {
-        $edit = array('files[' . $field_name . '_' . LANGUAGE_NONE . '_' . $delta . ']' => drupal_realpath($test_file->uri));
-        // If the Upload button doesn't exist, drupalPost() will automatically
-        // fail with an assertion message.
-        $this->drupalPost(NULL, $edit, t('Upload'));
-      }
-      $this->assertNoFieldByXpath('//input[@type="submit"]', t('Upload'), t('After uploading 3 files, the "Upload" button is no longer displayed.'));
-
-      // Test clicking each "Remove" button. For extra robustness, test them out
-      // of sequential order. They are 0-indexed, and get renumbered after each
-      // iteration, so array(1, 1, 0) means:
-      // - First remove the 2nd file.
-      // - Then remove what is then the 2nd file (was originally the 3rd file).
-      // - Then remove the first file.
-      $num_expected_remove_buttons = 3;
-      foreach (array(1, 1, 0) as $delta) {
-        // Ensure we have the expected number of Remove buttons, and that they
-        // are numbered sequentially.
-        $buttons = $this->xpath('//input[@type="submit" and @value="Remove"]');
-        $this->assertTrue(is_array($buttons) && count($buttons) === $num_expected_remove_buttons, t('There are %n "Remove" buttons displayed (JSMode=%type).', array('%n' => $num_expected_remove_buttons, '%type' => $type)));
-        foreach ($buttons as $i => $button) {
-          $this->assertIdentical((string) $button['name'], $field_name . '_' . LANGUAGE_NONE . '_' . $i . '_remove_button');
+      foreach (array($field_name2, $field_name) as $each_field_name) {
+        for ($delta = 0; $delta < 3; $delta++) {
+          $edit = array('files[' . $each_field_name . '_' . LANGUAGE_NONE . '_' . $delta . ']' => drupal_realpath($test_file->uri));
+          // If the Upload button doesn't exist, drupalPost() will automatically
+          // fail with an assertion message.
+          $this->drupalPost(NULL, $edit, t('Upload'));
         }
+      }
+      $this->assertNoFieldByXpath('//input[@type="submit"]', t('Upload'), t('After uploading 3 files for each field, the "Upload" button is no longer displayed.'));
+
+      $num_expected_remove_buttons = 6;
+
+      foreach (array($field_name, $field_name2) as $current_field_name) {
+        // How many uploaded files for the current field are remaining.
+        $remaining = 3;
+        // Test clicking each "Remove" button. For extra robustness, test them out
+        // of sequential order. They are 0-indexed, and get renumbered after each
+        // iteration, so array(1, 1, 0) means:
+        // - First remove the 2nd file.
+        // - Then remove what is then the 2nd file (was originally the 3rd file).
+        // - Then remove the first file.
+        foreach (array(1,1,0) as $delta) {
+          // Ensure we have the expected number of Remove buttons, and that they
+          // are numbered sequentially.
+          $buttons = $this->xpath('//input[@type="submit" and @value="Remove"]');
+          $this->assertTrue(is_array($buttons) && count($buttons) === $num_expected_remove_buttons, t('There are %n "Remove" buttons displayed (JSMode=%type).', array('%n' => $num_expected_remove_buttons, '%type' => $type)));
+          foreach ($buttons as $i => $button) {
+            $key = $i >= $remaining ? $i - $remaining : $i;
+            $check_field_name = $field_name2;
+            if ($current_field_name == $field_name && $i < $remaining) {
+              $check_field_name = $field_name;
+            }
 
-        // "Click" the remove button (emulating either a nojs or js submission).
-        $button_name = $field_name . '_' . LANGUAGE_NONE . '_' . $delta . '_remove_button';
-        switch ($type) {
-          case 'nojs':
-            // drupalPost() takes a $submit parameter that is the value of the
-            // button whose click we want to emulate. Since we have multiple
-            // buttons with the value "Remove", and want to control which one we
-            // use, we change the value of the other ones to something else.
-            // Since non-clicked buttons aren't included in the submitted POST
-            // data, and since drupalPost() will result in $this being updated
-            // with a newly rebuilt form, this doesn't cause problems.
-            foreach ($buttons as $button) {
-              if ($button['name'] != $button_name) {
-                $button['value'] = 'DUMMY';
+            $this->assertIdentical((string) $button['name'], $check_field_name . '_' . LANGUAGE_NONE . '_' . $key. '_remove_button');
+          }
+
+          // "Click" the remove button (emulating either a nojs or js submission).
+          $button_name = $current_field_name . '_' . LANGUAGE_NONE . '_' . $delta . '_remove_button';
+          switch ($type) {
+            case 'nojs':
+              // drupalPost() takes a $submit parameter that is the value of the
+              // button whose click we want to emulate. Since we have multiple
+              // buttons with the value "Remove", and want to control which one we
+              // use, we change the value of the other ones to something else.
+              // Since non-clicked buttons aren't included in the submitted POST
+              // data, and since drupalPost() will result in $this being updated
+              // with a newly rebuilt form, this doesn't cause problems.
+              foreach ($buttons as $button) {
+                if ($button['name'] != $button_name) {
+                  $button['value'] = 'DUMMY';
+                }
               }
-            }
-            $this->drupalPost(NULL, array(), t('Remove'));
-            break;
-          case 'js':
-            // drupalPostAJAX() lets us target the button precisely, so we don't
-            // require the workaround used above for nojs.
-            $this->drupalPostAJAX(NULL, array(), array($button_name => t('Remove')));
-            break;
+              $this->drupalPost(NULL, array(), t('Remove'));
+              break;
+            case 'js':
+              // drupalPostAJAX() lets us target the button precisely, so we don't
+              // require the workaround used above for nojs.
+              $this->drupalPostAJAX(NULL, array(), array($button_name => t('Remove')));
+              break;
+          }
+          $num_expected_remove_buttons--;
+          $remaining--;
+
+          // Ensure an "Upload" button for the current field is displayed with the
+          // correct name.
+          $upload_button_name = $current_field_name . '_' . LANGUAGE_NONE . '_' . $remaining . '_upload_button';
+          $buttons = $this->xpath('//input[@type="submit" and @value="Upload" and @name=:name]', array(':name' => $upload_button_name));
+          $this->assertTrue(is_array($buttons) && count($buttons) == 1, t('The upload button is displayed with the correct name (JSMode=%type).', array('%type' => $type)));
+
+          // Ensure only at most one button per field is displayed.
+          $buttons = $this->xpath('//input[@type="submit" and @value="Upload"]');
+          $expected = $current_field_name == $field_name ? 1 : 2;
+          $this->assertTrue(is_array($buttons) && count($buttons) == $expected, t('After removing a file, only one "Upload" button for each possible field is displayed (JSMode=%type).', array('%type' => $type)));
         }
-        $num_expected_remove_buttons--;
-
-        // Ensure we have a single Upload button, and that it is numbered
-        // sequentially after the Remove buttons.
-        $buttons = $this->xpath('//input[@type="submit" and @value="Upload"]');
-        $this->assertTrue(is_array($buttons) && count($buttons) == 1 && ((string) $buttons[0]['name'] === ($field_name . '_' . LANGUAGE_NONE . '_' . $num_expected_remove_buttons . '_upload_button')), t('After removing a file, an "Upload" button is displayed (JSMode=%type).'));
       }
 
       // Ensure the page now has no Remove buttons.
-      $this->assertNoFieldByXPath('//input[@type="submit"]', t('Remove'), t('After removing all files, there is no "Remove" button displayed.', array('%n' => $num_expected_remove_buttons, '%type' => $type)));
+      $this->assertNoFieldByXPath('//input[@type="submit"]', t('Remove'), t('After removing all files, there is no "Remove" button displayed (JSMode=%type).', array('%type' => $type)));
 
       // Save the node and ensure it does not have any files.
       $this->drupalPost(NULL, array('title' => $this->randomName()), t('Save'));
diff --git a/modules/file/tests/file_module_test.info b/modules/file/tests/file_module_test.info
index f23164393c7018d9cf8480907ce115ca7bfd1375..9af127a5712bee4bda6c96fe8a166dbc1037efcb 100644
--- a/modules/file/tests/file_module_test.info
+++ b/modules/file/tests/file_module_test.info
@@ -5,8 +5,8 @@ version = VERSION
 core = 7.x
 hidden = TRUE
 
-; Information added by drupal.org packaging script on 2011-08-31
-version = "7.8"
+; Information added by drupal.org packaging script on 2011-10-26
+version = "7.9"
 project = "drupal"
-datestamp = "1314817616"
+datestamp = "1319660730"
 
diff --git a/modules/filter/filter.info b/modules/filter/filter.info
index aa47cb5de8970d42b735c54d7d5e2628a034721b..216bc59d888ce982cf4a34a1c08b85b64e21b3c2 100644
--- a/modules/filter/filter.info
+++ b/modules/filter/filter.info
@@ -7,8 +7,8 @@ files[] = filter.test
 required = TRUE
 configure = admin/config/content/formats
 
-; Information added by drupal.org packaging script on 2011-08-31
-version = "7.8"
+; Information added by drupal.org packaging script on 2011-10-26
+version = "7.9"
 project = "drupal"
-datestamp = "1314817616"
+datestamp = "1319660730"
 
diff --git a/modules/filter/filter.module b/modules/filter/filter.module
index 9e1481207cdcdee02bd04fb43df9accb1712085e..71dc21ac513b31517a21b2c31a71088193292319 100644
--- a/modules/filter/filter.module
+++ b/modules/filter/filter.module
@@ -1090,7 +1090,7 @@ function filter_dom_serialize($dom_document) {
  * throw exceptions.
  *
  * This function attempts to solve the problem by creating a DocumentFragment
- * and immitating the behavior in drupal_get_js(), commenting the CDATA tag.
+ * and imitating the behavior in drupal_get_js(), commenting the CDATA tag.
  *
  * @param $dom_document
  *   The DOMDocument containing the $dom_element.
diff --git a/modules/forum/forum.admin.inc b/modules/forum/forum.admin.inc
index 1e6b3655159180758950a4401a2a3f3a8bd07703..49c71d90a0bf6c572ffec2b2399f9c8cb592c311 100644
--- a/modules/forum/forum.admin.inc
+++ b/modules/forum/forum.admin.inc
@@ -55,7 +55,7 @@ function forum_form_forum($form, &$form_state, $edit = array()) {
 
   $form['vid'] = array('#type' => 'hidden', '#value' => variable_get('forum_nav_vocabulary', ''));
   $form['actions'] = array('#type' => 'actions');
-  $form['actions']['submit' ] = array('#type' => 'submit', '#value' => t('Save'));
+  $form['actions']['submit'] = array('#type' => 'submit', '#value' => t('Save'));
   if ($edit['tid']) {
     $form['actions']['delete'] = array('#type' => 'submit', '#value' => t('Delete'));
     $form['tid'] = array('#type' => 'hidden', '#value' => $edit['tid']);
diff --git a/modules/forum/forum.info b/modules/forum/forum.info
index f0049e39e7c6189c112efdd38124c9184ff52f42..d61b9a83d4ad583aca9a6a9e322f330605bf2521 100644
--- a/modules/forum/forum.info
+++ b/modules/forum/forum.info
@@ -9,8 +9,8 @@ files[] = forum.test
 configure = admin/structure/forum
 stylesheets[all][] = forum.css
 
-; Information added by drupal.org packaging script on 2011-08-31
-version = "7.8"
+; Information added by drupal.org packaging script on 2011-10-26
+version = "7.9"
 project = "drupal"
-datestamp = "1314817616"
+datestamp = "1319660730"
 
diff --git a/modules/forum/forum.install b/modules/forum/forum.install
index 1bed2e34ce1b973279beb0dc295a59e631035918..589e3a1cd55244465161778b1c1d0ecef3761775 100644
--- a/modules/forum/forum.install
+++ b/modules/forum/forum.install
@@ -238,6 +238,21 @@ function forum_schema() {
   return $schema;
 }
 
+/**
+ * Implements hook_update_dependencies().
+ */
+function forum_update_dependencies() {
+  $dependencies['forum'][7003] = array(
+    // Forum update 7003 uses field API update functions, so must run after
+    // Field API has been enabled.
+    'system' => 7020,
+    // Forum update 7003 relies on updated taxonomy module schema. Ensure it
+    // runs after all taxonomy updates.
+    'taxonomy' => 7010,
+  );
+  return $dependencies;
+}
+
 /**
  * Add new index to forum table.
  */
diff --git a/modules/forum/forum.module b/modules/forum/forum.module
index 5bb43925bc55a9f10bb2f989053f9cb00d4b63fd..65c54894186de0b6eccef22dd4188cbdb8415ea9 100644
--- a/modules/forum/forum.module
+++ b/modules/forum/forum.module
@@ -215,7 +215,7 @@ function forum_menu_local_tasks_alter(&$data, $router_item, $root_path) {
  * Implements hook_entity_info_alter().
  */
 function forum_entity_info_alter(&$info) {
-  // Take over URI constuction for taxonomy terms that are forums.
+  // Take over URI construction for taxonomy terms that are forums.
   if ($vid = variable_get('forum_nav_vocabulary', 0)) {
     // Within hook_entity_info(), we can't invoke entity_load() as that would
     // cause infinite recursion, so we call taxonomy_vocabulary_get_names()
@@ -582,7 +582,7 @@ function forum_field_storage_pre_update($entity_type, $entity, &$skip_fields) {
  */
 function forum_form_alter(&$form, $form_state, $form_id) {
   $vid = variable_get('forum_nav_vocabulary', 0);
-  if (isset($form['vid']) && $form['vid']['#value'] == $vid) {
+  if (isset($form['vid']['#value']) && $form['vid']['#value'] == $vid) {
     // Hide critical options from forum vocabulary.
     if ($form_id == 'taxonomy_form_vocabulary') {
       $form['help_forum_vocab'] = array(
@@ -1127,7 +1127,6 @@ function template_preprocess_forum_topic_list(&$variables) {
         $variables['topics'][$id]->title = l($topic->title, "node/$topic->nid");
         $variables['topics'][$id]->message = '';
       }
-      $topic->uid = $topic->last_comment_uid ? $topic->last_comment_uid : $topic->uid;
       $variables['topics'][$id]->created = theme('forum_submitted', array('topic' => $topic));
       $variables['topics'][$id]->last_reply = theme('forum_submitted', array('topic' => isset($topic->last_reply) ? $topic->last_reply : NULL));
 
diff --git a/modules/help/help.info b/modules/help/help.info
index 9b61bc5fcef17aa337294ef8f2b657c947be90fd..d8d339816293d21af946b34d149705ece1f299cf 100644
--- a/modules/help/help.info
+++ b/modules/help/help.info
@@ -5,8 +5,8 @@ version = VERSION
 core = 7.x
 files[] = help.test
 
-; Information added by drupal.org packaging script on 2011-08-31
-version = "7.8"
+; Information added by drupal.org packaging script on 2011-10-26
+version = "7.9"
 project = "drupal"
-datestamp = "1314817616"
+datestamp = "1319660730"
 
diff --git a/modules/image/image.api.php b/modules/image/image.api.php
index acb3f9c1983f63b28c7b30b0c3106c1fbe1b9fc2..1cb2b0da7a7e38cd9658c27105b42cd4c03f6f74 100644
--- a/modules/image/image.api.php
+++ b/modules/image/image.api.php
@@ -22,6 +22,10 @@
  *   following items:
  *   - "label": The human-readable name of the effect.
  *   - "effect callback": The function to call to perform this image effect.
+ *   - "dimensions passthrough": (optional) Set this item if the effect doesn't
+ *     change the dimensions of the image.
+ *   - "dimensions callback": (optional) The function to call to transform
+ *     dimensions for this effect.
  *   - "help": (optional) A brief description of the effect that will be shown
  *     when adding or configuring this image effect.
  *   - "form callback": (optional) The name of a function that will return a
@@ -37,7 +41,8 @@ function hook_image_effect_info() {
   $effects['mymodule_resize'] = array(
     'label' => t('Resize'),
     'help' => t('Resize an image to an exact set of dimensions, ignoring aspect ratio.'),
-    'effect callback' => 'mymodule_resize_image',
+    'effect callback' => 'mymodule_resize_effect',
+    'dimensions callback' => 'mymodule_resize_dimensions',
     'form callback' => 'mymodule_resize_form',
     'summary theme' => 'mymodule_resize_summary',
   );
@@ -56,6 +61,7 @@ function hook_image_effect_info() {
 function hook_image_effect_info_alter(&$effects) {
   // Override the Image module's crop effect with more options.
   $effects['image_crop']['effect callback'] = 'mymodule_crop_effect';
+  $effects['image_crop']['dimensions callback'] = 'mymodule_crop_dimensions';
   $effects['image_crop']['form callback'] = 'mymodule_crop_form';
 }
 
diff --git a/modules/image/image.effects.inc b/modules/image/image.effects.inc
index 122af6c44f15eebfaa600fda46fdb7fe9e80b926..ea898f91f0fcbf6508519522718bd6d2124486df 100644
--- a/modules/image/image.effects.inc
+++ b/modules/image/image.effects.inc
@@ -14,6 +14,7 @@ function image_image_effect_info() {
       'label' => t('Resize'),
       'help' => t('Resizing will make images an exact set of dimensions. This may cause images to be stretched or shrunk disproportionately.'),
       'effect callback' => 'image_resize_effect',
+      'dimensions callback' => 'image_resize_dimensions',
       'form callback' => 'image_resize_form',
       'summary theme' => 'image_resize_summary',
     ),
@@ -21,6 +22,7 @@ function image_image_effect_info() {
       'label' => t('Scale'),
       'help' => t('Scaling will maintain the aspect-ratio of the original image. If only a single dimension is specified, the other dimension will be calculated.'),
       'effect callback' => 'image_scale_effect',
+      'dimensions callback' => 'image_scale_dimensions',
       'form callback' => 'image_scale_form',
       'summary theme' => 'image_scale_summary',
     ),
@@ -28,6 +30,7 @@ function image_image_effect_info() {
       'label' => t('Scale and crop'),
       'help' => t('Scale and crop will maintain the aspect-ratio of the original image, then crop the larger dimension. This is most useful for creating perfectly square thumbnails without stretching the image.'),
       'effect callback' => 'image_scale_and_crop_effect',
+      'dimensions callback' => 'image_resize_dimensions',
       'form callback' => 'image_resize_form',
       'summary theme' => 'image_resize_summary',
     ),
@@ -35,6 +38,7 @@ function image_image_effect_info() {
       'label' => t('Crop'),
       'help' => t('Cropping will remove portions of an image to make it the specified dimensions.'),
       'effect callback' => 'image_crop_effect',
+      'dimensions callback' => 'image_resize_dimensions',
       'form callback' => 'image_crop_form',
       'summary theme' => 'image_crop_summary',
     ),
@@ -42,11 +46,13 @@ function image_image_effect_info() {
       'label' => t('Desaturate'),
       'help' => t('Desaturate converts an image to grayscale.'),
       'effect callback' => 'image_desaturate_effect',
+      'dimensions passthrough' => TRUE,
     ),
     'image_rotate' => array(
       'label' => t('Rotate'),
       'help' => t('Rotating an image may cause the dimensions of an image to increase to fit the diagonal.'),
       'effect callback' => 'image_rotate_effect',
+      'dimensions callback' => 'image_rotate_dimensions',
       'form callback' => 'image_rotate_form',
       'summary theme' => 'image_rotate_summary',
     ),
@@ -79,6 +85,24 @@ function image_resize_effect(&$image, $data) {
   return TRUE;
 }
 
+/**
+ * Image dimensions callback; Resize.
+ *
+ * @param $dimensions
+ *   Dimensions to be modified - an array with components width and height, in
+ *   pixels.
+ * @param $data
+ *   An array of attributes to use when performing the resize effect with the
+ *   following items:
+ *   - "width": An integer representing the desired width in pixels.
+ *   - "height": An integer representing the desired height in pixels.
+ */
+function image_resize_dimensions(array &$dimensions, array $data) {
+  // The new image will have the exact dimensions defined for the effect.
+  $dimensions['width'] = $data['width'];
+  $dimensions['height'] = $data['height'];
+}
+
 /**
  * Image effect callback; Scale an image resource.
  *
@@ -89,8 +113,8 @@ function image_resize_effect(&$image, $data) {
  *   following items:
  *   - "width": An integer representing the desired width in pixels.
  *   - "height": An integer representing the desired height in pixels.
- *   - "upscale": A Boolean indicating that the image should be upscalled if
- *     the dimensions are larger than the original image.
+ *   - "upscale": A boolean indicating that the image should be upscaled if the
+ *     dimensions are larger than the original image.
  *
  * @return
  *   TRUE on success. FALSE on failure to scale image.
@@ -114,6 +138,26 @@ function image_scale_effect(&$image, $data) {
   return TRUE;
 }
 
+/**
+ * Image dimensions callback; Scale.
+ *
+ * @param $dimensions
+ *   Dimensions to be modified - an array with components width and height, in
+ *   pixels.
+ * @param $data
+ *   An array of attributes to use when performing the scale effect with the
+ *   following items:
+ *   - "width": An integer representing the desired width in pixels.
+ *   - "height": An integer representing the desired height in pixels.
+ *   - "upscale": A boolean indicating that the image should be upscaled if the
+ *     dimensions are larger than the original image.
+ */
+function image_scale_dimensions(array &$dimensions, array $data) {
+  if ($dimensions['width'] && $dimensions['height']) {
+    image_dimensions_scale($dimensions, $data['width'], $data['height'], $data['upscale']);
+  }
+}
+
 /**
  * Image effect callback; Crop an image resource.
  *
@@ -198,7 +242,7 @@ function image_desaturate_effect(&$image, $data) {
  *   An array of attributes to use when performing the rotate effect containing
  *   the following items:
  *   - "degrees": The number of (clockwise) degrees to rotate the image.
- *   - "random": A Boolean indicating that a random rotation angle should be
+ *   - "random": A boolean indicating that a random rotation angle should be
  *     used for this image. The angle specified in "degrees" is used as a
  *     positive and negative maximum.
  *   - "bgcolor": The background color to use for exposed areas of the image.
@@ -241,3 +285,32 @@ function image_rotate_effect(&$image, $data) {
   }
   return TRUE;
 }
+
+/**
+ * Image dimensions callback; Rotate.
+ *
+ * @param $dimensions
+ *   Dimensions to be modified - an array with components width and height, in
+ *   pixels.
+ * @param $data
+ *   An array of attributes to use when performing the rotate effect containing
+ *   the following items:
+ *   - "degrees": The number of (clockwise) degrees to rotate the image.
+ *   - "random": A boolean indicating that a random rotation angle should be
+ *     used for this image. The angle specified in "degrees" is used as a
+ *     positive and negative maximum.
+ */
+function image_rotate_dimensions(array &$dimensions, array $data) {
+  // If the rotate is not random and the angle is a multiple of 90 degrees,
+  // then the new dimensions can be determined.
+  if (!$data['random'] && ((int) ($data['degrees']) == $data['degrees']) && ($data['degrees'] % 90 == 0)) {
+    if ($data['degrees'] % 180 != 0) {
+      $temp = $dimensions['width'];
+      $dimensions['width'] = $dimensions['height'];
+      $dimensions['height'] = $temp;
+    }
+  }
+  else {
+    $dimensions['width'] = $dimensions['height'] = NULL;
+  }
+}
diff --git a/modules/image/image.field.inc b/modules/image/image.field.inc
index e3f81e3afd790b04d069b6aee6da725a33782002..d08fd5c9798288c1a391fb2b486f1bd48aacef99 100644
--- a/modules/image/image.field.inc
+++ b/modules/image/image.field.inc
@@ -208,6 +208,18 @@ function image_field_prepare_view($entity_type, $entities, $field, $instances, $
  */
 function image_field_presave($entity_type, $entity, $field, $instance, $langcode, &$items) {
   file_field_presave($entity_type, $entity, $field, $instance, $langcode, $items);
+
+  // Determine the dimensions if necessary.
+  foreach ($items as &$item) {
+    if (!isset($item['width']) || !isset($item['height'])) {
+      $info = image_get_info(file_load($item['fid'])->uri);
+
+      if (is_array($info)) {
+        $item['width'] = $info['width'];
+        $item['height'] = $info['height'];
+      }
+    }
+  }
 }
 
 /**
@@ -346,9 +358,42 @@ function image_field_widget_process($element, &$form_state, $form) {
 
   // Add the image preview.
   if ($element['#file'] && $widget_settings['preview_image_style']) {
+    $variables = array(
+      'style_name' => $widget_settings['preview_image_style'],
+      'path' => $element['#file']->uri,
+    );
+
+    // Determine image dimensions.
+    if (isset($element['#value']['width']) && isset($element['#value']['height'])) {
+      $variables['width'] = $element['#value']['width'];
+      $variables['height'] = $element['#value']['height'];
+    }
+    else {
+      $info = image_get_info($element['#file']->uri);
+
+      if (is_array($info)) {
+        $variables['width'] = $info['width'];
+        $variables['height'] = $info['height'];
+      }
+      else {
+        $variables['width'] = $variables['height'] = NULL;
+      }
+    }
+
     $element['preview'] = array(
       '#type' => 'markup',
-      '#markup' => theme('image_style', array('style_name' => $widget_settings['preview_image_style'], 'path' => $element['#file']->uri)),
+      '#markup' => theme('image_style', $variables),
+    );
+
+    // Store the dimensions in the form so the file doesn't have to be accessed
+    // again. This is important for remote files.
+    $element['width'] = array(
+      '#type' => 'hidden',
+      '#value' => $variables['width'],
+    );
+    $element['height'] = array(
+      '#type' => 'hidden',
+      '#value' => $variables['height'],
     );
   }
 
@@ -534,6 +579,12 @@ function theme_image_formatter($variables) {
     'path' => $item['uri'],
     'alt' => $item['alt'],
   );
+
+  if (isset($item['width']) && isset($item['height'])) {
+    $image['width'] = $item['width'];
+    $image['height'] = $item['height'];
+  }
+
   // Do not output an empty 'title' attribute.
   if (drupal_strlen($item['title']) > 0) {
     $image['title'] = $item['title'];
diff --git a/modules/image/image.info b/modules/image/image.info
index 421ec641c32ac3551916ffe243af8c04e4f47ace..205cf8b7d076e786331daf9763f988d489c2894c 100644
--- a/modules/image/image.info
+++ b/modules/image/image.info
@@ -7,8 +7,8 @@ dependencies[] = file
 files[] = image.test
 configure = admin/config/media/image-styles
 
-; Information added by drupal.org packaging script on 2011-08-31
-version = "7.8"
+; Information added by drupal.org packaging script on 2011-10-26
+version = "7.9"
 project = "drupal"
-datestamp = "1314817616"
+datestamp = "1319660730"
 
diff --git a/modules/image/image.install b/modules/image/image.install
index 5f096cc2ffd4c11a70ce491c796b74734a38b668..fc326b4e62c40be933923087ca26cee3220eb6d4 100644
--- a/modules/image/image.install
+++ b/modules/image/image.install
@@ -130,6 +130,16 @@ function image_field_schema($field) {
         'length' => 128,
         'not null' => FALSE,
       ),
+      'width' => array(
+        'description' => 'The width of the image in pixels.',
+        'type' => 'int',
+        'unsigned' => TRUE,
+      ),
+      'height' => array(
+        'description' => 'The height of the image in pixels.',
+        'type' => 'int',
+        'unsigned' => TRUE,
+      ),
     ),
     'indexes' => array(
       'fid' => array('fid'),
@@ -243,6 +253,138 @@ function image_update_7001() {
   }
 }
 
+/**
+ * Add width and height columns to a specific table.
+ *
+ * @param $table
+ *   The name of the database table to be updated.
+ * @param $columns
+ *   Keyed array of columns this table is supposed to have.
+ */
+function _image_update_7002_add_columns($table, $field_name) {
+  $spec = array(
+    'type' => 'int',
+    'unsigned' => TRUE,
+  );
+
+  $spec['description'] = 'The width of the image in pixels.';
+  db_add_field($table, $field_name . '_width', $spec);
+
+  $spec['description'] = 'The height of the image in pixels.';
+  db_add_field($table, $field_name . '_height', $spec);
+}
+
+/**
+ * Populate image dimensions in a specific table.
+ *
+ * @param $table
+ *   The name of the database table to be updated.
+ * @param $columns
+ *   Keyed array of columns this table is supposed to have.
+ * @param $last_fid
+ *   The fid of the last image to have been processed.
+ *
+ * @return
+ *   The number of images that were processed.
+ */
+function _image_update_7002_populate_dimensions($table, $field_name, &$last_fid) {
+  // Define how many images to process per pass.
+  $images_per_pass = 100;
+
+  // Query the database for fid / URI pairs.
+  $query = db_select($table, NULL, array('fetch' => PDO::FETCH_ASSOC));
+  $query->join('file_managed', NULL, $table . '.' . $field_name . '_fid = file_managed.fid');
+
+  if ($last_fid) {
+    $query->condition('file_managed.fid', $last_fid, '>');
+  }
+
+  $result = $query->fields('file_managed', array('fid', 'uri'))
+    ->orderBy('file_managed.fid')
+    ->range(0, $images_per_pass)
+    ->execute();
+
+  $count = 0;
+  foreach ($result as $file) {
+    $count++;
+    $info = image_get_info($file['uri']);
+
+    if (is_array($info)) {
+      db_update($table)
+        ->fields(array(
+          $field_name . '_width' => $info['width'],
+          $field_name . '_height' => $info['height'],
+        ))
+        ->condition($field_name . '_fid', $file['fid'])
+        ->execute();
+    }
+  }
+
+  // If less than the requested number of rows were returned then this table
+  // has been fully processed.
+  $last_fid = ($count < $images_per_pass) ? NULL : $file['fid'];
+  return $count;
+}
+
+/**
+ * Add width and height columns to image field schema and populate.
+ */
+function image_update_7002(array &$sandbox) {
+  if (empty($sandbox)) {
+    // Setup the sandbox.
+    $sandbox = array(
+      'tables' => array(),
+      'total' => 0,
+      'processed' => 0,
+      'last_fid' => NULL,
+    );
+
+    $fields = _update_7000_field_read_fields(array(
+      'module' => 'image',
+      'storage_type' => 'field_sql_storage',
+      'deleted' => 0,
+    ));
+
+    foreach ($fields as $field) {
+      $tables = array(
+        _field_sql_storage_tablename($field),
+        _field_sql_storage_revision_tablename($field),
+      );
+      foreach ($tables as $table) {
+        // Add the width and height columns to the table.
+        _image_update_7002_add_columns($table, $field['field_name']);
+
+        // How many rows need dimensions populated?
+        $count = db_select($table)->countQuery()->execute()->fetchField();
+
+        if (!$count) {
+          continue;
+        }
+
+        $sandbox['total'] += $count;
+        $sandbox['tables'][$table] = $field['field_name'];
+      }
+    }
+
+    // If no tables need rows populated with dimensions then we are done.
+    if (empty($sandbox['tables'])) {
+      $sandbox = array();
+      return;
+    }
+  }
+
+  // Process the table at the top of the list.
+  $table = reset(array_keys($sandbox['tables']));
+  $sandbox['processed'] += _image_update_7002_populate_dimensions($table, $sandbox['tables'][$table], $sandbox['last_fid']);
+
+  // Has the table been fully processed?
+  if (!$sandbox['last_fid']) {
+    unset($sandbox['tables'][$table]);
+  }
+
+  $sandbox['#finished'] = count($sandbox['tables']) ? ($sandbox['processed'] / $sandbox['total']) : 1;
+}
+
 /**
  * Implements hook_requirements() to check the PHP GD Library.
  *
diff --git a/modules/image/image.module b/modules/image/image.module
index 008a36513a943e5538aaffc93fac60c6bf2cb52f..066bd34d8fd0ff2f239855ade6c3fb8b87498838 100644
--- a/modules/image/image.module
+++ b/modules/image/image.module
@@ -185,6 +185,8 @@ function image_theme() {
       'variables' => array(
         'style_name' => NULL,
         'path' => NULL,
+        'width' => NULL,
+        'height' => NULL,
         'alt' => '',
         'title' => NULL,
         'attributes' => array(),
@@ -811,6 +813,39 @@ function image_style_create_derivative($style, $source, $destination) {
   return TRUE;
 }
 
+/**
+ * Determines the dimensions of the styled image.
+ *
+ * Applies all of an image style's effects to $dimensions.
+ *
+ * @param $style_name
+ *   The name of the style to be applied.
+ * @param $dimensions
+ *   Dimensions to be modified - an array with components width and height, in
+ *   pixels.
+ */
+function image_style_transform_dimensions($style_name, array &$dimensions) {
+  module_load_include('inc', 'image', 'image.effects');
+  $style = image_style_load($style_name);
+
+  if (!is_array($style)) {
+    return;
+  }
+
+  foreach ($style['effects'] as $effect) {
+    if (isset($effect['dimensions passthrough'])) {
+      continue;
+    }
+
+    if (isset($effect['dimensions callback'])) {
+      $effect['dimensions callback']($dimensions, $effect['data']);
+    }
+    else {
+      $dimensions['width'] = $dimensions['height'] = NULL;
+    }
+  }
+}
+
 /**
  * Flush cached media for a style.
  *
@@ -1137,6 +1172,8 @@ function image_effect_apply($image, $effect) {
  *   - path: The path of the image file relative to the Drupal files directory.
  *     This function does not work with images outside the files directory nor
  *     with remotely hosted images.
+ *   - width: The width of the source image (if known).
+ *   - height: The height of the source image (if known).
  *   - alt: The alternative text for text-based browsers.
  *   - title: The title text is displayed when the image is hovered in some
  *     popular browsers.
@@ -1145,6 +1182,18 @@ function image_effect_apply($image, $effect) {
  * @ingroup themeable
  */
 function theme_image_style($variables) {
+  // Determine the dimensions of the styled image.
+  $dimensions = array(
+    'width' => $variables['width'],
+    'height' => $variables['height'],
+  );
+
+  image_style_transform_dimensions($variables['style_name'], $dimensions);
+
+  $variables['width'] = $dimensions['width'];
+  $variables['height'] = $dimensions['height'];
+
+  // Determine the url for the styled image.
   $variables['path'] = image_style_url($variables['style_name'], $variables['path']);
   return theme('image', $variables);
 }
diff --git a/modules/image/image.test b/modules/image/image.test
index 8596d66804048e25b570c77f1964801863e5ad41..a29b4f3a1d7fbacd3b3f6956e47675fb36de941b 100644
--- a/modules/image/image.test
+++ b/modules/image/image.test
@@ -667,6 +667,8 @@ class ImageFieldDisplayTestCase extends ImageFieldTestCase {
     $image_uri = $node->{$field_name}[LANGUAGE_NONE][0]['uri'];
     $image_info = array(
       'path' => $image_uri,
+      'width' => 40,
+      'height' => 20,
     );
     $default_output = theme('image', $image_info);
     $this->assertRaw($default_output, t('Default formatter displaying correctly on full node view.'));
@@ -712,6 +714,8 @@ class ImageFieldDisplayTestCase extends ImageFieldTestCase {
     // image style callback paths.
     $this->drupalGet(image_style_url('thumbnail', $image_uri));
     $image_info['path'] = image_style_path('thumbnail', $image_uri);
+    $image_info['width'] = 100;
+    $image_info['height'] = 50;
     $default_output = theme('image', $image_info);
     $this->drupalGet('node/' . $nid);
     $this->assertRaw($default_output, t('Image style thumbnail formatter displaying correctly on full node view.'));
@@ -761,6 +765,8 @@ class ImageFieldDisplayTestCase extends ImageFieldTestCase {
     $node = node_load($nid, NULL, TRUE);
     $image_info = array(
       'path' => image_style_url('medium', $node->{$field_name}[LANGUAGE_NONE][0]['uri']),
+      'width' => 220,
+      'height' => 110,
     );
     $default_output = theme('image', $image_info);
     $this->assertRaw($default_output, t("Preview image is displayed using 'medium' style."));
@@ -770,6 +776,8 @@ class ImageFieldDisplayTestCase extends ImageFieldTestCase {
       'path' => $node->{$field_name}[LANGUAGE_NONE][0]['uri'],
       'alt' => $this->randomName(),
       'title' => $this->randomName(),
+      'width' => 40,
+      'height' => 20,
     );
     $edit = array(
       $field_name . '[' . LANGUAGE_NONE . '][0][alt]' => $image_info['alt'],
@@ -817,6 +825,8 @@ class ImageFieldDisplayTestCase extends ImageFieldTestCase {
     $node = node_load($nid, NULL, TRUE);
     $image_info = array(
       'path' => $node->{$field_name}[LANGUAGE_NONE][0]['uri'],
+      'width' => 40,
+      'height' => 20,
     );
     $image_output = theme('image', $image_info);
     $this->drupalGet('node/' . $nid);
@@ -901,3 +911,221 @@ class ImageFieldValidateTestCase extends ImageFieldTestCase {
     $this->assertText(t('The image was resized to fit within the maximum allowed dimensions of 100x100 pixels.'), t('Image exceeding max resolution was properly resized.'));
   }
 }
+
+/**
+ * Tests that images have correct dimensions when styled.
+ */
+class ImageDimensionsUnitTest extends DrupalWebTestCase {
+
+  public static function getInfo() {
+    return array(
+      'name' => 'Image dimensions',
+      'description' => 'Tests that images have correct dimensions when styled.',
+      'group' => 'Image',
+    );
+  }
+
+  function setUp() {
+    parent::setUp('image_module_test');
+  }
+
+  /**
+   * Test styled image dimensions cumulatively.
+   */
+  function testImageDimensions() {
+    // Create a working copy of the file.
+    $files = $this->drupalGetTestFiles('image');
+    $file = reset($files);
+    $original_uri = file_unmanaged_copy($file->uri, 'public://', FILE_EXISTS_RENAME);
+
+    // Create a style.
+    $style = image_style_save(array('name' => 'test'));
+    $generated_uri = 'public://styles/test/public/'. basename($original_uri);
+    $url = image_style_url('test', $original_uri);
+
+    $variables = array(
+      'style_name' => 'test',
+      'path' => $original_uri,
+      'width' => 40,
+      'height' => 20,
+    );
+
+    // Scale an image that is wider than it is high.
+    $effect = array(
+      'name' => 'image_scale',
+      'data' => array(
+        'width' => 120,
+        'height' => 90,
+        'upscale' => TRUE,
+      ),
+      'isid' => $style['isid'],
+    );
+
+    image_effect_save($effect);
+    $img_tag = theme_image_style($variables);
+    $this->assertEqual($img_tag, '<img typeof="foaf:Image" src="' . $url . '" width="120" height="60" alt="" />', t('Expected img tag was found.'));
+    $this->assertFalse(file_exists($generated_uri), t('Generated file does not exist.'));
+    $this->drupalGet($url);
+    $this->assertResponse(200, t('Image was generated at the URL.'));
+    $this->assertTrue(file_exists($generated_uri), t('Generated file does exist after we accessed it.'));
+    $image_info = image_get_info($generated_uri);
+    $this->assertEqual($image_info['width'], 120, t('Expected width was found.'));
+    $this->assertEqual($image_info['height'], 60, t('Expected height was found.'));
+
+    // Rotate 90 degrees anticlockwise.
+    $effect = array(
+      'name' => 'image_rotate',
+      'data' => array(
+        'degrees' => -90,
+        'random' => FALSE,
+      ),
+      'isid' => $style['isid'],
+    );
+
+    image_effect_save($effect);
+    $img_tag = theme_image_style($variables);
+    $this->assertEqual($img_tag, '<img typeof="foaf:Image" src="' . $url . '" width="60" height="120" alt="" />', t('Expected img tag was found.'));
+    $this->assertFalse(file_exists($generated_uri), t('Generated file does not exist.'));
+    $this->drupalGet($url);
+    $this->assertResponse(200, t('Image was generated at the URL.'));
+    $this->assertTrue(file_exists($generated_uri), t('Generated file does exist after we accessed it.'));
+    $image_info = image_get_info($generated_uri);
+    $this->assertEqual($image_info['width'], 60, t('Expected width was found.'));
+    $this->assertEqual($image_info['height'], 120, t('Expected height was found.'));
+
+    // Scale an image that is higher than it is wide (rotated by previous effect).
+    $effect = array(
+      'name' => 'image_scale',
+      'data' => array(
+        'width' => 120,
+        'height' => 90,
+        'upscale' => TRUE,
+      ),
+      'isid' => $style['isid'],
+    );
+
+    image_effect_save($effect);
+    $img_tag = theme_image_style($variables);
+    $this->assertEqual($img_tag, '<img typeof="foaf:Image" src="' . $url . '" width="45" height="90" alt="" />', t('Expected img tag was found.'));
+    $this->assertFalse(file_exists($generated_uri), t('Generated file does not exist.'));
+    $this->drupalGet($url);
+    $this->assertResponse(200, t('Image was generated at the URL.'));
+    $this->assertTrue(file_exists($generated_uri), t('Generated file does exist after we accessed it.'));
+    $image_info = image_get_info($generated_uri);
+    $this->assertEqual($image_info['width'], 45, t('Expected width was found.'));
+    $this->assertEqual($image_info['height'], 90, t('Expected height was found.'));
+
+    // Test upscale disabled.
+    $effect = array(
+      'name' => 'image_scale',
+      'data' => array(
+        'width' => 400,
+        'height' => 200,
+        'upscale' => FALSE,
+      ),
+      'isid' => $style['isid'],
+    );
+
+    image_effect_save($effect);
+    $img_tag = theme_image_style($variables);
+    $this->assertEqual($img_tag, '<img typeof="foaf:Image" src="' . $url . '" width="45" height="90" alt="" />', t('Expected img tag was found.'));
+    $this->assertFalse(file_exists($generated_uri), t('Generated file does not exist.'));
+    $this->drupalGet($url);
+    $this->assertResponse(200, t('Image was generated at the URL.'));
+    $this->assertTrue(file_exists($generated_uri), t('Generated file does exist after we accessed it.'));
+    $image_info = image_get_info($generated_uri);
+    $this->assertEqual($image_info['width'], 45, t('Expected width was found.'));
+    $this->assertEqual($image_info['height'], 90, t('Expected height was found.'));
+
+    // Add a desaturate effect.
+    $effect = array(
+      'name' => 'image_desaturate',
+      'data' => array(),
+      'isid' => $style['isid'],
+    );
+
+    image_effect_save($effect);
+    $img_tag = theme_image_style($variables);
+    $this->assertEqual($img_tag, '<img typeof="foaf:Image" src="' . $url . '" width="45" height="90" alt="" />', t('Expected img tag was found.'));
+    $this->assertFalse(file_exists($generated_uri), t('Generated file does not exist.'));
+    $this->drupalGet($url);
+    $this->assertResponse(200, t('Image was generated at the URL.'));
+    $this->assertTrue(file_exists($generated_uri), t('Generated file does exist after we accessed it.'));
+    $image_info = image_get_info($generated_uri);
+    $this->assertEqual($image_info['width'], 45, t('Expected width was found.'));
+    $this->assertEqual($image_info['height'], 90, t('Expected height was found.'));
+
+    // Add a random rotate effect.
+    $effect = array(
+      'name' => 'image_rotate',
+      'data' => array(
+        'degrees' => 180,
+        'random' => TRUE,
+      ),
+      'isid' => $style['isid'],
+    );
+
+    image_effect_save($effect);
+    $img_tag = theme_image_style($variables);
+    $this->assertEqual($img_tag, '<img typeof="foaf:Image" src="' . $url . '" alt="" />', t('Expected img tag was found.'));
+    $this->assertFalse(file_exists($generated_uri), t('Generated file does not exist.'));
+    $this->drupalGet($url);
+    $this->assertResponse(200, t('Image was generated at the URL.'));
+    $this->assertTrue(file_exists($generated_uri), t('Generated file does exist after we accessed it.'));
+
+
+    // Add a crop effect.
+    $effect = array(
+      'name' => 'image_crop',
+      'data' => array(
+        'width' => 30,
+        'height' => 30,
+        'anchor' => 'center-center',
+      ),
+      'isid' => $style['isid'],
+    );
+
+    image_effect_save($effect);
+    $img_tag = theme_image_style($variables);
+    $this->assertEqual($img_tag, '<img typeof="foaf:Image" src="' . $url . '" width="30" height="30" alt="" />', t('Expected img tag was found.'));
+    $this->assertFalse(file_exists($generated_uri), t('Generated file does not exist.'));
+    $this->drupalGet($url);
+    $this->assertResponse(200, t('Image was generated at the URL.'));
+    $this->assertTrue(file_exists($generated_uri), t('Generated file does exist after we accessed it.'));
+    $image_info = image_get_info($generated_uri);
+    $this->assertEqual($image_info['width'], 30, t('Expected width was found.'));
+    $this->assertEqual($image_info['height'], 30, t('Expected height was found.'));
+
+    // Rotate to a non-multiple of 90 degrees.
+    $effect = array(
+      'name' => 'image_rotate',
+      'data' => array(
+        'degrees' => 57,
+        'random' => FALSE,
+      ),
+      'isid' => $style['isid'],
+    );
+
+    $effect = image_effect_save($effect);
+    $img_tag = theme_image_style($variables);
+    $this->assertEqual($img_tag, '<img typeof="foaf:Image" src="' . $url . '" alt="" />', t('Expected img tag was found.'));
+    $this->assertFalse(file_exists($generated_uri), t('Generated file does not exist.'));
+    $this->drupalGet($url);
+    $this->assertResponse(200, t('Image was generated at the URL.'));
+    $this->assertTrue(file_exists($generated_uri), t('Generated file does exist after we accessed it.'));
+
+    image_effect_delete($effect);
+
+    // Ensure that an effect with no dimensions callback unsets the dimensions.
+    // This ensures compatibility with 7.0 contrib modules.
+    $effect = array(
+      'name' => 'image_module_test_null',
+      'data' => array(),
+      'isid' => $style['isid'],
+    );
+
+    image_effect_save($effect);
+    $img_tag = theme_image_style($variables);
+    $this->assertEqual($img_tag, '<img typeof="foaf:Image" src="' . $url . '" alt="" />', t('Expected img tag was found.'));
+  }
+}
diff --git a/modules/image/tests/image_module_test.info b/modules/image/tests/image_module_test.info
index d2d6bdbee376225155f13ecc0d955c56d9f6ddfd..9874a14ebaf7f98d651f0477228dd09cf9caaa9b 100644
--- a/modules/image/tests/image_module_test.info
+++ b/modules/image/tests/image_module_test.info
@@ -6,8 +6,8 @@ core = 7.x
 files[] = image_module_test.module
 hidden = TRUE
 
-; Information added by drupal.org packaging script on 2011-08-31
-version = "7.8"
+; Information added by drupal.org packaging script on 2011-10-26
+version = "7.9"
 project = "drupal"
-datestamp = "1314817616"
+datestamp = "1319660730"
 
diff --git a/modules/image/tests/image_module_test.module b/modules/image/tests/image_module_test.module
index 038bd155c70b72e02aa1c6cc7fde0aba60268e77..766a9d95769110a584faea8a81ecf52792a7c1b3 100644
--- a/modules/image/tests/image_module_test.module
+++ b/modules/image/tests/image_module_test.module
@@ -11,3 +11,31 @@ function image_module_test_file_download($uri) {
   }
   return -1;
 }
+
+/**
+ * Implements hook_image_effect_info().
+ */
+function image_module_test_image_effect_info() {
+  $effects = array(
+    'image_module_test_null' => array(
+    'effect callback' => 'image_module_test_null_effect',
+    ),
+  );
+
+  return $effects;
+}
+
+/**
+ * Image effect callback; Null.
+ *
+ * @param $image
+ *   An image object returned by image_load().
+ * @param $data
+ *   An array with no attributes.
+ *
+ * @return
+ *   TRUE
+ */
+function image_module_test_null_effect(array &$image, array $data) {
+  return TRUE;
+}
diff --git a/modules/locale/locale.admin.inc b/modules/locale/locale.admin.inc
index 01cee134dd8a4b0dd827a72c5d631ac9c48380af..174349750cebb7b23eaa462663b36ebff6e53405 100644
--- a/modules/locale/locale.admin.inc
+++ b/modules/locale/locale.admin.inc
@@ -307,7 +307,7 @@ function _locale_languages_common_controls(&$form, $language = NULL) {
     '#title' => t('Language domain'),
     '#maxlength' => 128,
     '#default_value' => @$language->domain,
-    '#description' => t('URL <strong>including protocol</strong> to use for this language, if your <em>Detection and selection</em> settings use URL domains. For the default language, this value may be left blank. <strong>Modifying this value may break existing URLs. Use with caution in a production environment.</strong> Example: Specifying "http://example.de" or "http://de.example.com" as language domains for German results in URLs like "http://example.de/contact" and "http://de.example.com/contact", respectively.'),
+    '#description' => t('The domain name to use for this language if URL domains are used for <em>Detection and selection</em>. Leave blank for the default language. <strong>Changing this value may break existing URLs.</strong> Example: Specifying "de.example.com" as language domain for German will result in an URL like "http://de.example.com/contact".'),
   );
   $form['direction'] = array('#type' => 'radios',
     '#title' => t('Direction'),
diff --git a/modules/locale/locale.info b/modules/locale/locale.info
index d882431f74b66181cad4fc3a02e2dad0425d3d34..1d333719f4d71cd74256624f6e8b617d0479cfc9 100644
--- a/modules/locale/locale.info
+++ b/modules/locale/locale.info
@@ -6,8 +6,8 @@ core = 7.x
 files[] = locale.test
 configure = admin/config/regional/language
 
-; Information added by drupal.org packaging script on 2011-08-31
-version = "7.8"
+; Information added by drupal.org packaging script on 2011-10-26
+version = "7.9"
 project = "drupal"
-datestamp = "1314817616"
+datestamp = "1319660730"
 
diff --git a/modules/locale/locale.test b/modules/locale/locale.test
index 3ae6d91a5c80199860ceb328d4778ed5c5b8701d..5ab0d28876ced080a521e5e925d33c5e7fd015b4 100644
--- a/modules/locale/locale.test
+++ b/modules/locale/locale.test
@@ -179,6 +179,73 @@ class LocaleConfigurationTest extends DrupalWebTestCase {
 
 }
 
+/**
+ * Functional tests for JavaScript parsing for translatable strings.
+ */
+class LocaleJavascriptTranslationTest extends DrupalWebTestCase {
+  public static function getInfo() {
+    return array(
+      'name' => 'Javascript translation',
+      'description' => 'Tests parsing js files for translatable strings',
+      'group' => 'Locale',
+    );
+  }
+
+  function setUp() {
+    parent::setUp('locale', 'locale_test');
+  }
+
+  function testFileParsing() {
+
+    $filename = drupal_get_path('module', 'locale_test') . '/locale_test.js';
+
+    // Parse the file to look for source strings.
+    _locale_parse_js_file($filename);
+
+    // Get all of the source strings that were found.
+    $source_strings = db_select('locales_source', 's')
+      ->fields('s', array('source', 'lid'))
+      ->condition('s.location', $filename)
+      ->execute()
+      ->fetchAllKeyed();
+
+    // List of all strings that should be in the file.
+    $test_strings = array(
+      "Standard Call t",
+      "Whitespace Call t",
+
+      "Single Quote t",
+      "Single Quote \\'Escaped\\' t",
+      "Single Quote Concat strings t",
+
+      "Double Quote t",
+      "Double Quote \\\"Escaped\\\" t",
+      "Double Quote Concat strings t",
+
+      "Standard Call plural",
+      "Standard Call @count plural",
+      "Whitespace Call plural",
+      "Whitespace Call @count plural",
+
+      "Single Quote plural",
+      "Single Quote @count plural",
+      "Single Quote \\'Escaped\\' plural",
+      "Single Quote \\'Escaped\\' @count plural",
+
+      "Double Quote plural",
+      "Double Quote @count plural",
+      "Double Quote \\\"Escaped\\\" plural",
+      "Double Quote \\\"Escaped\\\" @count plural",
+    );
+
+    // Assert that all strings were found properly.
+    foreach ($test_strings as $str) {
+      $this->assertTrue(isset($source_strings[$str]), t("Found source string: %source", array('%source' => $str)));
+    }
+
+    $this->assertEqual(count($source_strings), count($test_strings), t("Found correct number of source strings."));
+  }
+}
 /**
  * Functional test for string translation and validation.
  */
@@ -291,9 +358,8 @@ class LocaleTranslationFunctionalTest extends DrupalWebTestCase {
     $this->assertRaw(t('The language %locale has been removed.', array('%locale' => $name)), t('The test language has been removed.'));
     // Reload to remove $name.
     $this->drupalGet($path);
-    $this->assertNoText($langcode, t('Language code not found.'));
-    $this->assertNoText($name, t('Name not found.'));
-    $this->assertNoText($native, t('Native not found.'));
+    // Verify that language is no longer found.
+    $this->assertResponse(404, t('Language no longer found.'));
     $this->drupalLogout();
 
     // Delete the string.
@@ -1321,6 +1387,125 @@ class LocaleLanguageSwitchingFunctionalTest extends DrupalWebTestCase {
   }
 }
 
+/**
+ * Test browser language detection.
+ */
+class LocaleBrowserDetectionTest extends DrupalUnitTestCase {
+
+  public static function getInfo() {
+    return array(
+      'name' => 'Browser language detection',
+      'description' => 'Tests for the browser language detection.',
+      'group' => 'Locale',
+    );
+  }
+
+  /**
+   * Unit tests for the locale_language_from_browser() function.
+   */
+  function testLanguageFromBrowser() {
+    // Load the required functions.
+    require_once DRUPAL_ROOT . '/includes/locale.inc';
+
+    $languages = array(
+      // In our test case, 'en' has priority over 'en-US'.
+      'en' => (object) array(
+        'language' => 'en',
+      ),
+      'en-US' => (object) array(
+        'language' => 'en-US',
+      ),
+      // But 'fr-CA' has priority over 'fr'.
+      'fr-CA' => (object) array(
+        'language' => 'fr-CA',
+      ),
+      'fr' => (object) array(
+        'language' => 'fr',
+      ),
+      // 'es-MX' is alone.
+      'es-MX' => (object) array(
+        'language' => 'es-MX',
+      ),
+      // 'pt' is alone.
+      'pt' => (object) array(
+        'language' => 'pt',
+      ),
+      // Language codes with more then one dash are actually valid.
+      // eh-oh-laa-laa is the official language code of the Teletubbies.
+      'eh-oh-laa-laa' => (object) array(
+        'language' => 'eh-oh-laa-laa',
+      ),
+    );
+
+    $test_cases = array(
+      // Equal qvalue for each language, choose the site prefered one.
+      'en,en-US,fr-CA,fr,es-MX' => 'en',
+      'en-US,en,fr-CA,fr,es-MX' => 'en',
+      'fr,en' => 'en',
+      'en,fr' => 'en',
+      'en-US,fr' => 'en',
+      'fr,en-US' => 'en',
+      'fr,fr-CA' => 'fr-CA',
+      'fr-CA,fr' => 'fr-CA',
+      'fr' => 'fr-CA',
+      'fr;q=1' => 'fr-CA',
+      'fr,es-MX' => 'fr-CA',
+      'fr,es' => 'fr-CA',
+      'es,fr' => 'fr-CA',
+      'es-MX,de' => 'es-MX',
+      'de,es-MX' => 'es-MX',
+
+      // Different cases and whitespace.
+      'en' => 'en',
+      'En' => 'en',
+      'EN' => 'en',
+      ' en' => 'en',
+      'en ' => 'en',
+
+      // A less specific language from the browser matches a more specific one
+      // from the website, and the other way around for compatibility with
+      // some versions of Internet Explorer.
+      'es' => 'es-MX',
+      'es-MX' => 'es-MX',
+      'pt' => 'pt',
+      'pt-PT' => 'pt',
+      'pt-PT;q=0.5,pt-BR;q=1,en;q=0.7' => 'en',
+      'pt-PT;q=1,pt-BR;q=0.5,en;q=0.7' => 'en',
+      'pt-PT;q=0.4,pt-BR;q=0.1,en;q=0.7' => 'en',
+      'pt-PT;q=0.1,pt-BR;q=0.4,en;q=0.7' => 'en',
+
+      // Language code with several dashes are valid. The less specific language
+      // from the browser matches the more specific one from the website.
+      'eh-oh-laa-laa' => 'eh-oh-laa-laa',
+      'eh-oh-laa' => 'eh-oh-laa-laa',
+      'eh-oh' => 'eh-oh-laa-laa',
+      'eh' => 'eh-oh-laa-laa',
+
+      // Different qvalues.
+      'en-US,en;q=0.5,fr;q=0.25' => 'en-US',
+      'fr,en;q=0.5' => 'fr-CA',
+      'fr,en;q=0.5,fr-CA;q=0.25' => 'fr',
+
+      // Silly wildcards are also valid.
+      '*,fr-CA;q=0.5' => 'en',
+      '*,en;q=0.25' => 'fr-CA',
+      'en,en-US;q=0.5,fr;q=0.25' => 'en',
+      'en-US,en;q=0.5,fr;q=0.25' => 'en-US',
+
+      // Unresolvable cases.
+      '' => FALSE,
+      'de,pl' => FALSE,
+      $this->randomName(10) => FALSE,
+    );
+
+    foreach ($test_cases as $accept_language => $expected_result) {
+      $_SERVER['HTTP_ACCEPT_LANGUAGE'] = $accept_language;
+      $result = locale_language_from_browser($languages);
+      $this->assertIdentical($result, $expected_result, t("Language selection '@accept-language' selects '@result', result = '@actual'", array('@accept-language' => $accept_language, '@result' => $expected_result, '@actual' => isset($result) ? $result : 'none')));
+    }
+  }
+}
+
 /**
  * Functional tests for a user's ability to change their default language.
  */
@@ -1930,8 +2115,8 @@ class LocaleUILanguageNegotiationTest extends DrupalWebTestCase {
     $this->assertResponse(404, "Unknown language path prefix should return 404");
 
     // Setup for domain negotiation, first configure the language to have domain
-    // URL.
-    $edit = array('prefix' => '', 'domain' => "http://$language_domain");
+    // URL. We use https and a port to make sure that only the domain name is used.
+    $edit = array('prefix' => '', 'domain' => "https://$language_domain:99");
     $this->drupalPost("admin/config/regional/language/edit/$language", $edit, t('Save language'));
     // Set the site to use domain language negotiation.
 
diff --git a/modules/locale/tests/locale_test.info b/modules/locale/tests/locale_test.info
index f0ed78d7370aaefc468566d97dd571b3774554c2..aa7ba9a99fd06208e93d5fc23f8ff190157727fd 100644
--- a/modules/locale/tests/locale_test.info
+++ b/modules/locale/tests/locale_test.info
@@ -5,8 +5,8 @@ package = Testing
 version = VERSION
 hidden = TRUE
 
-; Information added by drupal.org packaging script on 2011-08-31
-version = "7.8"
+; Information added by drupal.org packaging script on 2011-10-26
+version = "7.9"
 project = "drupal"
-datestamp = "1314817616"
+datestamp = "1319660730"
 
diff --git a/modules/locale/tests/locale_test.js b/modules/locale/tests/locale_test.js
new file mode 100644
index 0000000000000000000000000000000000000000..251d115c3ff78dd46946c7032ce83d226161e8b1
--- /dev/null
+++ b/modules/locale/tests/locale_test.js
@@ -0,0 +1,35 @@
+
+Drupal.t("Standard Call t");
+Drupal
+.
+t
+(
+"Whitespace Call t"
+)
+;
+
+Drupal.t('Single Quote t');
+Drupal.t('Single Quote \'Escaped\' t');
+Drupal.t('Single Quote ' + 'Concat ' + 'strings ' + 't');
+
+Drupal.t("Double Quote t");
+Drupal.t("Double Quote \"Escaped\" t");
+Drupal.t("Double Quote " + "Concat " + "strings " + "t");
+
+
+Drupal.formatPlural(1, "Standard Call plural", "Standard Call @count plural");
+Drupal
+.
+formatPlural
+(
+1,
+"Whitespace Call plural",
+"Whitespace Call @count plural",
+)
+;
+
+Drupal.formatPlural(1, 'Single Quote plural', 'Single Quote @count plural');
+Drupal.formatPlural(1, 'Single Quote \'Escaped\' plural', 'Single Quote \'Escaped\' @count plural');
+
+Drupal.formatPlural(1, "Double Quote plural", "Double Quote @count plural");
+Drupal.formatPlural(1, "Double Quote \"Escaped\" plural", "Double Quote \"Escaped\" @count plural");
diff --git a/modules/menu/menu.admin.inc b/modules/menu/menu.admin.inc
index 7b5882c530189fc7813d520aa30368246d313892..d9b98ccbe49a5bd7d13eefff3278df00ae6d99c4 100644
--- a/modules/menu/menu.admin.inc
+++ b/modules/menu/menu.admin.inc
@@ -286,6 +286,7 @@ function menu_edit_item($form, &$form_state, $type, $item, $menu) {
     $form['link_path'] = array(
       '#type' => 'textfield',
       '#title' => t('Path'),
+      '#maxlength' => 255,
       '#default_value' => $path,
       '#description' => t('The path for this menu link. This can be an internal Drupal path such as %add-node or an external URL such as %drupal. Enter %front to link to the front page.', array('%front' => '<front>', '%add-node' => 'node/add', '%drupal' => 'http://drupal.org')),
       '#required' => TRUE,
diff --git a/modules/menu/menu.info b/modules/menu/menu.info
index 8447f879d173713c6d5e08b87b11b64ef018550a..50e81fa6ed58ba52c17172c5d578e6dc1ba50713 100644
--- a/modules/menu/menu.info
+++ b/modules/menu/menu.info
@@ -6,8 +6,8 @@ core = 7.x
 files[] = menu.test
 configure = admin/structure/menu
 
-; Information added by drupal.org packaging script on 2011-08-31
-version = "7.8"
+; Information added by drupal.org packaging script on 2011-10-26
+version = "7.9"
 project = "drupal"
-datestamp = "1314817616"
+datestamp = "1319660730"
 
diff --git a/modules/menu/menu.install b/modules/menu/menu.install
index 3b75ad436ef5c605ae3fdc190b11c9bf84c901f0..a7e43379e8dc133cbcd4d30adb405dca9459c6d6 100644
--- a/modules/menu/menu.install
+++ b/modules/menu/menu.install
@@ -166,18 +166,21 @@ function menu_update_7001() {
  * Rename the primary/secondary menu blocks to match previously renamed menus.
  */
 function menu_update_7002(&$sandbox) {
-  $renamed_deltas = array(
-    'menu' => array(
-      'primary-links' => 'main-menu',
-      'secondary-links' => 'secondary-menu',
-    ),
-  );
+  // Check for the presence of old or new table names.
+  if (db_table_exists('blocks') || db_table_exists('block')) {
+    $renamed_deltas = array(
+      'menu' => array(
+        'primary-links' => 'main-menu',
+        'secondary-links' => 'secondary-menu',
+      ),
+    );
 
-  $moved_deltas = array(
-    'menu' => array('main-menu' => 'system'),
-  );
+    $moved_deltas = array(
+      'menu' => array('main-menu' => 'system'),
+    );
 
-  update_fix_d7_block_deltas($sandbox, $renamed_deltas, $moved_deltas);
+    update_fix_d7_block_deltas($sandbox, $renamed_deltas, $moved_deltas);
+  }
 }
 /**
  * @} End of "defgroup updates-7.x-extra"
diff --git a/modules/menu/menu.module b/modules/menu/menu.module
index 254079700c9ef7ab43ec1ea1fa7f5d177802c1d3..c9148673123c6c0021c022f3e19c072a1875a7dc 100644
--- a/modules/menu/menu.module
+++ b/modules/menu/menu.module
@@ -322,6 +322,9 @@ function menu_delete($menu) {
  * @param $item
  *   The menu item or the node type for which to generate a list of parents.
  *   If $item['mlid'] == 0 then the complete tree is returned.
+ * @param $type
+ *   The node type for which to generate a list of parents.
+ *   If $item itself is a node type then $type is ignored.
  * @return
  *   An array of menu link titles keyed on the a string containing the menu name
  *   and mlid. The list excludes the given item and its children.
@@ -329,7 +332,7 @@ function menu_delete($menu) {
  * @todo This has to be turned into a #process form element callback. The
  *   'menu_override_parent_selector' variable is entirely superfluous.
  */
-function menu_parent_options($menus, $item) {
+function menu_parent_options($menus, $item, $type = '') {
   // The menu_links table can be practically any size and we need a way to
   // allow contrib modules to provide more scalable pattern choosers.
   // hook_form_alter is too late in itself because all the possible parents are
@@ -339,18 +342,22 @@ function menu_parent_options($menus, $item) {
   }
 
   $available_menus = array();
-  if (is_array($item)) {
-    // If $item is an array fill it with all menus given to this function.
+  if (!is_array($item)) {
+    // If $item is not an array then it is a node type.
+    // Use it as $type and prepare a dummy menu item for _menu_get_options().
+    $type = $item;
+    $item = array('mlid' => 0);
+  }
+  if (empty($type)) {
+    // If no node type is set, use all menus given to this function.
     $available_menus = $menus;
   }
   else {
-    // If $item is a node type, get all available menus for this type and
-    // prepare a dummy menu item for _menu_parent_depth_limit().
-    $type_menus = variable_get('menu_options_' . $item, array('main-menu' => 'main-menu'));
+    // If a node type is set, use all available menus for this type.
+    $type_menus = variable_get('menu_options_' . $type, array('main-menu' => 'main-menu'));
     foreach ($type_menus as $menu) {
       $available_menus[$menu] = $menu;
     }
-    $item = array('mlid' => 0);
   }
 
   return _menu_get_options($menus, $available_menus, $item);
@@ -600,15 +607,18 @@ function _menu_parent_depth_limit($item) {
  * @see menu_node_submit()
  */
 function menu_form_node_form_alter(&$form, $form_state) {
-  // Generate a list of possible parents.
+  // Generate a list of possible parents (not including this link or descendants).
   // @todo This must be handled in a #process handler.
+  $link = $form['#node']->menu;
   $type = $form['#node']->type;
-  $options = menu_parent_options(menu_get_menus(), $type);
+  // menu_parent_options() is goofy and can actually handle either a menu link
+  // or a node type both as second argument. Pick based on whether there is
+  // a link already (menu_node_prepare() sets mlid default to 0).
+  $options = menu_parent_options(menu_get_menus(), $link['mlid'] ? $link : $type);
   // If no possible parent menu items were found, there is nothing to display.
   if (empty($options)) {
     return;
   }
-  $link = $form['#node']->menu;
 
   $form['menu'] = array(
     '#type' => 'fieldset',
@@ -659,9 +669,13 @@ function menu_form_node_form_alter(&$form, $form_state) {
   );
 
   $default = ($link['mlid'] ? $link['menu_name'] . ':' . $link['plid'] : variable_get('menu_parent_' . $type, 'main-menu:0'));
-  // @todo This will fail with the new selective menus per content type.
+  // If the current parent menu item is not present in options, use the first
+  // available option as default value.
+  // @todo User should not be allowed to access menu link settings in such a
+  // case.
   if (!isset($options[$default])) {
-    $default = 'navigation:0';
+    $array = array_keys($options);
+    $default = reset($array);
   }
   $form['menu']['link']['parent'] = array(
     '#type' => 'select',
diff --git a/modules/menu/menu.test b/modules/menu/menu.test
index b457177cdbb0fccd69e0a36d975ab95c54aeb2d1..0edfc47b4f0c15aa53a80d3ca7a84dee1cfb1bf8 100644
--- a/modules/menu/menu.test
+++ b/modules/menu/menu.test
@@ -680,5 +680,43 @@ class MenuNodeTestCase extends DrupalWebTestCase {
     $this->drupalPost('node/' . $node->nid . '/edit', $edit, t('Save'));
     $link = menu_link_load($item['mlid']);
     $this->assertTrue($link, t('Link in not allowed menu still exists after saving node'));
+
+    // Move the menu link back to the Navigation menu.
+    $item['menu_name'] = 'navigation';
+    menu_link_save($item);
+    // Create a second node.
+    $child_node = $this->drupalCreateNode(array('type' => 'article'));
+    // Assign a menu link to the second node, being a child of the first one.
+    $child_item = array(
+      'link_path' => 'node/'. $child_node->nid,
+      'link_title' => $this->randomName(16),
+      'plid' => $item['mlid'],
+    );
+    menu_link_save($child_item);
+    // Edit the first node.
+    $this->drupalGet('node/'. $node->nid .'/edit');
+    // Assert that it is not possible to set the parent of the first node to itself or the second node.
+    $this->assertNoOption('edit-menu-parent', 'navigation:'. $item['mlid']);
+    $this->assertNoOption('edit-menu-parent', 'navigation:'. $child_item['mlid']);
+  }
+
+  /**
+   * Asserts that a select option in the current page does not exist.
+   *
+   * @param $id
+   *   Id of select field to assert.
+   * @param $option
+   *   Option to assert.
+   * @param $message
+   *   Message to display.
+   * @return
+   *   TRUE on pass, FALSE on fail.
+   *
+   * @todo move to simpletest drupal_web_test_case.php.
+   */
+  protected function assertNoOption($id, $option, $message = '') {
+    $selects = $this->xpath('//select[@id=:id]', array(':id' => $id));
+    $options = $this->xpath('//select[@id=:id]//option[@value=:option]', array(':id' => $id, ':option' => $option));
+    return $this->assertTrue(isset($selects[0]) && !isset($options[0]), $message ? $message : t('Option @option for field @id does not exist.', array('@option' => $option, '@id' => $id)), t('Browser'));
   }
 }
diff --git a/modules/node/node-rtl.css b/modules/node/node-rtl.css
deleted file mode 100644
index a5fe99eaaa86dedacd5fc6ad6d4183a8f96c69c7..0000000000000000000000000000000000000000
--- a/modules/node/node-rtl.css
+++ /dev/null
@@ -1,14 +0,0 @@
-
-#node-admin-content dl.multiselect dd .form-item label {
-  display: block;
-  float: right;
-  width: 6em;
-  font-weight: normal;
-}
-
-#node-admin-buttons {
-  float: right;
-  margin-left: 0;
-  margin-right: 0.5em;
-  clear: left;
-}
diff --git a/modules/node/node.admin.inc b/modules/node/node.admin.inc
index a6ea1b5e5b6de1a2371f473687ecb0c3c42920d8..9eeee0defffc4502370310e8c1f90b97d5beeea4 100644
--- a/modules/node/node.admin.inc
+++ b/modules/node/node.admin.inc
@@ -121,10 +121,6 @@ function node_build_filter_query(SelectQueryInterface $query) {
   foreach ($filter_data as $index => $filter) {
     list($key, $value) = $filter;
     switch ($key) {
-      case 'term':
-        $alias = $query->join('taxonomy_index', 'ti', "n.nid = %alias.nid");
-        $query->condition($alias . '.tid', $value);
-        break;
       case 'status':
         // Note: no exploitable hole as $key/$value have already been checked when submitted
         list($key, $value) = explode('-', $value, 2);
diff --git a/modules/node/node.api.php b/modules/node/node.api.php
index bc2eb65b1733f6a3ec3bcdc471a0d7f522cd6b77..5c41e1f761cd43a259d25ecf2db739c62e871f58 100644
--- a/modules/node/node.api.php
+++ b/modules/node/node.api.php
@@ -570,11 +570,9 @@ function hook_node_load($nodes, $types) {
  * block access, return NODE_ACCESS_IGNORE or simply return nothing.
  * Blindly returning FALSE will break other node access modules.
  *
- * @link http://api.drupal.org/api/group/node_access/7 More on the node access system @endlink
- * @ingroup node_access
  * @param $node
- *   The node on which the operation is to be performed, or, if it does
- *   not yet exist, the type of node to be created.
+ *   Either a node object or a (machine-readable) content type on which to
+ *   perform the access check.
  * @param $op
  *   The operation to be performed. Possible values:
  *   - "create"
@@ -582,13 +580,14 @@ function hook_node_load($nodes, $types) {
  *   - "update"
  *   - "view"
  * @param $account
- *   A user object representing the user for whom the operation is to be
- *   performed.
+ *   The user object to perform the access check operation on.
  *
  * @return
  *   NODE_ACCESS_ALLOW if the operation is to be allowed;
  *   NODE_ACCESS_DENY if the operation is to be denied;
  *   NODE_ACCESS_IGNORE to not affect this operation at all.
+ *
+ * @ingroup node_access
  */
 function hook_node_access($node, $op, $account) {
   $type = is_string($node) ? $node : $node->type;
@@ -880,9 +879,9 @@ function hook_node_view_alter(&$build) {
  *      machine name of this type. FALSE = changeable (not locked),
  *      TRUE = unchangeable (locked). Optional (defaults to TRUE).
  *
- * The machine-readable name of a node type should contain only letters,
- * numbers, and underscores. Underscores will be converted into hyphens for the
- * purpose of constructing URLs.
+ * The machine name of a node type should contain only letters, numbers, and
+ * underscores. Underscores will be converted into hyphens for the purpose of
+ * constructing URLs.
  *
  * All attributes of a node type that are defined through this hook (except for
  * 'locked') can be edited by a site administrator. This includes the
diff --git a/modules/node/node.info b/modules/node/node.info
index ab6119d53be1a3ba212119ed1db99250ca61e4c1..5228dfd7fe4b2aefee33d2a3143e99a6f9351dd4 100644
--- a/modules/node/node.info
+++ b/modules/node/node.info
@@ -9,8 +9,8 @@ required = TRUE
 configure = admin/structure/types
 stylesheets[all][] = node.css
 
-; Information added by drupal.org packaging script on 2011-08-31
-version = "7.8"
+; Information added by drupal.org packaging script on 2011-10-26
+version = "7.9"
 project = "drupal"
-datestamp = "1314817616"
+datestamp = "1319660730"
 
diff --git a/modules/node/node.module b/modules/node/node.module
index 6abfcb22e435f08216aa164067760a3f671e2be8..51ec8c3062fd2def5359351a3d1d32249eb1ef24 100644
--- a/modules/node/node.module
+++ b/modules/node/node.module
@@ -272,10 +272,10 @@ function node_admin_paths() {
  * Gathers a listing of links to nodes.
  *
  * @param $result
- *   A DB result object from a query to fetch node entities. If your query
- *   joins the <code>node_comment_statistics</code> table so that the
- *   <code>comment_count</code> field is available, a title attribute will
- *   be added to show the number of comments.
+ *   A database result object from a query to fetch node entities. If your
+ *   query joins the {node_comment_statistics} table so that the comment_count
+ *   field is available, a title attribute will be added to show the number of
+ *   comments.
  * @param $title
  *   A heading for the resulting list.
  *
@@ -1073,7 +1073,7 @@ function node_save($node) {
         $node->log = '';
       }
     }
-    elseif (empty($node->log)) {
+    elseif (!isset($node->log) || $node->log === '') {
       // If we are updating an existing node without adding a new revision, we
       // need to make sure $node->log is unset whenever it is empty. As long as
       // $node->log is unset, drupal_write_record() will not attempt to update
@@ -2447,7 +2447,7 @@ function node_feed($nids = FALSE, $channel = array()) {
     $nids = db_select('node', 'n')
       ->fields('n', array('nid', 'created'))
       ->condition('n.promote', 1)
-      ->condition('status', 1)
+      ->condition('n.status', 1)
       ->orderBy('n.created', 'DESC')
       ->range(0, variable_get('feed_default_items', 10))
       ->addTag('node_access')
@@ -2828,8 +2828,6 @@ function node_search_validate($form, &$form_state) {
  *   TRUE if the operation may be performed, FALSE otherwise.
  */
 function node_access($op, $node, $account = NULL) {
-  global $user;
-
   $rights = &drupal_static(__FUNCTION__, array());
 
   if (!$node || !in_array($op, array('view', 'update', 'delete', 'create'), TRUE)) {
@@ -2839,7 +2837,7 @@ function node_access($op, $node, $account = NULL) {
   }
   // If no user object is supplied, the access check is for the current user.
   if (empty($account)) {
-    $account = $user;
+    $account = $GLOBALS['user'];
   }
 
   // $node may be either an object or a node type. Since node types cannot be
diff --git a/modules/node/node.test b/modules/node/node.test
index 56a2d3426842c784a9295288c7e9252c7b6ae617..6c3a678d53f30ff4660e03e6b7311c8cf4f6c319 100644
--- a/modules/node/node.test
+++ b/modules/node/node.test
@@ -1957,7 +1957,7 @@ class NodeBuildContent extends DrupalWebTestCase {
   function testNodeRebuildContent() {
     $node = $this->drupalCreateNode();
 
-    // Set a property in the content array so we can test for its existance later on.
+    // Set a property in the content array so we can test for its existence later on.
     $node->content['test_content_property'] = array('#value' => $this->randomString());
     $content = node_build_content($node);
 
@@ -2270,6 +2270,7 @@ class NodeTokenReplaceTestCase extends DrupalWebTestCase {
     $tests['[node:language]'] = check_plain($node->language);
     $tests['[node:url]'] = url('node/' . $node->nid, $url_options);
     $tests['[node:edit-url]'] = url('node/' . $node->nid . '/edit', $url_options);
+    $tests['[node:author]'] = check_plain(format_username($account));
     $tests['[node:author:uid]'] = $node->uid;
     $tests['[node:author:name]'] = check_plain(format_username($account));
     $tests['[node:created:since]'] = format_interval(REQUEST_TIME - $node->created, 2, $language->language);
diff --git a/modules/node/node.tokens.inc b/modules/node/node.tokens.inc
index 80dbda517a011d497888ffed124c1486e9fd8442..491ec81c40941d8d127bcf819d30cbe0055774f3 100644
--- a/modules/node/node.tokens.inc
+++ b/modules/node/node.tokens.inc
@@ -135,11 +135,11 @@ function node_tokens($type, $tokens, array $data = array(), array $options = arr
 
         case 'body':
         case 'summary':
-          if (!empty($node->body)) {
-            $item = $node->body[$node->language][0];
+          if ($items = field_get_items('node', $node, 'body', $language_code)) {
             $column = ($name == 'body') ? 'value' : 'summary';
             $instance = field_info_instance('node', 'body', $node->type);
-            $replacements[$original] = $sanitize ? _text_sanitize($instance, $node->language, $item, $column) : $item[$column];
+            $field_langcode = field_language('node', $node, 'body', $language_code);
+            $replacements[$original] = $sanitize ? _text_sanitize($instance, $field_langcode, $items[0], $column) : $items[0][$column];
           }
           break;
 
@@ -157,8 +157,9 @@ function node_tokens($type, $tokens, array $data = array(), array $options = arr
 
         // Default values for the chained tokens handled below.
         case 'author':
-          $name = ($node->uid == 0) ? variable_get('anonymous', t('Anonymous')) : $node->name;
-          $replacements[$original] = $sanitize ? filter_xss($name) : $name;
+          $account = user_load($node->uid);
+          $name = format_username($account);
+          $replacements[$original] = $sanitize ? check_plain($name) : $name;
           break;
 
         case 'created':
diff --git a/modules/node/tests/node_access_test.info b/modules/node/tests/node_access_test.info
index ee4b44ff64be2cde4ae3d39dfa5db702219b85ea..3abd27e0cf1face2b70926598bb9dad15e521d35 100644
--- a/modules/node/tests/node_access_test.info
+++ b/modules/node/tests/node_access_test.info
@@ -5,8 +5,8 @@ version = VERSION
 core = 7.x
 hidden = TRUE
 
-; Information added by drupal.org packaging script on 2011-08-31
-version = "7.8"
+; Information added by drupal.org packaging script on 2011-10-26
+version = "7.9"
 project = "drupal"
-datestamp = "1314817616"
+datestamp = "1319660730"
 
diff --git a/modules/node/tests/node_test.info b/modules/node/tests/node_test.info
index ce4932f40ad3ea354e302025fbb74fc77aaf69f6..dd0037144e9e074f6a06bbdfc33d93953a19b834 100644
--- a/modules/node/tests/node_test.info
+++ b/modules/node/tests/node_test.info
@@ -5,8 +5,8 @@ version = VERSION
 core = 7.x
 hidden = TRUE
 
-; Information added by drupal.org packaging script on 2011-08-31
-version = "7.8"
+; Information added by drupal.org packaging script on 2011-10-26
+version = "7.9"
 project = "drupal"
-datestamp = "1314817616"
+datestamp = "1319660730"
 
diff --git a/modules/node/tests/node_test_exception.info b/modules/node/tests/node_test_exception.info
index 01ee778c5febc3d631848040c97680700619747f..1e749f31b10106f6e1a2b5022eff48556bb48935 100644
--- a/modules/node/tests/node_test_exception.info
+++ b/modules/node/tests/node_test_exception.info
@@ -5,8 +5,8 @@ version = VERSION
 core = 7.x
 hidden = TRUE
 
-; Information added by drupal.org packaging script on 2011-08-31
-version = "7.8"
+; Information added by drupal.org packaging script on 2011-10-26
+version = "7.9"
 project = "drupal"
-datestamp = "1314817616"
+datestamp = "1319660730"
 
diff --git a/modules/openid/openid.api.php b/modules/openid/openid.api.php
index 11faa71efa897c8884acf1430efccf673be3f99d..5e3d15d94cbebdf89156be4665aa34e1bff5eb6b 100644
--- a/modules/openid/openid.api.php
+++ b/modules/openid/openid.api.php
@@ -49,8 +49,13 @@ function hook_openid_response($response, $account) {
  * Allow modules to declare OpenID discovery methods.
  *
  * The discovery function callbacks will be called in turn with an unique
- * parameter, the claimed identifier. They have to return an array of services,
- * in the same form returned by openid_discover().
+ * parameter, the claimed identifier. They have to return an associative array
+ * with array of services and claimed identifier in the same form as returned by
+ * openid_discover(). The resulting array must contain following keys:
+ *   - 'services' (required) an array of discovered services (including OpenID
+ *   version, endpoint URI, etc).
+ *   - 'claimed_id' (optional) new claimed identifer, found by following HTTP
+ *   redirects during the services discovery.
  *
  * The first discovery method that succeed (return at least one services) will
  * stop the discovery process.
@@ -58,6 +63,7 @@ function hook_openid_response($response, $account) {
  * @return
  *   An associative array which keys are the name of the discovery methods and
  *   values are function callbacks.
+ *
  * @see hook_openid_discovery_method_info_alter()
  */
 function hook_openid_discovery_method_info() {
diff --git a/modules/openid/openid.inc b/modules/openid/openid.inc
index 6945f34ed5a8a3a18de3cd7a1e0edf52c4fd9d3f..98af518c76598317324fb204921ec219cb3d0caa 100644
--- a/modules/openid/openid.inc
+++ b/modules/openid/openid.inc
@@ -89,7 +89,7 @@ function openid_redirect_http($url, $message) {
  */
 function openid_redirect($url, $message) {
   global $language;
-  
+
   $output = '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">' . "\n";
   $output .= '<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="' . $language->language . '" lang="' . $language->language . '">' . "\n";
   $output .= "<head>\n";
@@ -793,3 +793,77 @@ function _openid_math_powmod($x, $y, $z) {
       return bcpowmod($x, $y, $z);
   }
 }
+
+/**
+ * Provides transition for accounts with possibly invalid OpenID identifiers in authmap.
+ *
+ * This function provides a less safe but more unobtrusive procedure for users
+ * who cannot login with their OpenID identifiers. OpenID identifiers in the
+ * authmap could be incomplete due to invalid OpenID implementation in previous
+ * versions of Drupal (e.g. fragment part of the identifier could be missing).
+ * For more information see http://drupal.org/node/1120290.
+ *
+ * @param string $identity
+ *   The user's claimed OpenID identifier.
+ *
+ * @return
+ *   A fully-loaded user object if the user is found or FALSE if not found.
+ */
+function _openid_invalid_openid_transition($identity, $response) {
+  $account = FALSE;
+  $fallback_account = NULL;
+  $fallback_identity = $identity;
+
+  // Try to strip the fragment if it is present.
+  if (strpos($fallback_identity, '#') !== FALSE) {
+    $fallback_identity = preg_replace('/#.*/', '', $fallback_identity);
+    $fallback_account = user_external_load($fallback_identity);
+  }
+
+  // Try to replace https with http. OpenID providers often redirect
+  // from http to https, but Drupal didn't follow the redirect.
+  if (!$fallback_account && strpos($fallback_identity, 'https://') !== FALSE) {
+    $fallback_identity = str_replace('https://', 'http://', $fallback_identity);
+    $fallback_account = user_external_load($fallback_identity);
+  }
+
+  // Try to use original identifier.
+  if (!$fallback_account && isset($_SESSION['openid']['user_login_values']['openid_identifier'])) {
+    $fallback_identity = openid_normalize($_SESSION['openid']['user_login_values']['openid_identifier']);
+    $fallback_account = user_external_load($fallback_identity);
+  }
+
+  if ($fallback_account) {
+    // Try to extract e-mail address from Simple Registration (SREG) or
+    // Attribute Exchanges (AX) keys.
+    $email = '';
+    $sreg_values = openid_extract_namespace($response, OPENID_NS_SREG, 'sreg');
+    $ax_values = openid_extract_namespace($response, OPENID_NS_AX, 'ax');
+    if (!empty($sreg_values['email']) && valid_email_address($sreg_values['email'])) {
+      $email = $sreg_values['email'];
+    }
+    elseif ($ax_mail_values = openid_extract_ax_values($ax_values, array('http://axschema.org/contact/email', 'http://schema.openid.net/contact/email'))) {
+      $email = current($ax_mail_values);
+    }
+
+    // If this e-mail address is the same as the e-mail address found in user
+    // account, login the user and update the claimed identifier.
+    if ($email && ($email == $fallback_account->mail || $email == $fallback_account->init)) {
+      $query = db_insert('authmap')
+        ->fields(array(
+          'authname' => $identity,
+          'uid' => $fallback_account->uid,
+          'module' => 'openid',
+        ))
+        ->execute();
+      drupal_set_message(t('New OpenID identifier %identity was added as a replacement for invalid identifier %invalid_identity. To finish the invalid OpenID transition process, please go to your <a href="@openid_url">OpenID identities page</a> and remove the old identifier %invalid_identity.', array('%invalid_identity' => $fallback_identity, '%identity' => $identity, '@openid_url' => 'user/' . $fallback_account->uid . '/openid')));
+      // Set the account to the found one.
+      $account = $fallback_account;
+    }
+    else {
+      drupal_set_message(t('There is already an existing account associated with the OpenID identifier that you have provided. However, due to a bug in the previous version of the authentication system, we can\'t be sure that this account belongs to you. If you are new on this site, please continue registering the new user account. If you already have a registered account on this site associated with the provided OpenID identifier, please try to <a href="@url_password">reset the password</a> or contact the site administrator.', array('@url_password' => 'user/password')), 'warning');
+    }
+  }
+
+  return $account;
+}
diff --git a/modules/openid/openid.info b/modules/openid/openid.info
index 69ac0437d2092a775c6d655ab33cfa8ef9d07de6..40db56c8d5d8917ad57aa89e1faf3faa9552c40e 100644
--- a/modules/openid/openid.info
+++ b/modules/openid/openid.info
@@ -5,8 +5,8 @@ package = Core
 core = 7.x
 files[] = openid.test
 
-; Information added by drupal.org packaging script on 2011-08-31
-version = "7.8"
+; Information added by drupal.org packaging script on 2011-10-26
+version = "7.9"
 project = "drupal"
-datestamp = "1314817616"
+datestamp = "1319660730"
 
diff --git a/modules/openid/openid.js b/modules/openid/openid.js
index 1f204274689294ac9b898926f1b98e5d8e487e17..fdc97fa06be341af58986c15a6e7aae358216dc1 100644
--- a/modules/openid/openid.js
+++ b/modules/openid/openid.js
@@ -11,10 +11,10 @@ Drupal.behaviors.openid = {
       if (cookie) {
         $('#edit-openid-identifier').val(cookie);
       }
-      if ($('#edit-openid-identifier').val()) {
+      if ($('#edit-openid-identifier').val() || location.hash == '#openid-login') {
         $('#edit-openid-identifier').addClass('openid-processed');
         loginElements.hide();
-        // Use .css('display', 'block') instead of .show() to  Konqueror friendly.
+        // Use .css('display', 'block') instead of .show() to be Konqueror friendly.
         openidElements.css('display', 'block');
       }
     }
diff --git a/modules/openid/openid.module b/modules/openid/openid.module
index 7673de8864aeb8ce1218d1f42e200a1ace492c6a..f2847fc0d4e120f442e11ca3edb223f10307a766 100644
--- a/modules/openid/openid.module
+++ b/modules/openid/openid.module
@@ -146,11 +146,11 @@ function _openid_user_login_form_alter(&$form, &$form_state) {
 
   $items = array();
   $items[] = array(
-    'data' => l(t('Log in using OpenID'), '#'),
+    'data' => l(t('Log in using OpenID'), '#openid-login', array('external' => TRUE)),
     'class' => array('openid-link'),
   );
   $items[] = array(
-    'data' => l(t('Cancel OpenID login'), '#'),
+    'data' => l(t('Cancel OpenID login'), '#', array('external' => TRUE)),
     'class' => array('user-link'),
   );
 
@@ -256,16 +256,25 @@ function openid_login_validate($form, &$form_state) {
 function openid_begin($claimed_id, $return_to = '', $form_values = array()) {
   module_load_include('inc', 'openid');
 
+  $service = NULL;
   $claimed_id = openid_normalize($claimed_id);
+  $discovery = openid_discovery($claimed_id);
 
-  $services = openid_discovery($claimed_id);
-  $service = _openid_select_service($services);
+  if (!empty($discovery['services'])) {
+    $service = _openid_select_service($discovery['services']);
+  }
 
-  if (!$service) {
+  // Quit if the discovery result was empty or if we can't select any service.
+  if (!$discovery || !$service) {
     form_set_error('openid_identifier', t('Sorry, that is not a valid OpenID. Ensure you have spelled your ID correctly.'));
     return;
   }
 
+  // Set claimed id from discovery.
+  if (!empty($discovery['claimed_id'])) {
+    $claimed_id = $discovery['claimed_id'];
+  }
+
   // Store discovered information in the users' session so we don't have to rediscover.
   $_SESSION['openid']['service'] = $service;
   // Store the claimed id
@@ -341,18 +350,24 @@ function openid_complete($response = array()) {
             $response['openid.claimed_id'] = $service['claimed_id'];
           }
           elseif ($service['version'] == 2) {
-            $response['openid.claimed_id'] = openid_normalize($response['openid.claimed_id']);
+            // Returned Claimed Identifier could contain unique fragment
+            // identifier to allow identifier recycling so we need to preserve
+            // it in the response.
+            $response_claimed_id = openid_normalize($response['openid.claimed_id']);
+
             // OpenID Authentication, section 11.2:
             // If the returned Claimed Identifier is different from the one sent
             // to the OpenID Provider, we need to do discovery on the returned
             // identififer to make sure that the provider is authorized to
             // respond on behalf of this.
-            if ($response['openid.claimed_id'] != $claimed_id) {
-              $services = openid_discovery($response['openid.claimed_id']);
-              $uris = array();
-              foreach ($services as $discovered_service) {
-                if (in_array('http://specs.openid.net/auth/2.0/server', $discovered_service['types']) || in_array('http://specs.openid.net/auth/2.0/signon', $discovered_service['types'])) {
-                  $uris[] = $discovered_service['uri'];
+            if ($response_claimed_id != $claimed_id) {
+              $discovery = openid_discovery($response['openid.claimed_id']);
+              if ($discovery && !empty($discovery['services'])) {
+                $uris = array();
+                foreach ($discovery['services'] as $discovered_service) {
+                  if (in_array('http://specs.openid.net/auth/2.0/server', $discovered_service['types']) || in_array('http://specs.openid.net/auth/2.0/signon', $discovered_service['types'])) {
+                    $uris[] = $discovered_service['uri'];
+                  }
                 }
               }
               if (!in_array($service['uri'], $uris)) {
@@ -374,10 +389,21 @@ function openid_complete($response = array()) {
 /**
  * Perform discovery on a claimed ID to determine the OpenID provider endpoint.
  *
- * @param $claimed_id The OpenID URL to perform discovery on.
+ * Discovery methods are provided by the hook_openid_discovery_method_info and
+ * could be further altered using the hook_openid_discovery_method_info_alter.
  *
- * @return Array of services discovered (including OpenID version, endpoint
- * URI, etc).
+ * @param $claimed_id
+ *   The OpenID URL to perform discovery on.
+ *
+ * @return
+ *   The resulting discovery array from the first successful discovery method,
+ *   which must contain following keys:
+ *   - 'services' (required) an array of discovered services (including OpenID
+ *   version, endpoint URI, etc).
+ *   - 'claimed_id' (optional) new claimed identifer, found by following HTTP
+ *   redirects during the services discovery.
+ *   If all the discovery method fails or if no appropriate discovery method is
+ *   found, FALSE is returned.
  */
 function openid_discovery($claimed_id) {
   module_load_include('inc', 'openid');
@@ -385,15 +411,15 @@ function openid_discovery($claimed_id) {
   $methods = module_invoke_all('openid_discovery_method_info');
   drupal_alter('openid_discovery_method_info', $methods);
 
-  // Execute each method in turn.
+  // Execute each method in turn and return first successful discovery.
   foreach ($methods as $method) {
-    $discovered_services = $method($claimed_id);
-    if (!empty($discovered_services)) {
-      return $discovered_services;
+    $discovery = $method($claimed_id);
+    if (!empty($discovery)) {
+      return $discovery;
     }
   }
 
-  return array();
+  return FALSE;
 }
 
 /**
@@ -417,24 +443,33 @@ function openid_openid_discovery_method_info() {
  *
  * @see http://openid.net/specs/openid-authentication-2_0.html#discovery
  * @see hook_openid_discovery_method_info()
+ * @see openid_discovery()
+ *
+ * @return
+ *   An array of discovered services and claimed identifier or NULL. See
+ *   openid_discovery() for more specific information.
  */
 function _openid_xri_discovery($claimed_id) {
   if (_openid_is_xri($claimed_id)) {
     // Resolve XRI using a proxy resolver (Extensible Resource Identifier (XRI)
     // Resolution Version 2.0, section 11.2 and 14.3).
     $xrds_url = variable_get('xri_proxy_resolver', 'http://xri.net/') . rawurlencode($claimed_id) . '?_xrd_r=application/xrds+xml';
-    $services = _openid_xrds_discovery($xrds_url);
-    foreach ($services as $i => &$service) {
-      $status = $service['xrd']->children(OPENID_NS_XRD)->Status;
-      if ($status && $status->attributes()->cid == 'verified') {
-        $service['claimed_id'] = openid_normalize((string)$service['xrd']->children(OPENID_NS_XRD)->CanonicalID);
+    $discovery = _openid_xrds_discovery($xrds_url);
+    if (!empty($discovery['services']) && is_array($discovery['services'])) {
+      foreach ($discovery['services'] as $i => &$service) {
+        $status = $service['xrd']->children(OPENID_NS_XRD)->Status;
+        if ($status && $status->attributes()->cid == 'verified') {
+          $service['claimed_id'] = openid_normalize((string)$service['xrd']->children(OPENID_NS_XRD)->CanonicalID);
+        }
+        else {
+          // Ignore service if the Canonical ID could not be verified.
+          unset($discovery['services'][$i]);
+        }
       }
-      else {
-        // Ignore service if CanonicalID could not be verified.
-        unset($services[$i]);
+      if (!empty($discovery['services'])) {
+        return $discovery;
       }
     }
-    return $services;
   }
 }
 
@@ -443,6 +478,11 @@ function _openid_xri_discovery($claimed_id) {
  *
  * @see http://openid.net/specs/openid-authentication-2_0.html#discovery
  * @see hook_openid_discovery_method_info()
+ * @see openid_discovery()
+ *
+ * @return
+ *   An array of discovered services and claimed identifier or NULL. See
+ *   openid_discovery() for more specific information.
  */
 function _openid_xrds_discovery($claimed_id) {
   $services = array();
@@ -454,7 +494,18 @@ function _openid_xrds_discovery($claimed_id) {
     $headers = array('Accept' => 'application/xrds+xml');
     $result = drupal_http_request($xrds_url, array('headers' => $headers));
 
-    if (!isset($result->error)) {
+    // Check for HTTP error and make sure, that we reach the target. If the
+    // maximum allowed redirects are exhausted, final destination URL isn't
+    // reached, but drupal_http_request() doesn't return any error.
+    // @todo Remove the check for 200 HTTP result code after the following issue
+    // will be fixed: http://drupal.org/node/1096890.
+    if (!isset($result->error) && $result->code == 200) {
+
+      // Replace the user-entered claimed_id if we received a redirect.
+      if (!empty($result->redirect_url)) {
+        $claimed_id = openid_normalize($result->redirect_url);
+      }
+
       if (isset($result->headers['content-type']) && preg_match("/application\/xrds\+xml/", $result->headers['content-type'])) {
         // Parse XML document to find URL
         $services = _openid_xrds_parse($result->data);
@@ -500,7 +551,13 @@ function _openid_xrds_discovery($claimed_id) {
       }
     }
   }
-  return $services;
+
+  if (!empty($services)) {
+    return array(
+      'services' => $services,
+      'claimed_id' => $claimed_id,
+    );
+  }
 }
 
 /**
@@ -589,8 +646,15 @@ function openid_association($op_endpoint) {
  */
 function openid_authentication($response) {
   $identity = $response['openid.claimed_id'];
-
   $account = user_external_load($identity);
+
+  // Tries to load user account if user_external_load fails due to possibly
+  // incompletely stored OpenID identifier in the authmap.
+  if (!isset($account->uid) && variable_get('openid_less_obtrusive_transition', FALSE)) {
+    module_load_include('inc', 'openid');
+    $account = _openid_invalid_openid_transition($identity, $response);
+  }
+
   if (isset($account->uid)) {
     if (!variable_get('user_email_verification', TRUE) || $account->login) {
       // Check if user is blocked.
@@ -634,7 +698,7 @@ function openid_authentication($response) {
       drupal_set_message(t('Account registration using the information provided by your OpenID provider failed due to the reasons listed below. Complete the registration by filling out the form below. If you already have an account, you can <a href="@login">log in</a> now and add your OpenID under "My account".', array('@login' => url('user/login'))), 'warning');
       // Append form validation errors below the above warning.
       foreach ($messages['error'] as $message) {
-        drupal_set_message( $message, 'error');
+        drupal_set_message($message, 'error');
       }
     }
 
diff --git a/modules/openid/openid.test b/modules/openid/openid.test
index 202a8355ea2aa1a1459d69d17f98d1bc5af2eb2c..afb9068c6bc6072c3efa25321680acebd266524a 100644
--- a/modules/openid/openid.test
+++ b/modules/openid/openid.test
@@ -89,12 +89,12 @@ class OpenIDFunctionalTestCase extends OpenIDWebTestCase {
     // Identifier is the URL of an XRDS document containing an OP Identifier
     // Element. The Relying Party sends the special value
     // "http://specs.openid.net/auth/2.0/identifier_select" as Claimed
-    // Identifier. The OpenID Provider responds with the actual identifier.
-    $identity = url('openid-test/yadis/xrds/dummy-user', array('absolute' => TRUE));
-    // Tell openid_test.module to respond with this identifier. The URL scheme
-    // is stripped in order to test that the returned identifier is normalized in
-    // openid_complete().
-    variable_set('openid_test_response', array('openid.claimed_id' => preg_replace('@^https?://@', '', $identity)));
+    // Identifier. The OpenID Provider responds with the actual identifier
+    // including the fragment.
+    $identity = url('openid-test/yadis/xrds/dummy-user', array('absolute' => TRUE, 'fragment' => $this->randomName()));
+    // Tell openid_test.module to respond with this identifier. We test if
+    // openid_complete() processes it right.
+    variable_set('openid_test_response', array('openid.claimed_id' => $identity));
     $this->addIdentity(url('openid-test/yadis/xrds/server', array('absolute' => TRUE)), 2, 'http://specs.openid.net/auth/2.0/identifier_select', $identity);
     variable_set('openid_test_response', array());
 
@@ -124,6 +124,28 @@ class OpenIDFunctionalTestCase extends OpenIDWebTestCase {
 
     // OpenID Authentication 2.0, section 7.3.3:
     $this->addIdentity(url('openid-test/html/openid2', array('absolute' => TRUE)), 2, 'http://example.com/html-openid2');
+
+    // OpenID Authentication 2.0, section 7.2.4:
+    // URL Identifiers MUST then be further normalized by both (1) following
+    // redirects when retrieving their content and finally (2) applying the
+    // rules in Section 6 of RFC3986 to the final destination URL. This final
+    // URL MUST be noted by the Relying Party as the Claimed Identifier and be
+    // used when requesting authentication.
+
+    // Single redirect.
+    $identity = $expected_claimed_id = url('openid-test/redirected/yadis/xrds/1', array('absolute' => TRUE));
+    $this->addRedirectedIdentity($identity, 2, 'http://example.com/xrds', $expected_claimed_id, 0);
+
+    // Exact 3 redirects (default value for the 'max_redirects' option in
+    // drupal_http_request()).
+    $identity = $expected_claimed_id = url('openid-test/redirected/yadis/xrds/2', array('absolute' => TRUE));
+    $this->addRedirectedIdentity($identity, 2, 'http://example.com/xrds', $expected_claimed_id, 2);
+
+    // Fails because there are more than 3 redirects (default value for the
+    // 'max_redirects' option in drupal_http_request()).
+    $identity = url('openid-test/redirected/yadis/xrds/3', array('absolute' => TRUE));
+    $expected_claimed_id = FALSE;
+    $this->addRedirectedIdentity($identity, 2, 'http://example.com/xrds', $expected_claimed_id, 3);
   }
 
   /**
@@ -279,6 +301,41 @@ class OpenIDFunctionalTestCase extends OpenIDWebTestCase {
     $this->assertRaw(t('Successfully added %identity', array('%identity' => $claimed_id)), t('Identity %identity was added.', array('%identity' => $identity)));
   }
 
+  /**
+   * Add OpenID identity, changed by the following redirects, to user's profile.
+   *
+   * According to OpenID Authentication 2.0, section 7.2.4, URL Identifiers MUST
+   * be further normalized by following redirects when retrieving their content
+   * and this final URL MUST be noted by the Relying Party as the Claimed
+   * Identifier and be used when requesting authentication.
+   *
+   * @param $identity
+   *   The User-supplied Identifier.
+   * @param $version
+   *   The protocol version used by the service.
+   * @param $local_id
+   *   The expected OP-Local Identifier found during discovery.
+   * @param $claimed_id
+   *   The expected Claimed Identifier returned by the OpenID Provider, or FALSE
+   *   if the discovery is expected to fail.
+   * @param $redirects
+   *   The number of redirects.
+   */
+  function addRedirectedIdentity($identity, $version = 2, $local_id = 'http://example.com/xrds', $claimed_id = NULL, $redirects = 0) {
+    // Set the final destination URL which is the same as the Claimed
+    // Identifier, we insert the same identifier also to the provider response,
+    // but provider could further change the Claimed ID actually (e.g. it could
+    // add unique fragment).
+    variable_set('openid_test_redirect_url', $identity);
+    variable_set('openid_test_response', array('openid.claimed_id' => $identity));
+
+    $this->addIdentity(url('openid-test/redirect/' . $redirects, array('absolute' => TRUE)), $version, $local_id, $claimed_id);
+
+    // Clean up.
+    variable_del('openid_test_redirect_url');
+    variable_del('openid_test_response');
+  }
+
   /**
    * Tests that openid.signed is verified.
    */
@@ -478,6 +535,89 @@ class OpenIDRegistrationTestCase extends OpenIDWebTestCase {
   }
 }
 
+/**
+ * Test account registration using Simple Registration and Attribute Exchange.
+ */
+class OpenIDInvalidIdentifierTransitionTestCase extends OpenIDFunctionalTestCase  {
+
+  public static function getInfo() {
+    return array(
+      'name' => 'OpenID account update',
+      'description' => 'Tries to correct OpenID identifiers attached to accounts if their identifiers were stripped.',
+      'group' => 'OpenID',
+    );
+  }
+
+  function setUp() {
+    parent::setUp('openid', 'openid_test');
+    variable_set('user_register', USER_REGISTER_VISITORS);
+    variable_set('openid_less_obtrusive_transition', TRUE);
+  }
+
+  /**
+   * Test OpenID transition with e-mail mismatch.
+   */
+  function testStrippedFragmentAccountEmailMismatch() {
+    $this->drupalLogin($this->web_user);
+
+    // Use a User-supplied Identity that is the URL of an XRDS document.
+    $identity = url('openid-test/yadis/xrds', array('absolute' => TRUE, 'fragment' => $this->randomName()));
+    $identity_stripped = preg_replace('/#.*/', '', $identity);
+
+    // Add invalid identifier to the authmap (identifier has stripped fragment).
+    $this->addIdentity($identity_stripped);
+    $this->drupalLogout();
+
+    // Test logging in via the login form, provider will respond with full
+    // identifier (including fragment) but with different email, so we can't
+    // provide auto-update.
+    variable_set('openid_test_response', array(
+      'openid.claimed_id' => $identity,
+      'openid.sreg.nickname' => $this->web_user->name,
+      'openid.sreg.email' => 'invalid-' . $this->web_user->mail));
+
+    $edit = array('openid_identifier' => $identity_stripped);
+    $this->submitLoginForm($identity_stripped);
+
+    // Verify user was redirected away from user login to an accessible page.
+    $this->assertResponse(200);
+
+    // Verify the message.
+    $this->assertRaw(t('There is already an existing account associated with the OpenID identifier that you have provided.'), t('Message that OpenID identifier must be updated manually was displayed.'));
+  }
+
+  /**
+   * Test OpenID auto transition with e-mail.
+   */
+  function testStrippedFragmentAccountAutoUpdateSreg() {
+    $this->drupalLogin($this->web_user);
+
+    // Use a User-supplied Identity that is the URL of an XRDS document.
+    $identity = url('openid-test/yadis/xrds', array('absolute' => TRUE, 'fragment' => $this->randomName()));
+    $identity_stripped = preg_replace('/#.*/', '', $identity);
+
+    // Add invalid identifier to the authmap (identifier has stripped fragment).
+    $this->addIdentity($identity_stripped);
+    $this->drupalLogout();
+
+    // Test logging in via the login form, provider will respond with full
+    // identifier (including fragment) but with different email, so we can't
+    // provide auto-update.
+    variable_set('openid_test_response', array(
+      'openid.claimed_id' => $identity,
+      'openid.sreg.nickname' => $this->web_user->name,
+      'openid.sreg.email' => $this->web_user->mail));
+
+    $this->submitLoginForm($identity_stripped);
+
+    // Verify user was redirected away from user login to an accessible page.
+    $this->assertResponse(200);
+
+    // Verify the message.
+    $this->assertRaw(t('New OpenID identifier %identity was added as a replacement for invalid identifier %invalid_identity.', array('%invalid_identity' => $identity_stripped, '%identity' => $identity)), t('Message that OpenID identifier was added automatically was displayed.'));
+  }
+}
+
 /**
  * Test internal helper functions.
  */
diff --git a/modules/openid/tests/openid_test.info b/modules/openid/tests/openid_test.info
index 08876947f9dd16db3f505b97f98e2e59a36697be..6f5852a01f5d691ac3d56d6f1f3a8af11127082f 100644
--- a/modules/openid/tests/openid_test.info
+++ b/modules/openid/tests/openid_test.info
@@ -6,8 +6,8 @@ core = 7.x
 dependencies[] = openid
 hidden = TRUE
 
-; Information added by drupal.org packaging script on 2011-08-31
-version = "7.8"
+; Information added by drupal.org packaging script on 2011-10-26
+version = "7.9"
 project = "drupal"
-datestamp = "1314817616"
+datestamp = "1319660730"
 
diff --git a/modules/openid/tests/openid_test.module b/modules/openid/tests/openid_test.module
index bad1184a311a07c70228fe2d3b99f55f2e01fa12..629dcd3356a59023591f2be7518f64e6ba69d65d 100644
--- a/modules/openid/tests/openid_test.module
+++ b/modules/openid/tests/openid_test.module
@@ -60,6 +60,19 @@ function openid_test_menu() {
     'access callback' => TRUE,
     'type' => MENU_CALLBACK,
   );
+  $items['openid-test/redirect'] = array(
+    'title' => 'OpenID Provider Redirection Point',
+    'page callback' => 'openid_test_redirect',
+    'access callback' => TRUE,
+    'type' => MENU_CALLBACK,
+  );
+  $items['openid-test/redirected/%/%'] = array(
+    'title' => 'OpenID Provider Final URL',
+    'page callback' => 'openid_test_redirected_method',
+    'page arguments' => array(2, 3),
+    'access callback' => TRUE,
+    'type' => MENU_CALLBACK,
+  );
   return $items;
 }
 
@@ -212,6 +225,28 @@ function openid_test_endpoint() {
   }
 }
 
+/**
+ * Menu callback; redirect during Normalization/Discovery.
+ */
+function openid_test_redirect($count = 0) {
+  if ($count == 0) {
+    $url = variable_get('openid_test_redirect_url', '');
+  }
+  else {
+    $url = url('openid-test/redirect/' . --$count, array('absolute' => TRUE));
+  }
+  $http_response_code = variable_get('openid_test_redirect_http_reponse_code', 301);
+  header('Location: ' . $url, TRUE, $http_response_code);
+  exit();
+}
+
+/**
+ * Menu callback; respond with appropriate callback.
+ */
+function openid_test_redirected_method($method1, $method2) {
+  return call_user_func('openid_test_' . $method1 . '_' . $method2);
+}
+
 /**
  * OpenID endpoint; handle "associate" requests (see OpenID Authentication 2.0,
  * section 8).
diff --git a/modules/overlay/overlay-child.css b/modules/overlay/overlay-child.css
index d31952e594d515310b83812dc6f87685b676397e..a2b23b462dd96a130ce345f1fb2d743364985664 100644
--- a/modules/overlay/overlay-child.css
+++ b/modules/overlay/overlay-child.css
@@ -17,6 +17,7 @@ html.js body {
   min-width: 700px;
   position: relative;
   padding: .2em;
+  padding-bottom: 2em;
   padding-right: 26px; /* LTR */
   width: 88%;
 }
diff --git a/modules/overlay/overlay.api.php b/modules/overlay/overlay.api.php
index c763d1f5b9bf684a9d9b315453c888f6bb0e713d..bc23546df7ed8c629ff68dc9126abdc1056a83c1 100644
--- a/modules/overlay/overlay.api.php
+++ b/modules/overlay/overlay.api.php
@@ -15,7 +15,7 @@
  *
  * The parent window is initialized when a page is displayed in which the
  * overlay might be required to be displayed, so modules can act here if they
- * need to take action to accomodate the possibility of the overlay appearing
+ * need to take action to accommodate the possibility of the overlay appearing
  * within a Drupal page.
  */
 function hook_overlay_parent_initialize() {
diff --git a/modules/overlay/overlay.info b/modules/overlay/overlay.info
index 34149bc95ff300643f2a773c822777b99b933441..1dd2ac164f92db7d3946941c0e34fd0cf8c9eb2a 100644
--- a/modules/overlay/overlay.info
+++ b/modules/overlay/overlay.info
@@ -4,8 +4,8 @@ package = Core
 version = VERSION
 core = 7.x
 
-; Information added by drupal.org packaging script on 2011-08-31
-version = "7.8"
+; Information added by drupal.org packaging script on 2011-10-26
+version = "7.9"
 project = "drupal"
-datestamp = "1314817616"
+datestamp = "1319660730"
 
diff --git a/modules/path/path.info b/modules/path/path.info
index 65875a6fefecca7330784c12ca4e0f52b8ae77c9..fda8f6c64c62f01846baa27a6703e8fe2842e461 100644
--- a/modules/path/path.info
+++ b/modules/path/path.info
@@ -6,8 +6,8 @@ core = 7.x
 files[] = path.test
 configure = admin/config/search/path
 
-; Information added by drupal.org packaging script on 2011-08-31
-version = "7.8"
+; Information added by drupal.org packaging script on 2011-10-26
+version = "7.9"
 project = "drupal"
-datestamp = "1314817616"
+datestamp = "1319660730"
 
diff --git a/modules/php/php.info b/modules/php/php.info
index d837f15ef1b7310381e3013518b10bcc2876fd84..34e5abc75f15657453b6251c537639bd0528ebe1 100644
--- a/modules/php/php.info
+++ b/modules/php/php.info
@@ -5,8 +5,8 @@ version = VERSION
 core = 7.x
 files[] = php.test
 
-; Information added by drupal.org packaging script on 2011-08-31
-version = "7.8"
+; Information added by drupal.org packaging script on 2011-10-26
+version = "7.9"
 project = "drupal"
-datestamp = "1314817616"
+datestamp = "1319660730"
 
diff --git a/modules/poll/poll.info b/modules/poll/poll.info
index 0d9de28089df1372e46cc7b842775ce60c01d077..72428a9f66fed24f4c2ed82eb4021b93226f4fb5 100644
--- a/modules/poll/poll.info
+++ b/modules/poll/poll.info
@@ -6,8 +6,8 @@ core = 7.x
 files[] = poll.test
 stylesheets[all][] = poll.css
 
-; Information added by drupal.org packaging script on 2011-08-31
-version = "7.8"
+; Information added by drupal.org packaging script on 2011-10-26
+version = "7.9"
 project = "drupal"
-datestamp = "1314817616"
+datestamp = "1319660730"
 
diff --git a/modules/poll/poll.module b/modules/poll/poll.module
index 2737c2bd8dde405730571b4fa4d3ec96dea43559..13d2606de838f93078d9ee0c82432fda8efa1cc1 100644
--- a/modules/poll/poll.module
+++ b/modules/poll/poll.module
@@ -299,7 +299,9 @@ function poll_form($node, &$form_state) {
   $form['choice_wrapper']['poll_more'] = array(
     '#type' => 'submit',
     '#value' => t('More choices'),
-    '#description' => t("If the amount of boxes above isn't enough, click here to add more choices."),
+    '#attributes' => array(
+      'title' => t("If the amount of boxes above isn't enough, click here to add more choices."),
+    ),
     '#weight' => 1,
     '#limit_validation_errors' => array(array('choice')),
     '#submit' => array('poll_more_choices_submit'),
diff --git a/modules/profile/profile-block.tpl.php b/modules/profile/profile-block.tpl.php
index 0bd8331486d7882a824c2824b0193b76885acbcd..dbdbcd84e4e1f337fdbd6aa0eccc6fea92d7f890 100644
--- a/modules/profile/profile-block.tpl.php
+++ b/modules/profile/profile-block.tpl.php
@@ -31,9 +31,9 @@
 ?>
 <?php print $user_picture; ?>
 
-<?php foreach ($profile as $field) : ?>
+<?php foreach ($profile as $field): ?>
   <p>
-    <?php if ($field->type != 'checkbox') : ?>
+    <?php if ($field->type != 'checkbox'): ?>
       <strong><?php print $field->title; ?></strong><br />
     <?php endif; ?>
     <?php print $field->value; ?>
diff --git a/modules/profile/profile-listing.tpl.php b/modules/profile/profile-listing.tpl.php
index d484ed26bec4a719ec059a6f2c479787abe774d7..d8b835af3696b13f67f992fdf80a301782a7cb6f 100644
--- a/modules/profile/profile-listing.tpl.php
+++ b/modules/profile/profile-listing.tpl.php
@@ -43,7 +43,7 @@
     <?php print $name; ?>
   </div>
 
-  <?php foreach ($profile as $field) : ?>
+  <?php foreach ($profile as $field): ?>
     <div class="field">
       <?php print $field->value; ?>
     </div>
diff --git a/modules/profile/profile.info b/modules/profile/profile.info
index 1209ee57ff3e2e167aad095b92b6853ef6209c17..121271c7ac02a16112bc777821e1467fa8d7f291 100644
--- a/modules/profile/profile.info
+++ b/modules/profile/profile.info
@@ -11,8 +11,8 @@ configure = admin/config/people/profile
 ; See user_system_info_alter().
 hidden = TRUE
 
-; Information added by drupal.org packaging script on 2011-08-31
-version = "7.8"
+; Information added by drupal.org packaging script on 2011-10-26
+version = "7.9"
 project = "drupal"
-datestamp = "1314817616"
+datestamp = "1319660730"
 
diff --git a/modules/profile/profile.test b/modules/profile/profile.test
index 83bed25a5840cd8bc1144751f128ee0b970c5652..09123d8c583543906aa12ec7bef8901b7e1e14d3 100644
--- a/modules/profile/profile.test
+++ b/modules/profile/profile.test
@@ -399,7 +399,7 @@ class ProfileBlockTestCase extends ProfileTestCase {
   }
 
   function testAuthorInformationBlock() {
-    // Set the block to a region to confirm the block is availble.
+    // Set the block to a region to confirm the block is available.
     $edit = array();
     $edit['blocks[profile_author-information][region]'] = 'footer';
     $this->drupalPost('admin/structure/block', $edit, t('Save blocks'));
diff --git a/modules/rdf/rdf.info b/modules/rdf/rdf.info
index 618998cc3aba7c67c65d0c9db8ff10d11986b0bb..b3d79cb52b8378598a39cce1b802e8242d00a36a 100644
--- a/modules/rdf/rdf.info
+++ b/modules/rdf/rdf.info
@@ -5,8 +5,8 @@ version = VERSION
 core = 7.x
 files[] = rdf.test
 
-; Information added by drupal.org packaging script on 2011-08-31
-version = "7.8"
+; Information added by drupal.org packaging script on 2011-10-26
+version = "7.9"
 project = "drupal"
-datestamp = "1314817616"
+datestamp = "1319660730"
 
diff --git a/modules/rdf/tests/rdf_test.info b/modules/rdf/tests/rdf_test.info
index 137e914381d62948dec1d72afa1127a2b0466449..8457cf5b64ad27d800f38ed65515498e2ab2a10d 100644
--- a/modules/rdf/tests/rdf_test.info
+++ b/modules/rdf/tests/rdf_test.info
@@ -5,8 +5,8 @@ version = VERSION
 core = 7.x
 hidden = TRUE
 
-; Information added by drupal.org packaging script on 2011-08-31
-version = "7.8"
+; Information added by drupal.org packaging script on 2011-10-26
+version = "7.9"
 project = "drupal"
-datestamp = "1314817616"
+datestamp = "1319660730"
 
diff --git a/modules/search/search-block-form.tpl.php b/modules/search/search-block-form.tpl.php
index 78447463c6f9119fcc804e7bf56b5412e551ce0d..da58403c2c4709e7b9d30cd25220f36a026a553d 100644
--- a/modules/search/search-block-form.tpl.php
+++ b/modules/search/search-block-form.tpl.php
@@ -30,7 +30,7 @@
  */
 ?>
 <div class="container-inline">
-  <?php if (empty($variables['form']['#block']->subject)) : ?>
+  <?php if (empty($variables['form']['#block']->subject)): ?>
     <h2 class="element-invisible"><?php print t('Search form'); ?></h2>
   <?php endif; ?>
   <?php print $search_form; ?>
diff --git a/modules/search/search-result.tpl.php b/modules/search/search-result.tpl.php
index db9f2202fc2300e096c5353137c64f07c075d09d..949452ac34cb53cfd3127c06e023cd9e3af59aac 100644
--- a/modules/search/search-result.tpl.php
+++ b/modules/search/search-result.tpl.php
@@ -45,7 +45,7 @@
  * for its existence before printing. The default keys of 'type', 'user' and
  * 'date' always exist for node searches. Modules may provide other data.
  * @code
- *   <?php if (isset($info_split['comment'])) : ?>
+ *   <?php if (isset($info_split['comment'])): ?>
  *     <span class="info-comment">
  *       <?php print $info_split['comment']; ?>
  *     </span>
@@ -69,10 +69,10 @@
   </h3>
   <?php print render($title_suffix); ?>
   <div class="search-snippet-info">
-    <?php if ($snippet) : ?>
+    <?php if ($snippet): ?>
       <p class="search-snippet"<?php print $content_attributes; ?>><?php print $snippet; ?></p>
     <?php endif; ?>
-    <?php if ($info) : ?>
+    <?php if ($info): ?>
       <p class="search-info"><?php print $info; ?></p>
     <?php endif; ?>
   </div>
diff --git a/modules/search/search-results.tpl.php b/modules/search/search-results.tpl.php
index 4de724bec1966147ca159dc4f9fb25771c5ec190..e35be1edcfaaeffad733a0449de8ba79b0efb8b2 100644
--- a/modules/search/search-results.tpl.php
+++ b/modules/search/search-results.tpl.php
@@ -21,7 +21,7 @@
  * @see template_preprocess_search_results()
  */
 ?>
-<?php if ($search_results) : ?>
+<?php if ($search_results): ?>
   <h2><?php print t('Search results');?></h2>
   <ol class="search-results <?php print $module; ?>-results">
     <?php print $search_results; ?>
diff --git a/modules/search/search.admin.inc b/modules/search/search.admin.inc
index d93c85288329b67eadfb2279fa8dab1e45316dca..fda14ee7b6a312cdb4f281ecd47cb6f9ca44cbc2 100644
--- a/modules/search/search.admin.inc
+++ b/modules/search/search.admin.inc
@@ -10,7 +10,7 @@
  */
 function search_reindex_confirm() {
   return confirm_form(array(), t('Are you sure you want to re-index the site?'),
-                  'admin/config/search/settings', t(' The search index is not cleared but systematically updated to reflect the new settings. Searching will continue to work but new content won\'t be indexed until all existing content has been re-indexed. This action cannot be undone.'), t('Re-index site'), t('Cancel'));
+                  'admin/config/search/settings', t('The search index is not cleared but systematically updated to reflect the new settings. Searching will continue to work but new content won\'t be indexed until all existing content has been re-indexed. This action cannot be undone.'), t('Re-index site'), t('Cancel'));
 }
 
 /**
@@ -106,7 +106,7 @@ function search_admin_settings($form) {
 
   $form['active'] = array(
     '#type' => 'fieldset',
-    '#title' => t('Active search modules ')
+    '#title' => t('Active search modules')
   );
   $module_options = _search_get_module_names();
   $form['active']['search_active_modules'] = array(
diff --git a/modules/search/search.api.php b/modules/search/search.api.php
index 8d6e2399ffb91c4d1a9def9916420798be41ffb4..3f745bfdb0b95fe204fbdf16c6b28cc6f8e06616 100644
--- a/modules/search/search.api.php
+++ b/modules/search/search.api.php
@@ -172,7 +172,7 @@ function hook_search_admin() {
  * parameters to the search expression.
  *
  * See node_search_execute() for an example of a module that uses the search
- * index, and user_search_execute() for an example that doesn't ues the search
+ * index, and user_search_execute() for an example that doesn't use the search
  * index.
  *
  * @param $keys
diff --git a/modules/search/search.info b/modules/search/search.info
index cd930728e3568e00eb0b7dd4c3bd8470225cb220..52bc56179911b74a7a56c40fb33c9d8f2a2baa98 100644
--- a/modules/search/search.info
+++ b/modules/search/search.info
@@ -8,8 +8,8 @@ files[] = search.test
 configure = admin/config/search/settings
 stylesheets[all][] = search.css
 
-; Information added by drupal.org packaging script on 2011-08-31
-version = "7.8"
+; Information added by drupal.org packaging script on 2011-10-26
+version = "7.9"
 project = "drupal"
-datestamp = "1314817616"
+datestamp = "1319660730"
 
diff --git a/modules/search/search.test b/modules/search/search.test
index 488a45e804df010291edc57d8291a88baf3fc153..a6ed0dfee83dde4b15e8a8dce0e7d5d2c055f241 100644
--- a/modules/search/search.test
+++ b/modules/search/search.test
@@ -332,7 +332,7 @@ class SearchAdvancedSearchForm extends DrupalWebTestCase {
 
     // Assert that the dummy title doesn't equal the real title.
     $dummy_title = 'Lorem ipsum';
-    $this->assertNotEqual($dummy_title, $this->node->title, t("Dummy title doens't equal node title"));
+    $this->assertNotEqual($dummy_title, $this->node->title, t("Dummy title doesn't equal node title"));
 
     // Search for the dummy title with a GET query.
     $this->drupalGet('search/node/' . $dummy_title);
@@ -584,11 +584,11 @@ class SearchBlockTestCase extends DrupalWebTestCase {
   }
 
   function testSearchFormBlock() {
-    // Set block title to confirm that the interface is availble.
+    // Set block title to confirm that the interface is available.
     $this->drupalPost('admin/structure/block/manage/search/form/configure', array('title' => $this->randomName(8)), t('Save block'));
     $this->assertText(t('The block configuration has been saved.'), t('Block configuration set.'));
 
-    // Set the block to a region to confirm block is availble.
+    // Set the block to a region to confirm block is available.
     $edit = array();
     $edit['blocks[search_form][region]'] = 'footer';
     $this->drupalPost('admin/structure/block', $edit, t('Save blocks'));
diff --git a/modules/search/tests/search_embedded_form.info b/modules/search/tests/search_embedded_form.info
index 596e1f60c58dade350e3320058461d1ea3078db9..0ee98ce641acb6e8b0d3f773572dfc720d7a5856 100644
--- a/modules/search/tests/search_embedded_form.info
+++ b/modules/search/tests/search_embedded_form.info
@@ -5,8 +5,8 @@ version = VERSION
 core = 7.x
 hidden = TRUE
 
-; Information added by drupal.org packaging script on 2011-08-31
-version = "7.8"
+; Information added by drupal.org packaging script on 2011-10-26
+version = "7.9"
 project = "drupal"
-datestamp = "1314817616"
+datestamp = "1319660730"
 
diff --git a/modules/search/tests/search_extra_type.info b/modules/search/tests/search_extra_type.info
index d0188c9b6465119d9c593706a96a48dcb4bf2c6a..8fbfb7328f0ece6902981608d30aacc70647166b 100644
--- a/modules/search/tests/search_extra_type.info
+++ b/modules/search/tests/search_extra_type.info
@@ -5,8 +5,8 @@ version = VERSION
 core = 7.x
 hidden = TRUE
 
-; Information added by drupal.org packaging script on 2011-08-31
-version = "7.8"
+; Information added by drupal.org packaging script on 2011-10-26
+version = "7.9"
 project = "drupal"
-datestamp = "1314817616"
+datestamp = "1319660730"
 
diff --git a/modules/shortcut/shortcut.admin.inc b/modules/shortcut/shortcut.admin.inc
index 9735d376079a7e760793e36872a00db114fc1b30..91ce7c8373b482f1572cb8e3d5e5794c7040d98d 100644
--- a/modules/shortcut/shortcut.admin.inc
+++ b/modules/shortcut/shortcut.admin.inc
@@ -264,6 +264,7 @@ function shortcut_set_add_form_submit($form, &$form_state) {
  * @see shortcut_set_customize_submit()
  */
 function shortcut_set_customize($form, &$form_state, $shortcut_set) {
+  $form['#shortcut_set_name'] = $shortcut_set->set_name;
   $form['shortcuts'] = array(
     '#tree' => TRUE,
     '#weight' => -20,
@@ -299,7 +300,10 @@ function shortcut_set_customize($form, &$form_state, $shortcut_set) {
     'js' => array(drupal_get_path('module', 'shortcut') . '/shortcut.admin.js'),
   );
 
-  $form['actions'] = array('#type' => 'actions');
+  $form['actions'] = array(
+    '#type' => 'actions',
+    '#access' => !empty($shortcut_set->links),
+  );
   $form['actions']['submit'] = array(
     '#type' => 'submit',
     '#value' => t('Save changes'),
@@ -336,9 +340,15 @@ function shortcut_set_customize_submit($form, &$form_state) {
 function theme_shortcut_set_customize($variables) {
   $form = $variables['form'];
   $map = array('disabled' => t('Disabled'), 'enabled' => t('Enabled'));
+  $shortcuts_by_status = array(
+    'enabled' => element_children($form['shortcuts']['enabled']),
+    'disabled' => element_children($form['shortcuts']['disabled']),
+  );
+  // Do not add any rows to the table if there are no shortcuts to display.
+  $statuses = empty($shortcuts_by_status['enabled']) && empty($shortcuts_by_status['disabled']) ? array() : array_keys($shortcuts_by_status);
 
   $rows = array();
-  foreach (array('enabled', 'disabled') as $status) {
+  foreach ($statuses as $status) {
     drupal_add_tabledrag('shortcuts', 'match', 'sibling', 'shortcut-status-select');
     drupal_add_tabledrag('shortcuts', 'order', 'sibling', 'shortcut-weight');
     $rows[] = array(
@@ -349,7 +359,7 @@ function theme_shortcut_set_customize($variables) {
       'class' => array('shortcut-status', 'shortcut-status-' . $status),
     );
 
-    foreach (element_children($form['shortcuts'][$status]) as $key) {
+    foreach ($shortcuts_by_status[$status] as $key) {
       $shortcut = &$form['shortcuts'][$status][$key];
       $row = array();
       $row[] = drupal_render($shortcut['name']);
@@ -373,7 +383,7 @@ function theme_shortcut_set_customize($variables) {
           'class' => array('shortcut-slot-empty'),
         );
       }
-      $count_shortcuts = count(element_children($form['shortcuts'][$status]));
+      $count_shortcuts = count($shortcuts_by_status[$status]);
       if (!empty($count_shortcuts)) {
         for ($i = 0; $i < min($count_shortcuts, shortcut_max_slots()); $i++) {
           $rows['empty-' . $i]['class'][] = 'shortcut-slot-hidden';
@@ -383,7 +393,7 @@ function theme_shortcut_set_customize($variables) {
   }
 
   $header = array(t('Name'), t('Weight'), t('Status'), array('data' => t('Operations'), 'colspan' => 2));
-  $output = theme('table', array('header' => $header, 'rows' => $rows, 'attributes' => array('id' => 'shortcuts')));
+  $output = theme('table', array('header' => $header, 'rows' => $rows, 'attributes' => array('id' => 'shortcuts'), 'empty' => t('No shortcuts available. <a href="@link">Add a shortcut</a>.', array('@link' => url('admin/config/user-interface/shortcut/' . $form['#shortcut_set_name'] . '/add-link')))));
   $output .= drupal_render($form['actions']);
   $output = drupal_render_children($form) . $output;
   return $output;
@@ -472,6 +482,7 @@ function _shortcut_link_form_elements($shortcut_link = NULL) {
     '#size' => 40,
     '#maxlength' => 255,
     '#default_value' => $shortcut_link['link_title'],
+    '#required' => TRUE,
   );
 
   $form['shortcut_link']['link_path'] = array(
diff --git a/modules/shortcut/shortcut.info b/modules/shortcut/shortcut.info
index ae331e869323846cefe497fe691ae5d7eaf7849a..0c4a7baac91fe043efa5a7ad5191747d858ca5c2 100644
--- a/modules/shortcut/shortcut.info
+++ b/modules/shortcut/shortcut.info
@@ -6,8 +6,8 @@ core = 7.x
 files[] = shortcut.test
 configure = admin/config/user-interface/shortcut
 
-; Information added by drupal.org packaging script on 2011-08-31
-version = "7.8"
+; Information added by drupal.org packaging script on 2011-10-26
+version = "7.9"
 project = "drupal"
-datestamp = "1314817616"
+datestamp = "1319660730"
 
diff --git a/modules/shortcut/shortcut.module b/modules/shortcut/shortcut.module
index 8642d9de79939cf4248f4afa1b40409658e80df6..f8ddcc24facd257abec4eb3cc5cd54e67ea7db6c 100644
--- a/modules/shortcut/shortcut.module
+++ b/modules/shortcut/shortcut.module
@@ -643,7 +643,11 @@ function shortcut_renderable_links($shortcut_set = NULL) {
  * Implements hook_preprocess_page().
  */
 function shortcut_preprocess_page(&$variables) {
-  if (shortcut_set_edit_access()) {
+  // Only display the shortcut link if the user has the ability to edit
+  // shortcuts and if the page's actual content is being shown (for example,
+  // we do not want to display it on "access denied" or "page not found"
+  // pages).
+  if (shortcut_set_edit_access() && ($item = menu_get_item()) && $item['access']) {
     $link = $_GET['q'];
     $query_parameters = drupal_get_query_parameters();
     if (!empty($query_parameters)) {
diff --git a/modules/shortcut/shortcut.test b/modules/shortcut/shortcut.test
index 75a5a67bffb877d171a07f74a287341fadd2c260..322c63f1119b2e9fc2390440611514a039c787ee 100644
--- a/modules/shortcut/shortcut.test
+++ b/modules/shortcut/shortcut.test
@@ -197,6 +197,29 @@ class ShortcutLinksTestCase extends ShortcutTestCase {
     $mlids = $this->getShortcutInformation($saved_set, 'mlid');
     $this->assertFalse(in_array($set->links[0]['mlid'], $mlids), 'Successfully deleted a shortcut.');
   }
+
+  /**
+   * Tests that the add shortcut link is not displayed for 404/403 errors.
+   *
+   * Tests that the "Add to shortcuts" link is not displayed on a page not
+   * found or a page the user does not have access to.
+   */
+  function testNoShortcutLink() {
+    // Change to a theme that displays shortcuts.
+    variable_set('theme_default', 'seven');
+
+    $this->drupalGet('page-that-does-not-exist');
+    $this->assertNoRaw('add-shortcut', t('Add to shortcuts link was not shown on a page not found.'));
+
+    // The user does not have access to this path.
+    $this->drupalGet('admin/modules');
+    $this->assertNoRaw('add-shortcut', t('Add to shortcuts link was not shown on a page the user does not have access to.'));
+
+    // Verify that the testing mechanism works by verifying the shortcut
+    // link appears on admin/content/node.
+    $this->drupalGet('admin/content/node');
+    $this->assertRaw('add-shortcut', t('Add to shortcuts link was shown on a page the user does have access to.'));
+  }
 }
 
 /**
diff --git a/modules/simpletest/drupal_web_test_case.php b/modules/simpletest/drupal_web_test_case.php
index 5c39cfc11cd5c580c4f6fee70a8cfa2722122085..2b23a3bb47c788071e2e48cae9a729d6b3d66905 100644
--- a/modules/simpletest/drupal_web_test_case.php
+++ b/modules/simpletest/drupal_web_test_case.php
@@ -845,7 +845,7 @@ class DrupalWebTestCase extends DrupalTestCase {
   /**
    * Get a node from the database based on its title.
    *
-   * @param title
+   * @param $title
    *   A node title, usually generated by $this->randomName().
    * @param $reset
    *   (optional) Whether to reset the internal node_load() cache.
@@ -1446,7 +1446,7 @@ class DrupalWebTestCase extends DrupalTestCase {
   protected function tearDown() {
     global $user, $language;
 
-    // In case a fatal error occured that was not in the test process read the
+    // In case a fatal error occurred that was not in the test process read the
     // log to pick up any fatal errors.
     simpletest_log_read($this->testId, $this->databasePrefix, get_class($this), TRUE);
 
diff --git a/modules/simpletest/files/css_test_files/comment_hacks.css.unoptimized.css b/modules/simpletest/files/css_test_files/comment_hacks.css.unoptimized.css
index ff50eaeaf59e205a050e98cf7f6f70d428e4a455..c47e8429ac27c898d1711a849373e42c6111d2f7 100644
--- a/modules/simpletest/files/css_test_files/comment_hacks.css.unoptimized.css
+++ b/modules/simpletest/files/css_test_files/comment_hacks.css.unoptimized.css
@@ -4,7 +4,7 @@
 *
 */
 /*
-A large comment block to test for segfaults and speed. This is 60K a's. Extreme but usefull to demonstrate flaws in comment striping regexp. aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa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aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa*/
 .test1 { display:block;}
 
 /* A multiline IE-mac hack (v.2) taken fron Zen theme*/
diff --git a/modules/simpletest/simpletest.info b/modules/simpletest/simpletest.info
index 2d57b8d5255e8d489cb6f0596332bce702231047..d88baaecada853502023a9ee2ee682f84aaa71eb 100644
--- a/modules/simpletest/simpletest.info
+++ b/modules/simpletest/simpletest.info
@@ -49,8 +49,8 @@ files[] = tests/upgrade/upgrade.translatable.test
 files[] = tests/upgrade/upgrade.upload.test
 files[] = tests/upgrade/upgrade.user.test
 
-; Information added by drupal.org packaging script on 2011-08-31
-version = "7.8"
+; Information added by drupal.org packaging script on 2011-10-26
+version = "7.9"
 project = "drupal"
-datestamp = "1314817616"
+datestamp = "1319660730"
 
diff --git a/modules/simpletest/simpletest.module b/modules/simpletest/simpletest.module
index 586b23ae7d50fdcab439073ca4cd2d2889ffacb0..b820f530793073385e790c7d8bd782f2f72a892b 100644
--- a/modules/simpletest/simpletest.module
+++ b/modules/simpletest/simpletest.module
@@ -272,7 +272,7 @@ function simpletest_log_read($test_id, $prefix, $test_class, $during_test = FALS
         DrupalTestCase::insertAssert($test_id, $test_class, FALSE, $match[2], $match[1], $caller);
       }
       else {
-        // Unkown format, place the entire message in the log.
+        // Unknown format, place the entire message in the log.
         DrupalTestCase::insertAssert($test_id, $test_class, FALSE, $line, 'Fatal error');
       }
       $found = TRUE;
@@ -398,7 +398,7 @@ function simpletest_generate_file($filename, $width, $lines, $type = 'binary-tex
         break;
     }
   }
-  $text = wordwrap($text, $width - 1, "\n", TRUE) . "\n"; // Add \n for symetrical file.
+  $text = wordwrap($text, $width - 1, "\n", TRUE) . "\n"; // Add \n for symmetrical file.
 
   // Create filename.
   file_put_contents('public://' . $filename . '.txt', $text);
diff --git a/modules/simpletest/simpletest.pages.inc b/modules/simpletest/simpletest.pages.inc
index a39e8b792b49eb79cf17db132e2863059e5fcfb1..696d1471887b5c7b664865a23dc707377694df22 100644
--- a/modules/simpletest/simpletest.pages.inc
+++ b/modules/simpletest/simpletest.pages.inc
@@ -305,7 +305,7 @@ function simpletest_result_form($form, &$form_state, $test_id) {
   );
   $form['action']['filter']['#default_value'] = ($filter['fail'] ? 'fail' : 'all');
 
-  // Catagorized test classes for to be used with selected filter value.
+  // Categorized test classes for to be used with selected filter value.
   $form['action']['filter_pass'] = array(
     '#type' => 'hidden',
     '#default_value' => implode(',', $filter['pass']),
@@ -428,6 +428,9 @@ function simpletest_result_status_image($status) {
 
 /**
  * Provides settings form for SimpleTest variables.
+ *
+ * @ingroup forms
+ * @see simpletest_settings_form_validate()
  */
 function simpletest_settings_form($form, &$form_state) {
   $form['general'] = array(
@@ -467,16 +470,41 @@ function simpletest_settings_form($form, &$form_state) {
     ),
     '#default_value' => variable_get('simpletest_httpauth_method', CURLAUTH_BASIC),
   );
+  $username = variable_get('simpletest_httpauth_username');
+  $password = variable_get('simpletest_httpauth_password');
   $form['httpauth']['simpletest_httpauth_username'] = array(
     '#type' => 'textfield',
     '#title' => t('Username'),
-    '#default_value' => variable_get('simpletest_httpauth_username', ''),
+    '#default_value' => $username,
   );
+  if ($username && $password) {
+    $form['httpauth']['simpletest_httpauth_username']['#description'] = t('Leave this blank to delete both the existing username and password.');
+  }
   $form['httpauth']['simpletest_httpauth_password'] = array(
-    '#type' => 'textfield',
+    '#type' => 'password',
     '#title' => t('Password'),
-    '#default_value' => variable_get('simpletest_httpauth_password', ''),
   );
+  if ($password) {
+    $form['httpauth']['simpletest_httpauth_password']['#description'] = t('To change the password, enter the new password here.');
+  }
 
   return system_settings_form($form);
 }
+
+/**
+ * Validation handler for simpletest_settings_form().
+ */
+function simpletest_settings_form_validate($form, &$form_state) {
+  // If a username was provided but a password wasn't, preserve the existing
+  // password.
+  if (!empty($form_state['values']['simpletest_httpauth_username']) && empty($form_state['values']['simpletest_httpauth_password'])) {
+    $form_state['values']['simpletest_httpauth_password'] = variable_get('simpletest_httpauth_password', '');
+  }
+
+  // If a password was provided but a username wasn't, the credentials are
+  // incorrect, so throw an error.
+  if (empty($form_state['values']['simpletest_httpauth_username']) && !empty($form_state['values']['simpletest_httpauth_password'])) {
+    form_set_error('simpletest_httpauth_username', t('HTTP authentication credentials must include a username in addition to a password.'));
+  }
+}
+
diff --git a/modules/simpletest/tests/actions_loop_test.info b/modules/simpletest/tests/actions_loop_test.info
index dae440f78289ce582c977558a2589d55f8621d20..8230c4c08e1a76e371b3df669ef6de9c925f9fcf 100644
--- a/modules/simpletest/tests/actions_loop_test.info
+++ b/modules/simpletest/tests/actions_loop_test.info
@@ -5,8 +5,8 @@ version = VERSION
 core = 7.x
 hidden = TRUE
 
-; Information added by drupal.org packaging script on 2011-08-31
-version = "7.8"
+; Information added by drupal.org packaging script on 2011-10-26
+version = "7.9"
 project = "drupal"
-datestamp = "1314817616"
+datestamp = "1319660730"
 
diff --git a/modules/simpletest/tests/ajax_forms_test.info b/modules/simpletest/tests/ajax_forms_test.info
index d66147d954c8bb92d3188c654d2861522d54528f..e2f360004754c20a702f9949d0c6622f476031a4 100644
--- a/modules/simpletest/tests/ajax_forms_test.info
+++ b/modules/simpletest/tests/ajax_forms_test.info
@@ -5,8 +5,8 @@ package = Testing
 version = VERSION
 hidden = TRUE
 
-; Information added by drupal.org packaging script on 2011-08-31
-version = "7.8"
+; Information added by drupal.org packaging script on 2011-10-26
+version = "7.9"
 project = "drupal"
-datestamp = "1314817616"
+datestamp = "1319660730"
 
diff --git a/modules/simpletest/tests/ajax_test.info b/modules/simpletest/tests/ajax_test.info
index cbcd18b5da49fd262643f6c9fd62c8d40a0e0386..cbf6974e866a76ca8eb381af1b850b2f705ec142 100644
--- a/modules/simpletest/tests/ajax_test.info
+++ b/modules/simpletest/tests/ajax_test.info
@@ -5,8 +5,8 @@ version = VERSION
 core = 7.x
 hidden = TRUE
 
-; Information added by drupal.org packaging script on 2011-08-31
-version = "7.8"
+; Information added by drupal.org packaging script on 2011-10-26
+version = "7.9"
 project = "drupal"
-datestamp = "1314817616"
+datestamp = "1319660730"
 
diff --git a/modules/simpletest/tests/batch_test.info b/modules/simpletest/tests/batch_test.info
index 7133259efe8b3dc5c068be941553651db6bda234..728547950f9b69cbf18d43380f0a1020b96ee176 100644
--- a/modules/simpletest/tests/batch_test.info
+++ b/modules/simpletest/tests/batch_test.info
@@ -5,8 +5,8 @@ version = VERSION
 core = 7.x
 hidden = TRUE
 
-; Information added by drupal.org packaging script on 2011-08-31
-version = "7.8"
+; Information added by drupal.org packaging script on 2011-10-26
+version = "7.9"
 project = "drupal"
-datestamp = "1314817616"
+datestamp = "1319660730"
 
diff --git a/modules/simpletest/tests/bootstrap.test b/modules/simpletest/tests/bootstrap.test
index 14c16a95b6d0c4e694ca01a53615fb472b58b1f7..cb4fe8e2a40245199f9ec3fd494e9b2d83a1e504 100644
--- a/modules/simpletest/tests/bootstrap.test
+++ b/modules/simpletest/tests/bootstrap.test
@@ -308,15 +308,15 @@ class HookBootExitTestCase extends DrupalWebTestCase {
     variable_set('page_cache_invoke_hooks', FALSE);
     $this->assertTrue(cache_get(url('', array('absolute' => TRUE)), 'cache_page'), t('Page has been cached.'));
     $this->drupalGet('');
-    $this->assertEqual(db_query('SELECT COUNT(*) FROM {watchdog} WHERE type = :type AND message = :message', array(':type' => 'system_test', ':message' => 'hook_boot'))->fetchField(), $calls, t('hook_boot not called with agressive cache and a cached page.'));
-    $this->assertEqual(db_query('SELECT COUNT(*) FROM {watchdog} WHERE type = :type AND message = :message', array(':type' => 'system_test', ':message' => 'hook_exit'))->fetchField(), $calls, t('hook_exit not called with agressive cache and a cached page.'));
+    $this->assertEqual(db_query('SELECT COUNT(*) FROM {watchdog} WHERE type = :type AND message = :message', array(':type' => 'system_test', ':message' => 'hook_boot'))->fetchField(), $calls, t('hook_boot not called with aggressive cache and a cached page.'));
+    $this->assertEqual(db_query('SELECT COUNT(*) FROM {watchdog} WHERE type = :type AND message = :message', array(':type' => 'system_test', ':message' => 'hook_exit'))->fetchField(), $calls, t('hook_exit not called with aggressive cache and a cached page.'));
 
     // Test with page cache cleared, boot and exit should be called.
     $this->assertTrue(db_delete('cache_page')->execute(), t('Page cache cleared.'));
     $this->drupalGet('');
     $calls++;
-    $this->assertEqual(db_query('SELECT COUNT(*) FROM {watchdog} WHERE type = :type AND message = :message', array(':type' => 'system_test', ':message' => 'hook_boot'))->fetchField(), $calls, t('hook_boot called with agressive cache and no cached page.'));
-    $this->assertEqual(db_query('SELECT COUNT(*) FROM {watchdog} WHERE type = :type AND message = :message', array(':type' => 'system_test', ':message' => 'hook_exit'))->fetchField(), $calls, t('hook_exit called with agressive cache and no cached page.'));
+    $this->assertEqual(db_query('SELECT COUNT(*) FROM {watchdog} WHERE type = :type AND message = :message', array(':type' => 'system_test', ':message' => 'hook_boot'))->fetchField(), $calls, t('hook_boot called with aggressive cache and no cached page.'));
+    $this->assertEqual(db_query('SELECT COUNT(*) FROM {watchdog} WHERE type = :type AND message = :message', array(':type' => 'system_test', ':message' => 'hook_exit'))->fetchField(), $calls, t('hook_exit called with aggressive cache and no cached page.'));
   }
 }
 
diff --git a/modules/simpletest/tests/cache.test b/modules/simpletest/tests/cache.test
index 954f575961dc4ef9cb7f1a5e759daeaca0b0afd8..d292fa661ea43a6fa177318c969b4e988dfd03f8 100644
--- a/modules/simpletest/tests/cache.test
+++ b/modules/simpletest/tests/cache.test
@@ -151,14 +151,22 @@ class CacheSavingCase extends CacheTestCase {
     $this->assertTrue(isset($cache->data) && $cache->data == $test_object, t('Object is saved and restored properly.'));
   }
 
-  /*
+  /**
    * Check or a variable is stored and restored properly.
-   **/
+   */
   function checkVariable($var) {
     cache_set('test_var', $var, 'cache');
     $cache = cache_get('test_var', 'cache');
     $this->assertTrue(isset($cache->data) && $cache->data === $var, t('@type is saved and restored properly.', array('@type' => ucfirst(gettype($var)))));
   }
+
+  /**
+   * Test no empty cids are written in cache table.
+   */
+  function testNoEmptyCids() {
+    $this->drupalGet('user/register');
+    $this->assertFalse(cache_get(''), t('No cache entry is written with an empty cid.'));
+  }
 }
 
 /**
diff --git a/modules/simpletest/tests/common.test b/modules/simpletest/tests/common.test
index 177e457338fbd9d9fc55c55989fed1545bc36966..c266dc3b4821e9a57d8e905a1748c684fea6de84 100644
--- a/modules/simpletest/tests/common.test
+++ b/modules/simpletest/tests/common.test
@@ -345,14 +345,14 @@ class CommonURLUnitTest extends DrupalWebTestCase {
 }
 
 /**
- * Tests for the check_plain() and filter_xss() functions.
+ * Tests for the check_plain(), filter_xss() and format_string() functions.
  */
 class CommonXssUnitTest extends DrupalUnitTestCase {
 
   public static function getInfo() {
     return array(
       'name' => 'String filtering tests',
-      'description' => 'Confirm that check_plain(), filter_xss(), and check_url() work correctly, including invalid multi-byte sequences.',
+      'description' => 'Confirm that check_plain(), filter_xss(), format_string() and check_url() work correctly, including invalid multi-byte sequences.',
       'group' => 'System',
     );
   }
@@ -385,6 +385,22 @@ class CommonXssUnitTest extends DrupalUnitTestCase {
      $this->assertEqual($text, '&lt;&gt;&amp;&quot;&#039;', 'check_plain() escapes reserved HTML characters.');
   }
 
+  /**
+   * Test t() and format_string() replacement functionality.
+   */
+  function testFormatStringAndT() {
+    foreach (array('format_string', 't') as $function) {
+      $text = $function('Simple text');
+      $this->assertEqual($text, 'Simple text', $function . ' leaves simple text alone.');
+      $text = $function('Escaped text: @value', array('@value' => '<script>'));
+      $this->assertEqual($text, 'Escaped text: &lt;script&gt;', $function . ' replaces and escapes string.');
+      $text = $function('Placeholder text: %value', array('%value' => '<script>'));
+      $this->assertEqual($text, 'Placeholder text: <em class="placeholder">&lt;script&gt;</em>', $function . ' replaces, escapes and themes string.');
+      $text = $function('Verbatim text: !value', array('!value' => '<script>'));
+      $this->assertEqual($text, 'Verbatim text: <script>', $function . ' replaces verbatim string as-is.');
+    }
+  }
+
   /**
    * Check that harmful protocols are stripped.
    */
@@ -1095,7 +1111,7 @@ class DrupalGotoTest extends DrupalWebTestCase {
     $destination = 'common-test/drupal_goto/destination?foo=%2525&bar=123';
     $this->drupalGet('common-test/drupal_goto/redirect', array('query' => array('destination' => $destination)));
     $this->assertText('drupal_goto', t('Drupal goto redirect with destination succeeded.'));
-    $this->assertEqual($this->getUrl(), url('common-test/drupal_goto/destination', array('query' => array('foo' => '%25', 'bar' => '123'), 'absolute' => TRUE)), t('Drupal goto redirected to given query string destination. '));
+    $this->assertEqual($this->getUrl(), url('common-test/drupal_goto/destination', array('query' => array('foo' => '%25', 'bar' => '123'), 'absolute' => TRUE)), t('Drupal goto redirected to given query string destination.'));
   }
 
   /**
diff --git a/modules/simpletest/tests/common_test.info b/modules/simpletest/tests/common_test.info
index 89fc739e4f4240dff3cd465584e27a6903ea6359..0a59d1953ecc43448a89ac5c995550ea3b59ce8d 100644
--- a/modules/simpletest/tests/common_test.info
+++ b/modules/simpletest/tests/common_test.info
@@ -7,8 +7,8 @@ stylesheets[all][] = common_test.css
 stylesheets[print][] = common_test.print.css
 hidden = TRUE
 
-; Information added by drupal.org packaging script on 2011-08-31
-version = "7.8"
+; Information added by drupal.org packaging script on 2011-10-26
+version = "7.9"
 project = "drupal"
-datestamp = "1314817616"
+datestamp = "1319660730"
 
diff --git a/modules/simpletest/tests/common_test_cron_helper.info b/modules/simpletest/tests/common_test_cron_helper.info
index 1fa4696e32106aad9ca46981c4f132fba8c04aaa..752e487cdad956913acdd7640d5409c15d338b07 100644
--- a/modules/simpletest/tests/common_test_cron_helper.info
+++ b/modules/simpletest/tests/common_test_cron_helper.info
@@ -5,8 +5,8 @@ version = VERSION
 core = 7.x
 hidden = TRUE
 
-; Information added by drupal.org packaging script on 2011-08-31
-version = "7.8"
+; Information added by drupal.org packaging script on 2011-10-26
+version = "7.9"
 project = "drupal"
-datestamp = "1314817616"
+datestamp = "1319660730"
 
diff --git a/modules/simpletest/tests/database_test.info b/modules/simpletest/tests/database_test.info
index be6cd43cdf0185a218091deb3e81235aac5e25ab..1b9d5ee52da3d34abe5e51c7cb1431dc01333da0 100644
--- a/modules/simpletest/tests/database_test.info
+++ b/modules/simpletest/tests/database_test.info
@@ -5,8 +5,8 @@ package = Testing
 version = VERSION
 hidden = TRUE
 
-; Information added by drupal.org packaging script on 2011-08-31
-version = "7.8"
+; Information added by drupal.org packaging script on 2011-10-26
+version = "7.9"
 project = "drupal"
-datestamp = "1314817616"
+datestamp = "1319660730"
 
diff --git a/modules/simpletest/tests/database_test.test b/modules/simpletest/tests/database_test.test
index 76ca1038e050de0da1c0cbcbf8a914cfc44a4c3b..87d386aa7e5b10ed167e3e190a08f5626b9f96f8 100644
--- a/modules/simpletest/tests/database_test.test
+++ b/modules/simpletest/tests/database_test.test
@@ -2096,7 +2096,7 @@ class DatabaseSelectComplexTestCase extends DatabaseTestCase {
    */
   function testCountQueryFieldRemovals() {
     // countQuery should remove all fields and expressions, so this can be
-    // tested by adding a non-existant field and expression: if it ends
+    // tested by adding a non-existent field and expression: if it ends
     // up in the query, an error will be thrown. If not, it will return the
     // number of records, which in this case happens to be 4 (there are four
     // records in the {test} table).
@@ -2364,8 +2364,8 @@ class DatabaseSelectPagerDefaultTestCase extends DatabaseTestCase {
   }
 
   /**
-  * Confirm that every pager gets a valid non-overlaping element ID.
-  */
+   * Confirm that every pager gets a valid non-overlaping element ID.
+   */
   function testElementNumbers() {
     $_GET['page'] = '3, 2, 1, 0';
 
diff --git a/modules/simpletest/tests/drupal_system_listing_compatible_test/drupal_system_listing_compatible_test.info b/modules/simpletest/tests/drupal_system_listing_compatible_test/drupal_system_listing_compatible_test.info
index acf65afcea3ee21aba368963a6320c6ddfaed51b..3fa1c74220a2425d0c120b3779d7c60947c62bca 100644
--- a/modules/simpletest/tests/drupal_system_listing_compatible_test/drupal_system_listing_compatible_test.info
+++ b/modules/simpletest/tests/drupal_system_listing_compatible_test/drupal_system_listing_compatible_test.info
@@ -5,8 +5,8 @@ version = VERSION
 core = 7.x
 hidden = TRUE
 
-; Information added by drupal.org packaging script on 2011-08-31
-version = "7.8"
+; Information added by drupal.org packaging script on 2011-10-26
+version = "7.9"
 project = "drupal"
-datestamp = "1314817616"
+datestamp = "1319660730"
 
diff --git a/modules/simpletest/tests/drupal_system_listing_incompatible_test/drupal_system_listing_incompatible_test.info b/modules/simpletest/tests/drupal_system_listing_incompatible_test/drupal_system_listing_incompatible_test.info
index bff577544809902722ccfcb9d9d9dcdd28c01038..52d9b25c3e2ef808040aa819a496883239f913cc 100644
--- a/modules/simpletest/tests/drupal_system_listing_incompatible_test/drupal_system_listing_incompatible_test.info
+++ b/modules/simpletest/tests/drupal_system_listing_incompatible_test/drupal_system_listing_incompatible_test.info
@@ -5,8 +5,8 @@ version = VERSION
 core = 7.x
 hidden = TRUE
 
-; Information added by drupal.org packaging script on 2011-08-31
-version = "7.8"
+; Information added by drupal.org packaging script on 2011-10-26
+version = "7.9"
 project = "drupal"
-datestamp = "1314817616"
+datestamp = "1319660730"
 
diff --git a/modules/simpletest/tests/entity_cache_test.info b/modules/simpletest/tests/entity_cache_test.info
index 697cd32b958eacced91c7e458375ff6e5c653934..7b883f054d4b9bcbcd457abae8413a8b7359ac23 100644
--- a/modules/simpletest/tests/entity_cache_test.info
+++ b/modules/simpletest/tests/entity_cache_test.info
@@ -6,8 +6,8 @@ core = 7.x
 dependencies[] = entity_cache_test_dependency
 hidden = TRUE
 
-; Information added by drupal.org packaging script on 2011-08-31
-version = "7.8"
+; Information added by drupal.org packaging script on 2011-10-26
+version = "7.9"
 project = "drupal"
-datestamp = "1314817616"
+datestamp = "1319660730"
 
diff --git a/modules/simpletest/tests/entity_cache_test_dependency.info b/modules/simpletest/tests/entity_cache_test_dependency.info
index bc349c20c93cdb2bf84fb5e0cc78c84c1deea9da..fd69fa63fbf537ba92f7b7ed3488ca969862e239 100644
--- a/modules/simpletest/tests/entity_cache_test_dependency.info
+++ b/modules/simpletest/tests/entity_cache_test_dependency.info
@@ -5,8 +5,8 @@ version = VERSION
 core = 7.x
 hidden = TRUE
 
-; Information added by drupal.org packaging script on 2011-08-31
-version = "7.8"
+; Information added by drupal.org packaging script on 2011-10-26
+version = "7.9"
 project = "drupal"
-datestamp = "1314817616"
+datestamp = "1319660730"
 
diff --git a/modules/simpletest/tests/entity_crud_hook_test.info b/modules/simpletest/tests/entity_crud_hook_test.info
index 4387a8d58d138be44a4bcec0c2d9165f8a8f9d51..5546652dcffc1f11a7650710dbbbccbfca475a50 100644
--- a/modules/simpletest/tests/entity_crud_hook_test.info
+++ b/modules/simpletest/tests/entity_crud_hook_test.info
@@ -5,8 +5,8 @@ package = Testing
 version = VERSION
 hidden = TRUE
 
-; Information added by drupal.org packaging script on 2011-08-31
-version = "7.8"
+; Information added by drupal.org packaging script on 2011-10-26
+version = "7.9"
 project = "drupal"
-datestamp = "1314817616"
+datestamp = "1319660730"
 
diff --git a/modules/simpletest/tests/entity_query.test b/modules/simpletest/tests/entity_query.test
index 0fe8106ef6c141d1425ecb86d65f94c605732667..ec951f8e26c402dec78ff58acbdac7f18ae54e06 100644
--- a/modules/simpletest/tests/entity_query.test
+++ b/modules/simpletest/tests/entity_query.test
@@ -719,6 +719,31 @@ class EntityFieldQueryTestCase extends DrupalWebTestCase {
       array('test_entity', 3),
     ), t('Test the "equal to" operation on a field.'));
 
+    $query = new EntityFieldQuery();
+    $query
+      ->entityCondition('entity_type', 'test_entity_bundle_key')
+      ->propertyCondition('ftid', 3, '<>');
+    $this->assertEntityFieldQuery($query, array(
+      array('test_entity_bundle_key', 1),
+      array('test_entity_bundle_key', 2),
+      array('test_entity_bundle_key', 4),
+      array('test_entity_bundle_key', 5),
+      array('test_entity_bundle_key', 6),
+    ), t('Test the "not equal to" operation on a property.'));
+
+    $query = new EntityFieldQuery();
+    $query->fieldCondition($this->fields[0], 'value', 3, '<>');
+    $this->assertEntityFieldQuery($query, array(
+      array('test_entity_bundle_key', 1),
+      array('test_entity_bundle_key', 2),
+      array('test_entity_bundle_key', 4),
+      array('test_entity_bundle_key', 5),
+      array('test_entity_bundle_key', 6),
+      array('test_entity', 1),
+      array('test_entity', 2),
+      array('test_entity', 4),
+    ), t('Test the "not equal to" operation on a field.'));
+
     $query = new EntityFieldQuery();
     $query
       ->entityCondition('entity_type', 'test_entity_bundle_key')
@@ -1049,6 +1074,45 @@ class EntityFieldQueryTestCase extends DrupalWebTestCase {
     $this->assertTrue($pass, t("Can't query the universe."));
   }
 
+  /**
+   * Tests querying translatable fields.
+   */
+  function testEntityFieldQueryTranslatable() {
+
+    // Make a test field translatable AND cardinality one.
+    $this->fields[0]['translatable'] = TRUE;
+    $this->fields[0]['cardinality'] = 1;
+    field_update_field($this->fields[0]);
+    field_test_entity_info_translatable('test_entity', TRUE);
+    drupal_static_reset('field_available_languages');
+
+    // Create more items with different languages.
+    $entity = new stdClass();
+    $entity->ftid = 1;
+    $entity->ftvid = 1;
+    $entity->fttype = 'test_bundle';
+
+    // Set fields in two languages with one field value.
+    foreach (array(LANGUAGE_NONE, 'en') as $langcode) {
+      $entity->{$this->field_names[0]}[$langcode][0]['value'] = 1234;
+    }
+
+    field_attach_update('test_entity', $entity);
+
+    // Look up number of results when querying a single entity with multilingual
+    // field values.
+    $query = new EntityFieldQuery();
+    $query_count = $query
+      ->entityCondition('entity_type', 'test_entity')
+      ->entityCondition('bundle', 'test_bundle')
+      ->entityCondition('entity_id', '1')
+      ->fieldCondition($this->fields[0])
+      ->count()
+      ->execute();
+
+    $this->assertEqual($query_count, 1, t("Count on translatable cardinality one field is correct."));
+  }
+
   /**
    * Tests field meta conditions.
    */
@@ -1084,6 +1148,15 @@ class EntityFieldQueryTestCase extends DrupalWebTestCase {
       array('test_entity', 1),
     ), t('Test with a delta meta condition.'));
 
+    // Test language field meta condition.
+    $query = new EntityFieldQuery();
+    $query
+      ->entityCondition('entity_type', 'test_entity', '=')
+      ->fieldLanguageCondition($this->fields[0], LANGUAGE_NONE, '<>');
+    $this->assertEntityFieldQuery($query, array(
+      array('test_entity', 1),
+    ), t('Test with a language meta condition.'));
+
     // Test language field meta condition.
     $query = new EntityFieldQuery();
     $query
@@ -1110,6 +1183,16 @@ class EntityFieldQueryTestCase extends DrupalWebTestCase {
       ->fieldDeltaCondition($this->fields[0], 1, '>=', 'group');
     $this->assertEntityFieldQuery($query, array(), t('Test with a grouped delta meta condition (empty result set).'));
 
+    // Test language grouping.
+    $query = new EntityFieldQuery();
+    $query
+      ->entityCondition('entity_type', 'test_entity', '=')
+      ->fieldCondition($this->fields[0], 'value', 0, '=', NULL, 'group')
+      ->fieldLanguageCondition($this->fields[0], 'en', '<>', NULL, 'group');
+    $this->assertEntityFieldQuery($query, array(
+      array('test_entity', 1),
+    ), t('Test with a grouped language meta condition.'));
+
     // Test language grouping.
     $query = new EntityFieldQuery();
     $query
@@ -1120,6 +1203,13 @@ class EntityFieldQueryTestCase extends DrupalWebTestCase {
       array('test_entity', 1),
     ), t('Test with a grouped language meta condition.'));
 
+    $query = new EntityFieldQuery();
+    $query
+      ->entityCondition('entity_type', 'test_entity', '=')
+      ->fieldCondition($this->fields[0], 'value', 0, '=', NULL, 'group')
+      ->fieldLanguageCondition($this->fields[0], LANGUAGE_NONE, '<>', NULL, 'group');
+    $this->assertEntityFieldQuery($query, array(), t('Test with a grouped language meta condition (empty result set).'));
+
     $query = new EntityFieldQuery();
     $query
       ->entityCondition('entity_type', 'test_entity', '=')
@@ -1127,6 +1217,17 @@ class EntityFieldQueryTestCase extends DrupalWebTestCase {
       ->fieldLanguageCondition($this->fields[0], LANGUAGE_NONE, '!=', NULL, 'group');
     $this->assertEntityFieldQuery($query, array(), t('Test with a grouped language meta condition (empty result set).'));
 
+    // Test delta and language grouping.
+    $query = new EntityFieldQuery();
+    $query
+      ->entityCondition('entity_type', 'test_entity', '=')
+      ->fieldCondition($this->fields[0], 'value', 0, '=', 'delta', 'language')
+      ->fieldDeltaCondition($this->fields[0], 1, '<', 'delta', 'language')
+      ->fieldLanguageCondition($this->fields[0], 'en', '<>', 'delta', 'language');
+    $this->assertEntityFieldQuery($query, array(
+      array('test_entity', 1),
+    ), t('Test with a grouped delta + language meta condition.'));
+
     // Test delta and language grouping.
     $query = new EntityFieldQuery();
     $query
@@ -1138,6 +1239,14 @@ class EntityFieldQueryTestCase extends DrupalWebTestCase {
       array('test_entity', 1),
     ), t('Test with a grouped delta + language meta condition.'));
 
+    $query = new EntityFieldQuery();
+    $query
+      ->entityCondition('entity_type', 'test_entity', '=')
+      ->fieldCondition($this->fields[0], 'value', 0, '=', 'delta', 'language')
+      ->fieldDeltaCondition($this->fields[0], 1, '>=', 'delta', 'language')
+      ->fieldLanguageCondition($this->fields[0], 'en', '<>', 'delta', 'language');
+    $this->assertEntityFieldQuery($query, array(), t('Test with a grouped delta + language meta condition (empty result set, delta condition unsatisifed).'));
+
     $query = new EntityFieldQuery();
     $query
       ->entityCondition('entity_type', 'test_entity', '=')
@@ -1146,6 +1255,14 @@ class EntityFieldQueryTestCase extends DrupalWebTestCase {
       ->fieldLanguageCondition($this->fields[0], 'en', '!=', 'delta', 'language');
     $this->assertEntityFieldQuery($query, array(), t('Test with a grouped delta + language meta condition (empty result set, delta condition unsatisifed).'));
 
+    $query = new EntityFieldQuery();
+    $query
+      ->entityCondition('entity_type', 'test_entity', '=')
+      ->fieldCondition($this->fields[0], 'value', 0, '=', 'delta', 'language')
+      ->fieldDeltaCondition($this->fields[0], 1, '<', 'delta', 'language')
+      ->fieldLanguageCondition($this->fields[0], LANGUAGE_NONE, '<>', 'delta', 'language');
+    $this->assertEntityFieldQuery($query, array(), t('Test with a grouped delta + language meta condition (empty result set, language condition unsatisifed).'));
+
     $query = new EntityFieldQuery();
     $query
       ->entityCondition('entity_type', 'test_entity', '=')
@@ -1154,6 +1271,14 @@ class EntityFieldQueryTestCase extends DrupalWebTestCase {
       ->fieldLanguageCondition($this->fields[0], LANGUAGE_NONE, '!=', 'delta', 'language');
     $this->assertEntityFieldQuery($query, array(), t('Test with a grouped delta + language meta condition (empty result set, language condition unsatisifed).'));
 
+    $query = new EntityFieldQuery();
+    $query
+      ->entityCondition('entity_type', 'test_entity', '=')
+      ->fieldCondition($this->fields[0], 'value', 0, '=', 'delta', 'language')
+      ->fieldDeltaCondition($this->fields[0], 1, '>=', 'delta', 'language')
+      ->fieldLanguageCondition($this->fields[0], LANGUAGE_NONE, '<>', 'delta', 'language');
+    $this->assertEntityFieldQuery($query, array(), t('Test with a grouped delta + language meta condition (empty result set, both conditions unsatisifed).'));
+
     $query = new EntityFieldQuery();
     $query
       ->entityCondition('entity_type', 'test_entity', '=')
diff --git a/modules/simpletest/tests/error_test.info b/modules/simpletest/tests/error_test.info
index 56298fbc23f7109400025968944e015323ed7f7e..4f39888040699d726cb359da8c1bd268f480692f 100644
--- a/modules/simpletest/tests/error_test.info
+++ b/modules/simpletest/tests/error_test.info
@@ -5,8 +5,8 @@ version = VERSION
 core = 7.x
 hidden = TRUE
 
-; Information added by drupal.org packaging script on 2011-08-31
-version = "7.8"
+; Information added by drupal.org packaging script on 2011-10-26
+version = "7.9"
 project = "drupal"
-datestamp = "1314817616"
+datestamp = "1319660730"
 
diff --git a/modules/simpletest/tests/file.test b/modules/simpletest/tests/file.test
index a84208c28dd3225deab387fba3ad4aa2b296f216..55e3b0aa33b568d3c6241c3c6e71b90238fa5f0c 100644
--- a/modules/simpletest/tests/file.test
+++ b/modules/simpletest/tests/file.test
@@ -689,7 +689,7 @@ class FileSaveUploadTest extends FileHookTestCase {
 
     $this->drupalPost('file-test/upload', $edit, t('Submit'));
     $this->assertResponse(200, t('Received a 200 response for posted test file.'));
-    $message = t('Only files with the following extensions are allowed: ') . '<em class="placeholder">' . $extensions . '</em>';
+    $message = t('Only files with the following extensions are allowed:') . ' <em class="placeholder">' . $extensions . '</em>';
     $this->assertRaw($message, t('Can\'t upload a disallowed extension'));
     $this->assertRaw(t('Epic upload FAIL!'), t('Found the failure message.'));
 
@@ -748,7 +748,7 @@ class FileSaveUploadTest extends FileHookTestCase {
 
     $this->drupalPost('file-test/upload', $edit, t('Submit'));
     $this->assertResponse(200, t('Received a 200 response for posted test file.'));
-    $message = t('For security reasons, your upload has been renamed to ') . '<em class="placeholder">' . $this->phpfile->filename . '.txt' . '</em>';
+    $message = t('For security reasons, your upload has been renamed to') . ' <em class="placeholder">' . $this->phpfile->filename . '.txt' . '</em>';
     $this->assertRaw($message, t('Dangerous file was renamed.'));
     $this->assertRaw(t('File MIME type is text/plain.'), t('Dangerous file\'s MIME type was changed.'));
     $this->assertRaw(t('You WIN!'), t('Found the success message.'));
@@ -1563,7 +1563,7 @@ class FileDeleteTest extends FileHookTestCase {
     file_usage_delete($file, 'testing', 'test', 1);
     file_delete($file);
     $usage = file_usage_list($file);
-    $this->assertEqual($usage['testing']['test'], array('id' => 1, 'count' => 1), t('Test file is still in use.'));
+    $this->assertEqual($usage['testing']['test'], array(1 => 1), t('Test file is still in use.'));
     $this->assertTrue(file_exists($file->uri), t('File still exists on the disk.'));
     $this->assertTrue(file_load($file->fid), t('File still exists in the database.'));
 
@@ -1606,7 +1606,7 @@ class FileMoveTest extends FileHookTestCase {
     $result = file_move(clone $source, $desired_filepath, FILE_EXISTS_ERROR);
 
     // Check the return status and that the contents changed.
-    $this->assertTrue($result, t('File moved sucessfully.'));
+    $this->assertTrue($result, t('File moved successfully.'));
     $this->assertFalse(file_exists($source->uri));
     $this->assertEqual($contents, file_get_contents($result->uri), t('Contents of file correctly written.'));
 
@@ -1638,7 +1638,7 @@ class FileMoveTest extends FileHookTestCase {
     $result = file_move(clone $source, $target->uri, FILE_EXISTS_RENAME);
 
     // Check the return status and that the contents changed.
-    $this->assertTrue($result, t('File moved sucessfully.'));
+    $this->assertTrue($result, t('File moved successfully.'));
     $this->assertFalse(file_exists($source->uri));
     $this->assertEqual($contents, file_get_contents($result->uri), t('Contents of file correctly written.'));
 
@@ -1675,7 +1675,7 @@ class FileMoveTest extends FileHookTestCase {
     // Look at the results.
     $this->assertEqual($contents, file_get_contents($result->uri), t('Contents of file were overwritten.'));
     $this->assertFalse(file_exists($source->uri));
-    $this->assertTrue($result, t('File moved sucessfully.'));
+    $this->assertTrue($result, t('File moved successfully.'));
 
     // Check that the correct hooks were called.
     $this->assertFileHooksCalled(array('move', 'update', 'delete', 'load'));
@@ -1767,7 +1767,7 @@ class FileCopyTest extends FileHookTestCase {
     $result = file_copy(clone $source, $desired_uri, FILE_EXISTS_ERROR);
 
     // Check the return status and that the contents changed.
-    $this->assertTrue($result, t('File copied sucessfully.'));
+    $this->assertTrue($result, t('File copied successfully.'));
     $this->assertEqual($contents, file_get_contents($result->uri), t('Contents of file were copied correctly.'));
 
     // Check that the correct hooks were called.
@@ -1798,7 +1798,7 @@ class FileCopyTest extends FileHookTestCase {
     $result = file_copy(clone $source, $target->uri, FILE_EXISTS_RENAME);
 
     // Check the return status and that the contents changed.
-    $this->assertTrue($result, t('File copied sucessfully.'));
+    $this->assertTrue($result, t('File copied successfully.'));
     $this->assertEqual($contents, file_get_contents($result->uri), t('Contents of file were copied correctly.'));
     $this->assertNotEqual($result->uri, $source->uri, t('Returned file path has changed from the original.'));
 
@@ -1838,7 +1838,7 @@ class FileCopyTest extends FileHookTestCase {
     $result = file_copy(clone $source, $target->uri, FILE_EXISTS_REPLACE);
 
     // Check the return status and that the contents changed.
-    $this->assertTrue($result, t('File copied sucessfully.'));
+    $this->assertTrue($result, t('File copied successfully.'));
     $this->assertEqual($contents, file_get_contents($result->uri), t('Contents of file were overwritten.'));
     $this->assertDifferentFile($source, $result);
 
@@ -2066,10 +2066,10 @@ class FileUsageTest extends FileTestCase {
     $usage = file_usage_list($file);
 
     $this->assertEqual(count($usage['testing']), 2, t('Returned the correct number of items.'));
-    $this->assertEqual($usage['testing']['foo']['id'], 1, t('Returned the correct id.'));
-    $this->assertEqual($usage['testing']['bar']['id'], 2, t('Returned the correct id.'));
-    $this->assertEqual($usage['testing']['foo']['count'], 1, t('Returned the correct count.'));
-    $this->assertEqual($usage['testing']['bar']['count'], 2, t('Returned the correct count.'));
+    $this->assertTrue(isset($usage['testing']['foo'][1]), t('Returned the correct id.'));
+    $this->assertTrue(isset($usage['testing']['bar'][2]), t('Returned the correct id.'));
+    $this->assertEqual($usage['testing']['foo'][1], 1, t('Returned the correct count.'));
+    $this->assertEqual($usage['testing']['bar'][2], 2, t('Returned the correct count.'));
   }
 
   /**
@@ -2160,7 +2160,7 @@ class FileValidateTest extends FileHookTestCase {
     $file = $this->createFile();
 
     // Empty validators.
-    $this->assertEqual(file_validate($file, array()), array(), t('Validating an empty array works succesfully.'));
+    $this->assertEqual(file_validate($file, array()), array(), t('Validating an empty array works successfully.'));
     $this->assertFileHooksCalled(array('validate'));
 
     // Use the file_test.module's test validator to ensure that passing tests
@@ -2245,7 +2245,7 @@ class FileSaveDataTest extends FileHookTestCase {
     $contents = $this->randomName(8);
 
     $result = file_save_data($contents, $existing->uri, FILE_EXISTS_RENAME);
-    $this->assertTrue($result, t("File saved sucessfully."));
+    $this->assertTrue($result, t("File saved successfully."));
 
     $this->assertEqual('public', file_uri_scheme($result->uri), t("File was placed in Drupal's files directory."));
     $this->assertEqual($result->filename, $existing->filename, t("Filename was set to the basename of the source, rather than that of the renamed file."));
@@ -2273,7 +2273,7 @@ class FileSaveDataTest extends FileHookTestCase {
     $contents = $this->randomName(8);
 
     $result = file_save_data($contents, $existing->uri, FILE_EXISTS_REPLACE);
-    $this->assertTrue($result, t('File saved sucessfully.'));
+    $this->assertTrue($result, t('File saved successfully.'));
 
     $this->assertEqual('public', file_uri_scheme($result->uri), t("File was placed in Drupal's files directory."));
     $this->assertEqual($result->filename, $existing->filename, t('Filename was set to the basename of the existing file, rather than preserving the original name.'));
diff --git a/modules/simpletest/tests/file_test.info b/modules/simpletest/tests/file_test.info
index 2577d5c480cbaf46c9878b7b923ee754eec3e96c..7139ebb87d941559f83fee9ba725a71f0ed1068b 100644
--- a/modules/simpletest/tests/file_test.info
+++ b/modules/simpletest/tests/file_test.info
@@ -6,8 +6,8 @@ core = 7.x
 files[] = file_test.module
 hidden = TRUE
 
-; Information added by drupal.org packaging script on 2011-08-31
-version = "7.8"
+; Information added by drupal.org packaging script on 2011-10-26
+version = "7.9"
 project = "drupal"
-datestamp = "1314817616"
+datestamp = "1319660730"
 
diff --git a/modules/simpletest/tests/filter_test.info b/modules/simpletest/tests/filter_test.info
index da94abe86a63b961e7110d324e788b91866e9101..f16686a3e9d26864cbf7cd7b3ec1065201fdc143 100644
--- a/modules/simpletest/tests/filter_test.info
+++ b/modules/simpletest/tests/filter_test.info
@@ -5,8 +5,8 @@ version = VERSION
 core = 7.x
 hidden = TRUE
 
-; Information added by drupal.org packaging script on 2011-08-31
-version = "7.8"
+; Information added by drupal.org packaging script on 2011-10-26
+version = "7.9"
 project = "drupal"
-datestamp = "1314817616"
+datestamp = "1319660730"
 
diff --git a/modules/simpletest/tests/form.test b/modules/simpletest/tests/form.test
index e7ae9de3f9e058065d3272a1ce9d4cb1335b1b70..fe2c1bbfbe4b0028545e319f11230be47d43265c 100644
--- a/modules/simpletest/tests/form.test
+++ b/modules/simpletest/tests/form.test
@@ -599,13 +599,13 @@ class FormsElementsLabelsTestCase extends DrupalWebTestCase {
     // Exercise various defaults for textboxes and modifications to ensure
     // appropriate override and correct behaviour.
     $elements = $this->xpath('//label[@for="edit-form-textfield-test-title-and-required"]/child::span[@class="form-required"]/parent::*/following-sibling::input[@id="edit-form-textfield-test-title-and-required"]');
-    $this->assertTrue(isset($elements[0]), t("Label preceeds textfield, with required marker inside label."));
+    $this->assertTrue(isset($elements[0]), t("Label precedes textfield, with required marker inside label."));
 
     $elements = $this->xpath('//input[@id="edit-form-textfield-test-no-title-required"]/preceding-sibling::label[@for="edit-form-textfield-test-no-title-required"]/span[@class="form-required"]');
-    $this->assertTrue(isset($elements[0]), t("Label tag with required marker preceeds required textfield with no title."));
+    $this->assertTrue(isset($elements[0]), t("Label tag with required marker precedes required textfield with no title."));
 
     $elements = $this->xpath('//input[@id="edit-form-textfield-test-title-invisible"]/preceding-sibling::label[@for="edit-form-textfield-test-title-invisible" and @class="element-invisible"]');
-    $this->assertTrue(isset($elements[0]), t("Label preceeding field and label class is element-invisible."));
+    $this->assertTrue(isset($elements[0]), t("Label preceding field and label class is element-invisible."));
 
     $elements = $this->xpath('//input[@id="edit-form-textfield-test-title"]/preceding-sibling::span[@class="form-required"]');
     $this->assertFalse(isset($elements[0]), t("No required marker on non-required field."));
diff --git a/modules/simpletest/tests/form_test.info b/modules/simpletest/tests/form_test.info
index 042ebc5eb0555cc23bf5f5f07554a11155f413dc..4f29649b238b29ec402e4ea0d7d63ca8f82c7ca2 100644
--- a/modules/simpletest/tests/form_test.info
+++ b/modules/simpletest/tests/form_test.info
@@ -5,8 +5,8 @@ version = VERSION
 core = 7.x
 hidden = TRUE
 
-; Information added by drupal.org packaging script on 2011-08-31
-version = "7.8"
+; Information added by drupal.org packaging script on 2011-10-26
+version = "7.9"
 project = "drupal"
-datestamp = "1314817616"
+datestamp = "1319660730"
 
diff --git a/modules/simpletest/tests/form_test.module b/modules/simpletest/tests/form_test.module
index 00be7d2e68de9917e7b527364630c8942a630d02..23aca244b8ea9869292898ffe644d315d78ecbda 100644
--- a/modules/simpletest/tests/form_test.module
+++ b/modules/simpletest/tests/form_test.module
@@ -713,7 +713,7 @@ function form_label_test_form() {
   );
   $form['form_textfield_test_no_title_required'] = array(
     '#type' => 'textfield',
-    // We use an empty title, since not setting #title supresses the label
+    // We use an empty title, since not setting #title suppresses the label
     // and required marker.
     '#title' => '',
     '#required' => TRUE,
diff --git a/modules/simpletest/tests/image_test.info b/modules/simpletest/tests/image_test.info
index 22e34bad3eed2051d2fd04dee33e8de7c65f323e..56ed08eb2faa016bbde2bc3f560151d4e19e3d12 100644
--- a/modules/simpletest/tests/image_test.info
+++ b/modules/simpletest/tests/image_test.info
@@ -5,8 +5,8 @@ version = VERSION
 core = 7.x
 hidden = TRUE
 
-; Information added by drupal.org packaging script on 2011-08-31
-version = "7.8"
+; Information added by drupal.org packaging script on 2011-10-26
+version = "7.9"
 project = "drupal"
-datestamp = "1314817616"
+datestamp = "1319660730"
 
diff --git a/modules/simpletest/tests/menu.test b/modules/simpletest/tests/menu.test
index c0a79d4c233be96b63d01964f17984682ee199b7..b12ccb116d24a14541481e36d0c57c41d9ad0c2b 100644
--- a/modules/simpletest/tests/menu.test
+++ b/modules/simpletest/tests/menu.test
@@ -5,6 +5,122 @@
  * Provides SimpleTests for menu.inc.
  */
 
+class MenuWebTestCase extends DrupalWebTestCase {
+  function setUp() {
+    $modules = func_get_args();
+    if (isset($modules[0]) && is_array($modules[0])) {
+      $modules = $modules[0];
+    }
+    parent::setUp($modules);
+  }
+
+  /**
+   * Assert that a given path shows certain breadcrumb links.
+   *
+   * @param string $goto
+   *   (optional) A system path to pass to DrupalWebTestCase::drupalGet().
+   * @param array $trail
+   *   An associative array whose keys are expected breadcrumb link paths and
+   *   whose values are expected breadcrumb link texts (not sanitized).
+   * @param string $page_title
+   *   (optional) A page title to additionally assert via
+   *   DrupalWebTestCase::assertTitle(). Without site name suffix.
+   * @param array $tree
+   *   (optional) An associative array whose keys are link paths and whose
+   *   values are link titles (not sanitized) of an expected active trail in a
+   *   menu tree output on the page.
+   * @param $last_active
+   *   (optional) Whether the last link in $tree is expected to be active (TRUE)
+   *   or just to be in the active trail (FALSE).
+   */
+  protected function assertBreadcrumb($goto, array $trail, $page_title = NULL, array $tree = array(), $last_active = TRUE) {
+    if (isset($goto)) {
+      $this->drupalGet($goto);
+    }
+    // Compare paths with actual breadcrumb.
+    $parts = $this->getParts();
+    $pass = TRUE;
+    foreach ($trail as $path => $title) {
+      $url = url($path);
+      $part = array_shift($parts);
+      $pass = ($pass && $part['href'] === $url && $part['text'] === check_plain($title));
+    }
+    // No parts must be left, or an expected "Home" will always pass.
+    $pass = ($pass && empty($parts));
+
+    $this->assertTrue($pass, t('Breadcrumb %parts found on @path.', array(
+      '%parts' => implode(' » ', $trail),
+      '@path' => $this->getUrl(),
+    )));
+
+    // Additionally assert page title, if given.
+    if (isset($page_title)) {
+      $this->assertTitle(strtr('@title | Drupal', array('@title' => $page_title)));
+    }
+
+    // Additionally assert active trail in a menu tree output, if given.
+    if ($tree) {
+      end($tree);
+      $active_link_path = key($tree);
+      $active_link_title = array_pop($tree);
+      $xpath = '';
+      if ($tree) {
+        $i = 0;
+        foreach ($tree as $link_path => $link_title) {
+          $part_xpath = (!$i ? '//' : '/following-sibling::ul/descendant::');
+          $part_xpath .= 'li[contains(@class, :class)]/a[contains(@href, :href) and contains(text(), :title)]';
+          $part_args = array(
+            ':class' => 'active-trail',
+            ':href' => url($link_path),
+            ':title' => $link_title,
+          );
+          $xpath .= $this->buildXPathQuery($part_xpath, $part_args);
+          $i++;
+        }
+        $elements = $this->xpath($xpath);
+        $this->assertTrue(!empty($elements), t('Active trail to current page was found in menu tree.'));
+
+        // Append prefix for active link asserted below.
+        $xpath .= '/following-sibling::ul/descendant::';
+      }
+      else {
+        $xpath .= '//';
+      }
+      $xpath_last_active = ($last_active ? 'and contains(@class, :class-active)' : '');
+      $xpath .= 'li[contains(@class, :class-trail)]/a[contains(@href, :href) ' . $xpath_last_active . 'and contains(text(), :title)]';
+      $args = array(
+        ':class-trail' => 'active-trail',
+        ':class-active' => 'active',
+        ':href' => url($active_link_path),
+        ':title' => $active_link_title,
+      );
+      $elements = $this->xpath($xpath, $args);
+      $this->assertTrue(!empty($elements), t('Active link %title was found in menu tree, including active trail links %tree.', array(
+        '%title' => $active_link_title,
+        '%tree' => implode(' » ', $tree),
+      )));
+    }
+  }
+
+  /**
+   * Returns the breadcrumb contents of the current page in the internal browser.
+   */
+  protected function getParts() {
+    $parts = array();
+    $elements = $this->xpath('//div[@class="breadcrumb"]/a');
+    if (!empty($elements)) {
+      foreach ($elements as $element) {
+        $parts[] = array(
+          'text' => (string) $element,
+          'href' => (string) $element['href'],
+          'title' => (string) $element['title'],
+        );
+      }
+    }
+    return $parts;
+  }
+}
+
 class MenuRouterTestCase extends DrupalWebTestCase {
   public static function getInfo() {
     return array(
@@ -420,7 +536,7 @@ class MenuRouterTestCase extends DrupalWebTestCase {
   }
 
   /**
-   * Test menu maintainance hooks.
+   * Test menu maintenance hooks.
    */
   function testMenuItemHooks() {
     // Create an item.
@@ -897,7 +1013,7 @@ class MenuTreeOutputTestCase extends DrupalWebTestCase {
       'group' => 'Menu',
     );
   }
-  
+
   function setUp() {
     parent::setUp();
   }
@@ -925,7 +1041,7 @@ class MenuTreeOutputTestCase extends DrupalWebTestCase {
 /**
  * Menu breadcrumbs related tests.
  */
-class MenuBreadcrumbTestCase extends DrupalWebTestCase {
+class MenuBreadcrumbTestCase extends MenuWebTestCase {
   public static function getInfo() {
     return array(
       'name' => 'Breadcrumbs',
@@ -935,7 +1051,12 @@ class MenuBreadcrumbTestCase extends DrupalWebTestCase {
   }
 
   function setUp() {
-    parent::setUp(array('menu_test'));
+    $modules = func_get_args();
+    if (isset($modules[0]) && is_array($modules[0])) {
+      $modules = $modules[0];
+    }
+    $modules[] = 'menu_test';
+    parent::setUp($modules);
     $perms = array_keys(module_invoke_all('permission'));
     $this->admin_user = $this->drupalCreateUser($perms);
     $this->drupalLogin($this->admin_user);
@@ -1249,8 +1370,7 @@ class MenuBreadcrumbTestCase extends DrupalWebTestCase {
       $tree += array(
         $link['link_path'] => $link['link_title'],
       );
-      // @todo Normally, you'd expect $term->name as page title here.
-      $this->assertBreadcrumb($link['link_path'], $trail, $link['link_title'], $tree);
+      $this->assertBreadcrumb($link['link_path'], $trail, $term->name, $tree);
       $this->assertRaw(check_plain($parent->title), 'Tagged node found.');
 
       // Additionally make sure that this link appears only once; i.e., the
@@ -1410,110 +1530,117 @@ class MenuBreadcrumbTestCase extends DrupalWebTestCase {
     $this->assertBreadcrumb('admin/reports/dblog', $trail, t('Recent log messages'));
     $this->assertNoResponse(403);
   }
+}
 
-  /**
-   * Assert that a given path shows certain breadcrumb links.
-   *
-   * @param string $goto
-   *   (optional) A system path to pass to DrupalWebTestCase::drupalGet().
-   * @param array $trail
-   *   An associative array whose keys are expected breadcrumb link paths and
-   *   whose values are expected breadcrumb link texts (not sanitized).
-   * @param string $page_title
-   *   (optional) A page title to additionally assert via
-   *   DrupalWebTestCase::assertTitle(). Without site name suffix.
-   * @param array $tree
-   *   (optional) An associative array whose keys are link paths and whose
-   *   values are link titles (not sanitized) of an expected active trail in a
-   *   menu tree output on the page.
-   * @param $last_active
-   *   (optional) Whether the last link in $tree is expected to be active (TRUE)
-   *   or just to be in the active trail (FALSE).
-   */
-  protected function assertBreadcrumb($goto, array $trail, $page_title = NULL, array $tree = array(), $last_active = TRUE) {
-    if (isset($goto)) {
-      $this->drupalGet($goto);
-    }
-    // Compare paths with actual breadcrumb.
-    $parts = $this->getParts();
-    $pass = TRUE;
-    foreach ($trail as $path => $title) {
-      $url = url($path);
-      $part = array_shift($parts);
-      $pass = ($pass && $part['href'] === $url && $part['text'] === check_plain($title));
-    }
-    // No parts must be left, or an expected "Home" will always pass.
-    $pass = ($pass && empty($parts));
-
-    $this->assertTrue($pass, t('Breadcrumb %parts found on @path.', array(
-      '%parts' => implode(' » ', $trail),
-      '@path' => $this->getUrl(),
-    )));
+/**
+ * Tests active menu trails.
+ */
+class MenuTrailTestCase extends MenuWebTestCase {
+  public static function getInfo() {
+    return array(
+      'name' => 'Active trail',
+      'description' => 'Tests active menu trails and alteration functionality.',
+      'group' => 'Menu',
+    );
+  }
 
-    // Additionally assert page title, if given.
-    if (isset($page_title)) {
-      $this->assertTitle(strtr('@title | Drupal', array('@title' => $page_title)));
+  function setUp() {
+    $modules = func_get_args();
+    if (isset($modules[0]) && is_array($modules[0])) {
+      $modules = $modules[0];
     }
+    $modules[] = 'menu_test';
+    parent::setUp($modules);
+    $this->admin_user = $this->drupalCreateUser(array('administer site configuration', 'access administration pages'));
+    $this->drupalLogin($this->admin_user);
 
-    // Additionally assert active trail in a menu tree output, if given.
-    if ($tree) {
-      end($tree);
-      $active_link_path = key($tree);
-      $active_link_title = array_pop($tree);
-      $xpath = '';
-      if ($tree) {
-        $i = 0;
-        foreach ($tree as $link_path => $link_title) {
-          $part_xpath = (!$i ? '//' : '/following-sibling::ul/descendant::');
-          $part_xpath .= 'li[contains(@class, :class)]/a[contains(@href, :href) and contains(text(), :title)]';
-          $part_args = array(
-            ':class' => 'active-trail',
-            ':href' => url($link_path),
-            ':title' => $link_title,
-          );
-          $xpath .= $this->buildXPathQuery($part_xpath, $part_args);
-          $i++;
-        }
-        $elements = $this->xpath($xpath);
-        $this->assertTrue(!empty($elements), t('Active trail to current page was found in menu tree.'));
+    // This test puts menu links in the Navigation menu and then tests for
+    // their presence on the page, so we need to ensure that the Navigation
+    // block will be displayed in all active themes.
+    db_update('block')
+      ->fields(array(
+        // Use a region that is valid for all themes.
+        'region' => 'content',
+        'status' => 1,
+      ))
+      ->condition('module', 'system')
+      ->condition('delta', 'navigation')
+      ->execute();
 
-        // Append prefix for active link asserted below.
-        $xpath .= '/following-sibling::ul/descendant::';
-      }
-      else {
-        $xpath .= '//';
-      }
-      $xpath_last_active = ($last_active ? 'and contains(@class, :class-active)' : '');
-      $xpath .= 'li[contains(@class, :class-trail)]/a[contains(@href, :href) ' . $xpath_last_active . 'and contains(text(), :title)]';
-      $args = array(
-        ':class-trail' => 'active-trail',
-        ':class-active' => 'active',
-        ':href' => url($active_link_path),
-        ':title' => $active_link_title,
-      );
-      $elements = $this->xpath($xpath, $args);
-      $this->assertTrue(!empty($elements), t('Active link %title was found in menu tree, including active trail links %tree.', array(
-        '%title' => $active_link_title,
-        '%tree' => implode(' » ', $tree),
-      )));
-    }
+    // This test puts menu links in the Management menu and then tests for
+    // their presence on the page, so we need to ensure that the Management
+    // block will be displayed in all active themes.
+    db_update('block')
+      ->fields(array(
+        // Use a region that is valid for all themes.
+        'region' => 'content',
+        'status' => 1,
+      ))
+      ->condition('module', 'system')
+      ->condition('delta', 'management')
+      ->execute();
   }
 
   /**
-   * Returns the breadcrumb contents of the current page in the internal browser.
+   * Tests active trails are properly affected by menu_tree_set_path().
    */
-  protected function getParts() {
-    $parts = array();
-    $elements = $this->xpath('//div[@class="breadcrumb"]/a');
-    if (!empty($elements)) {
-      foreach ($elements as $element) {
-        $parts[] = array(
-          'text' => (string) $element,
-          'href' => (string) $element['href'],
-          'title' => (string) $element['title'],
-        );
-      }
-    }
-    return $parts;
+  function testMenuTreeSetPath() {
+    $home = array('<front>' => 'Home');
+    $config_tree = array(
+      'admin' => t('Administration'),
+      'admin/config' => t('Configuration'),
+    );
+    $config = $home + $config_tree;
+
+    // The menu_test_menu_tree_set_path system variable controls whether or not
+    // the menu_test_menu_trail_callback() callback (used by all paths in these
+    // tests) issues an overriding call to menu_trail_set_path().
+    $test_menu_path = array(
+      'menu_name' => 'management',
+      'path' => 'admin/config/system/site-information',
+    );
+
+    $breadcrumb = $home + array(
+      'menu-test' => t('Menu test root'),
+    );
+    $tree = array(
+      'menu-test' => t('Menu test root'),
+      'menu-test/menu-trail' => t('Menu trail - Case 1'),
+    );
+
+    // Test the tree generation for the Navigation menu.
+    variable_del('menu_test_menu_tree_set_path');
+    $this->assertBreadcrumb('menu-test/menu-trail', $breadcrumb, t('Menu trail - Case 1'), $tree);
+
+    // Override the active trail for the Management tree; it should not affect
+    // the Navigation tree.
+    variable_set('menu_test_menu_tree_set_path', $test_menu_path);
+    $this->assertBreadcrumb('menu-test/menu-trail', $breadcrumb, t('Menu trail - Case 1'), $tree);
+
+    $breadcrumb = $config + array(
+      'admin/config/development' => t('Development'),
+    );
+    $tree = $config_tree + array(
+      'admin/config/development' => t('Development'),
+      'admin/config/development/menu-trail' => t('Menu trail - Case 2'),
+    );
+
+    $override_breadcrumb = $config + array(
+      'admin/config/system' => t('System'),
+      'admin/config/system/site-information' => t('Site information'),
+    );
+    $override_tree = $config_tree + array(
+      'admin/config/system' => t('System'),
+      'admin/config/system/site-information' => t('Site information'),
+    );
+
+    // Test the tree generation for the Management menu.
+    variable_del('menu_test_menu_tree_set_path');
+    $this->assertBreadcrumb('admin/config/development/menu-trail', $breadcrumb, t('Menu trail - Case 2'), $tree);
+
+    // Override the active trail for the Management tree; it should affect the
+    // breadcrumbs and Management tree.
+    variable_set('menu_test_menu_tree_set_path', $test_menu_path);
+    $this->assertBreadcrumb('admin/config/development/menu-trail', $override_breadcrumb, t('Menu trail - Case 2'), $override_tree);
   }
 }
diff --git a/modules/simpletest/tests/menu_test.info b/modules/simpletest/tests/menu_test.info
index 9b1ba8e0b33f193a6c8905f2d0ca1decf36f6bc9..d4b608f56642a32ac4ff4d20a27f384b7e5a4522 100644
--- a/modules/simpletest/tests/menu_test.info
+++ b/modules/simpletest/tests/menu_test.info
@@ -5,8 +5,8 @@ version = VERSION
 core = 7.x
 hidden = TRUE
 
-; Information added by drupal.org packaging script on 2011-08-31
-version = "7.8"
+; Information added by drupal.org packaging script on 2011-10-26
+version = "7.9"
 project = "drupal"
-datestamp = "1314817616"
+datestamp = "1319660730"
 
diff --git a/modules/simpletest/tests/menu_test.module b/modules/simpletest/tests/menu_test.module
index 3046a0416d14b33f467167b8034cb0e5955eda4f..c42aca60fe67a0851d5177ebbd6e8c97b31b8781 100644
--- a/modules/simpletest/tests/menu_test.module
+++ b/modules/simpletest/tests/menu_test.module
@@ -217,6 +217,20 @@ function menu_test_menu() {
     'type' => MENU_LOCAL_TASK,
   ) + $base;
 
+  // Menu trail tests.
+  // @see MenuTrailTestCase
+  $items['menu-test/menu-trail'] = array(
+    'title' => 'Menu trail - Case 1',
+    'page callback' => 'menu_test_menu_trail_callback',
+    'access arguments' => array('access content'),
+  );
+  $items['admin/config/development/menu-trail'] = array(
+    'title' => 'Menu trail - Case 2',
+    'description' => 'Tests menu_tree_set_path()',
+    'page callback' => 'menu_test_menu_trail_callback',
+    'access arguments' => array('access administration pages'),
+  );
+
   // File inheritance tests. This menu item should inherit the page callback
   // system_admin_menu_block_page() and therefore render its children as links
   // on the page.
@@ -344,6 +358,17 @@ function menu_test_callback() {
   return 'This is menu_test_callback().';
 }
 
+/**
+ * Callback that test menu_test_menu_tree_set_path().
+ */
+function menu_test_menu_trail_callback() {
+  $menu_path = variable_get('menu_test_menu_tree_set_path', array());
+  if (!empty($menu_path)) {
+    menu_tree_set_path($menu_path['menu_name'], $menu_path['path']);
+  }
+  return 'This is menu_test_menu_trail_callback().';
+}
+
 /**
  * Page callback to use when testing the theme callback functionality.
  *
diff --git a/modules/simpletest/tests/module_test.info b/modules/simpletest/tests/module_test.info
index 628b65bfa33c629f9c128d5bd592efa6b3aa7584..a69f57682241706dd26f89760b69f2f3d78527fc 100644
--- a/modules/simpletest/tests/module_test.info
+++ b/modules/simpletest/tests/module_test.info
@@ -5,8 +5,8 @@ version = VERSION
 core = 7.x
 hidden = TRUE
 
-; Information added by drupal.org packaging script on 2011-08-31
-version = "7.8"
+; Information added by drupal.org packaging script on 2011-10-26
+version = "7.9"
 project = "drupal"
-datestamp = "1314817616"
+datestamp = "1319660730"
 
diff --git a/modules/simpletest/tests/path.test b/modules/simpletest/tests/path.test
index 0c8ecdac46697c0ba3897be931e8d2ef72f1fe5c..4998ffa3827e577294571ac7823b69ee15c3d556 100644
--- a/modules/simpletest/tests/path.test
+++ b/modules/simpletest/tests/path.test
@@ -171,7 +171,7 @@ class UrlAlterFunctionalTest extends DrupalWebTestCase {
     $this->assertUrlInboundAlter('alias/test2', "user/$uid/edit");
     $this->assertUrlOutboundAlter("user/$uid/edit", 'alias/test2');
 
-    // Test a non-existant user is not altered.
+    // Test a non-existent user is not altered.
     $uid++;
     $this->assertUrlInboundAlter("user/$uid", "user/$uid");
     $this->assertUrlOutboundAlter("user/$uid", "user/$uid");
diff --git a/modules/simpletest/tests/requirements1_test.info b/modules/simpletest/tests/requirements1_test.info
index a11c0d581eeb8ef1864c714f135b0e262bd54c71..59583ec0a3433f627b5d1b369d8ece833c743f5e 100644
--- a/modules/simpletest/tests/requirements1_test.info
+++ b/modules/simpletest/tests/requirements1_test.info
@@ -5,8 +5,8 @@ version = VERSION
 core = 7.x
 hidden = TRUE
 
-; Information added by drupal.org packaging script on 2011-08-31
-version = "7.8"
+; Information added by drupal.org packaging script on 2011-10-26
+version = "7.9"
 project = "drupal"
-datestamp = "1314817616"
+datestamp = "1319660730"
 
diff --git a/modules/simpletest/tests/requirements2_test.info b/modules/simpletest/tests/requirements2_test.info
index 953e3f6c29e753686093f73a5cd166178f166e30..b28b8584e9d3b2d013e6cb26ea7647af6e87de7a 100644
--- a/modules/simpletest/tests/requirements2_test.info
+++ b/modules/simpletest/tests/requirements2_test.info
@@ -7,8 +7,8 @@ version = VERSION
 core = 7.x
 hidden = TRUE
 
-; Information added by drupal.org packaging script on 2011-08-31
-version = "7.8"
+; Information added by drupal.org packaging script on 2011-10-26
+version = "7.9"
 project = "drupal"
-datestamp = "1314817616"
+datestamp = "1319660730"
 
diff --git a/modules/simpletest/tests/session_test.info b/modules/simpletest/tests/session_test.info
index 40dd9e3c7f66e9b56d5d2a376635baafd2a8d090..c5ac75d03ed1aa4ec98c70374c14f064d1882f51 100644
--- a/modules/simpletest/tests/session_test.info
+++ b/modules/simpletest/tests/session_test.info
@@ -5,8 +5,8 @@ version = VERSION
 core = 7.x
 hidden = TRUE
 
-; Information added by drupal.org packaging script on 2011-08-31
-version = "7.8"
+; Information added by drupal.org packaging script on 2011-10-26
+version = "7.9"
 project = "drupal"
-datestamp = "1314817616"
+datestamp = "1319660730"
 
diff --git a/modules/simpletest/tests/system_dependencies_test.info b/modules/simpletest/tests/system_dependencies_test.info
index ecc9710836b2ddcfd104b55f25175c8bbc5c6ee2..2114370fb1d71cdfef1ed2f9ee2f686f90ed2f24 100644
--- a/modules/simpletest/tests/system_dependencies_test.info
+++ b/modules/simpletest/tests/system_dependencies_test.info
@@ -6,8 +6,8 @@ core = 7.x
 hidden = TRUE
 dependencies[] = _missing_dependency
 
-; Information added by drupal.org packaging script on 2011-08-31
-version = "7.8"
+; Information added by drupal.org packaging script on 2011-10-26
+version = "7.9"
 project = "drupal"
-datestamp = "1314817616"
+datestamp = "1319660730"
 
diff --git a/modules/simpletest/tests/system_test.info b/modules/simpletest/tests/system_test.info
index d089a1e1971d14580ce09edeb731bb4c355e2312..cedcee6eccd09bb8496caa0286685b3e02623a88 100644
--- a/modules/simpletest/tests/system_test.info
+++ b/modules/simpletest/tests/system_test.info
@@ -6,8 +6,8 @@ core = 7.x
 files[] = system_test.module
 hidden = TRUE
 
-; Information added by drupal.org packaging script on 2011-08-31
-version = "7.8"
+; Information added by drupal.org packaging script on 2011-10-26
+version = "7.9"
 project = "drupal"
-datestamp = "1314817616"
+datestamp = "1319660730"
 
diff --git a/modules/simpletest/tests/taxonomy_test.info b/modules/simpletest/tests/taxonomy_test.info
index c419131e4959478407773ed1afb8d6f3136fa9b0..f3f181951bdd0333c7f799c73cca7e11a4af5abf 100644
--- a/modules/simpletest/tests/taxonomy_test.info
+++ b/modules/simpletest/tests/taxonomy_test.info
@@ -6,8 +6,8 @@ core = 7.x
 hidden = TRUE
 dependencies[] = taxonomy
 
-; Information added by drupal.org packaging script on 2011-08-31
-version = "7.8"
+; Information added by drupal.org packaging script on 2011-10-26
+version = "7.9"
 project = "drupal"
-datestamp = "1314817616"
+datestamp = "1319660730"
 
diff --git a/modules/simpletest/tests/theme.test b/modules/simpletest/tests/theme.test
index f1e1bd58b86ad65a1c556500017d4e414d3066ab..53557e361a0381113a1a21b0f61ec3ee548b2276 100644
--- a/modules/simpletest/tests/theme.test
+++ b/modules/simpletest/tests/theme.test
@@ -354,3 +354,29 @@ class ThemeFastTestCase extends DrupalWebTestCase {
     $this->assertText('registry not initialized', t('The registry was not initialized'));
   }
 }
+
+/**
+ * Unit tests for theme_html_tag().
+ */
+class ThemeHtmlTag extends DrupalUnitTestCase {
+  public static function getInfo() {
+    return array(
+      'name' => 'Theme HTML Tag',
+      'description' => 'Tests theme_html_tag() built-in theme functions.',
+      'group' => 'Theme',
+    );
+  }
+
+  /**
+   * Test function theme_html_tag()
+   */
+  function testThemeHtmlTag() {
+    // Test auto-closure meta tag generation
+    $tag['element'] = array('#tag' => 'meta', '#attributes' => array('name' => 'description', 'content' => 'Drupal test'));
+    $this->assertEqual('<meta name="description" content="Drupal test" />'."\n", theme_html_tag($tag), t('Test auto-closure meta tag generation.'));
+
+    // Test title tag generation
+    $tag['element'] = array('#tag' => 'title', '#value' => 'title test');
+    $this->assertEqual('<title>title test</title>'."\n", theme_html_tag($tag), t('Test title tag generation.'));
+  }
+}
diff --git a/modules/simpletest/tests/theme_test.info b/modules/simpletest/tests/theme_test.info
index b7fbce9751597da0849a888f079035c971451bfc..d8cbca21c3248351f5ab7174603e7298ca3ec1c4 100644
--- a/modules/simpletest/tests/theme_test.info
+++ b/modules/simpletest/tests/theme_test.info
@@ -5,8 +5,8 @@ version = VERSION
 core = 7.x
 hidden = TRUE
 
-; Information added by drupal.org packaging script on 2011-08-31
-version = "7.8"
+; Information added by drupal.org packaging script on 2011-10-26
+version = "7.9"
 project = "drupal"
-datestamp = "1314817616"
+datestamp = "1319660730"
 
diff --git a/modules/simpletest/tests/update_test_1.info b/modules/simpletest/tests/update_test_1.info
index ccb7dde7ec6c09b7a87dcaad051c15349e74da1e..b0be1fcacdaab812abafbf22fd92eb486e436e63 100644
--- a/modules/simpletest/tests/update_test_1.info
+++ b/modules/simpletest/tests/update_test_1.info
@@ -5,8 +5,8 @@ version = VERSION
 core = 7.x
 hidden = TRUE
 
-; Information added by drupal.org packaging script on 2011-08-31
-version = "7.8"
+; Information added by drupal.org packaging script on 2011-10-26
+version = "7.9"
 project = "drupal"
-datestamp = "1314817616"
+datestamp = "1319660730"
 
diff --git a/modules/simpletest/tests/update_test_2.info b/modules/simpletest/tests/update_test_2.info
index ccb7dde7ec6c09b7a87dcaad051c15349e74da1e..b0be1fcacdaab812abafbf22fd92eb486e436e63 100644
--- a/modules/simpletest/tests/update_test_2.info
+++ b/modules/simpletest/tests/update_test_2.info
@@ -5,8 +5,8 @@ version = VERSION
 core = 7.x
 hidden = TRUE
 
-; Information added by drupal.org packaging script on 2011-08-31
-version = "7.8"
+; Information added by drupal.org packaging script on 2011-10-26
+version = "7.9"
 project = "drupal"
-datestamp = "1314817616"
+datestamp = "1319660730"
 
diff --git a/modules/simpletest/tests/update_test_3.info b/modules/simpletest/tests/update_test_3.info
index ccb7dde7ec6c09b7a87dcaad051c15349e74da1e..b0be1fcacdaab812abafbf22fd92eb486e436e63 100644
--- a/modules/simpletest/tests/update_test_3.info
+++ b/modules/simpletest/tests/update_test_3.info
@@ -5,8 +5,8 @@ version = VERSION
 core = 7.x
 hidden = TRUE
 
-; Information added by drupal.org packaging script on 2011-08-31
-version = "7.8"
+; Information added by drupal.org packaging script on 2011-10-26
+version = "7.9"
 project = "drupal"
-datestamp = "1314817616"
+datestamp = "1319660730"
 
diff --git a/modules/simpletest/tests/upgrade/drupal-6.user-password-token.database.php b/modules/simpletest/tests/upgrade/drupal-6.user-password-token.database.php
index 367c70481d8808b9079bd8d59f2adf9aa5144c66..e91b6e456730165f9e3614e22597a11aa1257dba 100644
--- a/modules/simpletest/tests/upgrade/drupal-6.user-password-token.database.php
+++ b/modules/simpletest/tests/upgrade/drupal-6.user-password-token.database.php
@@ -8,3 +8,48 @@ db_insert('variable')->fields(array(
   'value' => 's:97:"!password, !username, !site, !uri, !uri_brief, !mailto, !date, !login_uri, !edit_uri, !login_url.";',
 ))
 ->execute();
+
+db_insert('users')->fields(array(
+  'uid',
+  'name',
+  'pass',
+  'mail',
+  'mode',
+  'sort',
+  'threshold',
+  'theme',
+  'signature',
+  'signature_format',
+  'created',
+  'access',
+  'login',
+  'status',
+  'timezone',
+  'language',
+  'picture',
+  'init',
+  'data',
+))
+->values(array(
+  'uid' => 3,
+  'name' => 'hashtester',
+  // This is not a valid D7 hash, but a truncated one.
+  'pass' => '$S$DAK00p3Dkojkf4O/UizYxenguXnjv',
+  'mail' => 'hashtester@example.com',
+  'mode' => '0',
+  'sort' => '0',
+  'threshold' => '0',
+  'theme' => '',
+  'signature' => '',
+  'signature_format' => '0',
+  'created' => '1277671599',
+  'access' => '1277671612',
+  'login' => '1277671612',
+  'status' => '1',
+  'timezone' => '-21600',
+  'language' => '',
+  'picture' => '',
+  'init' => 'hashtester@example.com',
+  'data' => 'a:0:{}',
+))
+->execute();
diff --git a/modules/simpletest/tests/upgrade/upgrade.test b/modules/simpletest/tests/upgrade/upgrade.test
index 6aadee379a42fe6d301f915585742fe0ffb7ddee..7f934fe7bf8d8e8f160e9093f2fc4b9dbea1f166 100644
--- a/modules/simpletest/tests/upgrade/upgrade.test
+++ b/modules/simpletest/tests/upgrade/upgrade.test
@@ -137,7 +137,7 @@ abstract class UpgradePathTestCase extends DrupalWebTestCase {
   protected function tearDown() {
     global $user, $language;
 
-    // In case a fatal error occured that was not in the test process read the
+    // In case a fatal error occurred that was not in the test process read the
     // log to pick up any fatal errors.
     simpletest_log_read($this->testId, $this->databasePrefix, get_class($this), TRUE);
 
diff --git a/modules/simpletest/tests/upgrade/upgrade.user.test b/modules/simpletest/tests/upgrade/upgrade.user.test
index 6c669219a6f64c8fe0595545af025a4e9c8b2edb..c33ba11795797a76193a91e1cbd756361f1db62c 100644
--- a/modules/simpletest/tests/upgrade/upgrade.user.test
+++ b/modules/simpletest/tests/upgrade/upgrade.user.test
@@ -26,6 +26,9 @@ class UserUpgradePathPasswordTokenTestCase extends UpgradePathTestCase {
   public function testUserUpgrade() {
     $this->assertTrue($this->performUpgrade(), 'The upgrade was completed successfully.');
     $this->assertEqual(variable_get('user_mail_register_no_approval_required_body'), ', [user:name], [site:name], [site:url], [site:url-brief], [user:mail], [date:medium], [site:login-url], [user:edit-url], [user:one-time-login-url].', 'Existing email templates have been modified (password token involved).');
+    // Check that a non-md5 hash was untouched.
+    $pass = db_query('SELECT pass FROM {users} WHERE uid = 3')->fetchField();
+    $this->assertEqual('$S$DAK00p3Dkojkf4O/UizYxenguXnjv', $pass, 'Pre-existing non-MD5 password hash was not altered');
   }
 }
 
diff --git a/modules/simpletest/tests/url_alter_test.info b/modules/simpletest/tests/url_alter_test.info
index a989e3216ccc5d30766b6e58cbd11a9898a626e4..706d78a50ce705a1940eb29a11c7202106bbbde1 100644
--- a/modules/simpletest/tests/url_alter_test.info
+++ b/modules/simpletest/tests/url_alter_test.info
@@ -5,8 +5,8 @@ package = Testing
 version = VERSION
 hidden = TRUE
 
-; Information added by drupal.org packaging script on 2011-08-31
-version = "7.8"
+; Information added by drupal.org packaging script on 2011-10-26
+version = "7.9"
 project = "drupal"
-datestamp = "1314817616"
+datestamp = "1319660730"
 
diff --git a/modules/simpletest/tests/xmlrpc_test.info b/modules/simpletest/tests/xmlrpc_test.info
index 987935d44c59db686ebb024709657d90a0e0525c..dca67547723b6a64672c7977cde9dbb119056411 100644
--- a/modules/simpletest/tests/xmlrpc_test.info
+++ b/modules/simpletest/tests/xmlrpc_test.info
@@ -5,8 +5,8 @@ version = VERSION
 core = 7.x
 hidden = TRUE
 
-; Information added by drupal.org packaging script on 2011-08-31
-version = "7.8"
+; Information added by drupal.org packaging script on 2011-10-26
+version = "7.9"
 project = "drupal"
-datestamp = "1314817616"
+datestamp = "1319660730"
 
diff --git a/modules/statistics/statistics.info b/modules/statistics/statistics.info
index c5d85028e779466080634834f94af9620c45816e..17a5542e871619adc1d3f7fa8db04c0a4e0d797c 100644
--- a/modules/statistics/statistics.info
+++ b/modules/statistics/statistics.info
@@ -6,8 +6,8 @@ core = 7.x
 files[] = statistics.test
 configure = admin/config/system/statistics
 
-; Information added by drupal.org packaging script on 2011-08-31
-version = "7.8"
+; Information added by drupal.org packaging script on 2011-10-26
+version = "7.9"
 project = "drupal"
-datestamp = "1314817616"
+datestamp = "1319660730"
 
diff --git a/modules/syslog/syslog.info b/modules/syslog/syslog.info
index d8f37d46656749afc484cfd968b82c60d781d726..83e8063793d5446babb28bdc3608d47b2ded8621 100644
--- a/modules/syslog/syslog.info
+++ b/modules/syslog/syslog.info
@@ -5,8 +5,8 @@ version = VERSION
 core = 7.x
 files[] = syslog.test
 
-; Information added by drupal.org packaging script on 2011-08-31
-version = "7.8"
+; Information added by drupal.org packaging script on 2011-10-26
+version = "7.9"
 project = "drupal"
-datestamp = "1314817616"
+datestamp = "1319660730"
 
diff --git a/modules/system/system.admin.inc b/modules/system/system.admin.inc
index 46aa9c26738e213f234a7cd9c265ded8e1fe1101..e250bf1716bb405909573a8df442c91d119eb125 100644
--- a/modules/system/system.admin.inc
+++ b/modules/system/system.admin.inc
@@ -19,7 +19,7 @@ function system_admin_config_page() {
       SELECT m.*, ml.*
       FROM {menu_links} ml
       INNER JOIN {menu_router} m ON ml.router_path = m.path
-      WHERE ml.link_path != 'admin/help' AND menu_name = :menu_name AND ml.plid = :mlid AND hidden = 0", $admin, array('fetch' => PDO::FETCH_ASSOC));
+      WHERE ml.link_path <> 'admin/help' AND menu_name = :menu_name AND ml.plid = :mlid AND hidden = 0", $admin, array('fetch' => PDO::FETCH_ASSOC));
     foreach ($result as $item) {
       _menu_link_translate($item);
       if (!$item['access']) {
@@ -965,7 +965,7 @@ function _system_modules_build_row($info, $extra) {
   // Check the core compatibility.
   if (!isset($info['core']) || $info['core'] != DRUPAL_CORE_COMPATIBILITY) {
     $compatible = FALSE;
-    $status_short .= t('Incompatible with this version of Drupal core. ');
+    $status_short .= t('Incompatible with this version of Drupal core.');
     $status_long .= t('This version is not compatible with Drupal !core_version and should be replaced.', array('!core_version' => DRUPAL_CORE_COMPATIBILITY));
   }
 
@@ -1561,7 +1561,7 @@ function system_site_information_settings_validate($form, &$form_state) {
  */
 function system_cron_settings() {
   $form['description'] = array(
-    '#markup' => '<p>'.t('Cron takes care of running periodical tasks like checking for updates and indexing content for search.').'</p>',
+    '#markup' => '<p>' . t('Cron takes care of running periodic tasks like checking for updates and indexing content for search.') . '</p>',
   );
   $form['run'] = array(
     '#type' => 'submit',
@@ -1582,7 +1582,7 @@ function system_cron_settings() {
     '#options' => array(0 => t('Never')) + drupal_map_assoc(array(3600, 10800, 21600, 43200, 86400, 604800), 'format_interval'),
   );
 
-  return system_settings_form($form, FALSE);
+  return system_settings_form($form);
 }
 
 /**
@@ -2181,24 +2181,45 @@ function system_site_maintenance_mode() {
  * @see system_settings_form()
  */
 function system_clean_url_settings($form, &$form_state) {
-  global $base_url;
-
-  // When accessing this form using a non-clean URL, allow a re-check to make
-  // sure clean URLs can be disabled at all times.
   $available = FALSE;
-  if (strpos(request_uri(), '?q=') === FALSE || !empty($_SESSION['clean_url'])) {
+  $conflict = FALSE;
+
+  // If the request URI is a clean URL, clean URLs must be available.
+  // Otherwise, run a test.
+  if (strpos(request_uri(), '?q=') === FALSE && strpos(request_uri(), '&q=') === FALSE) {
     $available = TRUE;
   }
   else {
-    $request = drupal_http_request($base_url . '/admin/config/search/clean-urls/check');
+    $request = drupal_http_request($GLOBALS['base_url'] . '/admin/config/search/clean-urls/check');
+    // If the request returns HTTP 200, clean URLs are available.
     if (isset($request->code) && $request->code == 200) {
       $available = TRUE;
+      // If the user started the clean URL test, provide explicit feedback.
+      if (isset($form_state['input']['clean_url_test_execute'])) {
+        drupal_set_message(t('The clean URL test passed.'));
+      }
+    }
+    else {
+      // If the test failed while clean URLs are enabled, make sure clean URLs
+      // can be disabled.
+      if (variable_get('clean_url', 0)) {
+        $conflict = TRUE;
+        // Warn the user of a conflicting situation, unless after processing
+        // a submitted form.
+        if (!isset($form_state['input']['op'])) {
+          drupal_set_message(t('Clean URLs are enabled, but the clean URL test failed. Uncheck the box below to disable clean URLs.'), 'warning');
+        }
+      }
+      // If the user started the clean URL test, provide explicit feedback.
+      elseif (isset($form_state['input']['clean_url_test_execute'])) {
+        drupal_set_message(t('The clean URL test failed.'), 'warning');
+      }
     }
   }
 
-  if ($available) {
-    $_SESSION['clean_url'] = TRUE;
-
+  // Show the enable/disable form if clean URLs are available or if the user
+  // must be able to resolve a conflicting setting.
+  if ($available || $conflict) {
     $form['clean_url'] = array(
       '#type' => 'checkbox',
       '#title' => t('Enable clean URLs'),
@@ -2206,18 +2227,37 @@ function system_clean_url_settings($form, &$form_state) {
       '#description' => t('Use URLs like <code>example.com/user</code> instead of <code>example.com/?q=user</code>.'),
     );
     $form = system_settings_form($form);
+    if ($conflict) {
+      // $form_state['redirect'] needs to be set to the non-clean URL,
+      // otherwise the setting is not saved.
+      $form_state['redirect'] = url('', array('query' => array('q' => '/admin/config/search/clean-urls')));
+    }
   }
+  // Show the clean URLs test form.
   else {
     drupal_add_js(drupal_get_path('module', 'system') . '/system.js');
 
-    $form_state['redirect'] = $base_url . '/admin/config/search/clean-urls';
+    $form_state['redirect'] = url('admin/config/search/clean-urls');
     $form['clean_url_description'] = array(
       '#type' => 'markup',
-      '#markup' => '<p>' . t('Use URLs like <code>example.com/user</code> instead of <code>example.com/?q=user</code>.') . ' ' . t('If you are directed to a <em>Page not found (404)</em> error after testing for clean URLs, see the <a href="@handbook">online handbook</a>.', array('@handbook' => 'http://drupal.org/node/15365')) . '</p>',
+      '#markup' => '<p>' . t('Use URLs like <code>example.com/user</code> instead of <code>example.com/?q=user</code>.'),
     );
-    $form['clean_url_test'] = array(
-      '#type' => 'submit',
-      '#value' => t('Run the clean URL test'),
+    // Explain why the user is seeing this page and what to expect after
+    // clicking the 'Run the clean URL test' button.
+    $form['clean_url_test_result'] = array(
+      '#type' => 'markup',
+      '#markup' => '<p>' . t('Clean URLs cannot be enabled. If you are directed to this page or to a <em>Page not found (404)</em> error after testing for clean URLs, see the <a href="@handbook">online handbook</a>.', array('@handbook' => 'http://drupal.org/node/15365')) . '</p>',
+    );
+    $form['actions'] = array(
+      '#type' => 'actions',
+      'clean_url_test' => array(
+        '#type' => 'submit',
+        '#value' => t('Run the clean URL test'),
+      ),
+    );
+    $form['clean_url_test_execute'] = array(
+      '#type' => 'hidden',
+      '#value' => 1,
     );
   }
 
diff --git a/modules/system/system.api.php b/modules/system/system.api.php
index ae13d49f8a1412503082d8cef1ee96ab00064e74..ae76ab44bae60c644574d85366ba463270e8d8cd 100644
--- a/modules/system/system.api.php
+++ b/modules/system/system.api.php
@@ -544,7 +544,7 @@ function hook_cron() {
 
   // Long-running operation example, leveraging a queue:
   // Fetch feeds from other sites.
-  $result = db_query('SELECT * FROM {aggregator_feed} WHERE checked + refresh < :time AND refresh != :never', array(
+  $result = db_query('SELECT * FROM {aggregator_feed} WHERE checked + refresh < :time AND refresh <> :never', array(
     ':time' => REQUEST_TIME,
     ':never' => AGGREGATOR_CLEAR_NEVER,
   ));
@@ -672,8 +672,8 @@ function hook_element_info_alter(&$type) {
  * page logging and specialized cleanup. This hook MUST NOT print anything.
  *
  * Only use this hook if your code must run even for cached page views.
- * If you have code which must run once on all non cached pages, use
- * hook_init instead. Thats the usual case. If you implement this hook
+ * If you have code which must run once on all non-cached pages, use
+ * hook_init() instead. That is the usual case. If you implement this hook
  * and see an error like 'Call to undefined function', it is likely that
  * you are depending on the presence of a module which has not been loaded yet.
  * It is not loaded because Drupal is still in bootstrap mode.
@@ -1053,24 +1053,24 @@ function hook_menu_get_item_alter(&$router_item, $path, $original_map) {
  * MENU_LOCAL_TASK. Example:
  * @code
  * // Make "Foo settings" appear on the admin Config page
- * $items['admin/config/foo'] = array(
+ * $items['admin/config/system/foo'] = array(
  *   'title' => 'Foo settings',
  *   'type' => MENU_NORMAL_ITEM,
  *   // Page callback, etc. need to be added here.
  * );
- * // Make "Global settings" the main tab on the "Foo settings" page
- * $items['admin/config/foo/global'] = array(
- *   'title' => 'Global settings',
+ * // Make "Tab 1" the main tab on the "Foo settings" page
+ * $items['admin/config/system/foo/tab1'] = array(
+ *   'title' => 'Tab 1',
  *   'type' => MENU_DEFAULT_LOCAL_TASK,
  *   // Access callback, page callback, and theme callback will be inherited
- *   // from 'admin/config/foo', if not specified here to override.
+ *   // from 'admin/config/system/foo', if not specified here to override.
  * );
- * // Make an additional tab called "Node settings" on "Foo settings"
- * $items['admin/config/foo/node'] = array(
- *   'title' => 'Node settings',
+ * // Make an additional tab called "Tab 2" on "Foo settings"
+ * $items['admin/config/system/foo/tab2'] = array(
+ *   'title' => 'Tab 2',
  *   'type' => MENU_LOCAL_TASK,
  *   // Page callback and theme callback will be inherited from
- *   // 'admin/config/foo', if not specified here to override.
+ *   // 'admin/config/system/foo', if not specified here to override.
  *   // Need to add access callback or access arguments.
  * );
  * @endcode
@@ -1744,32 +1744,36 @@ function hook_forms($form_id, $args) {
 }
 
 /**
- * Perform setup tasks. See also, hook_init.
+ * Perform setup tasks for all page requests.
  *
  * This hook is run at the beginning of the page request. It is typically
- * used to set up global parameters which are needed later in the request.
+ * used to set up global parameters that are needed later in the request.
  *
- * Only use this hook if your code must run even for cached page views.This hook
- * is called before modules or most include files are loaded into memory.
+ * Only use this hook if your code must run even for cached page views. This
+ * hook is called before modules or most include files are loaded into memory.
  * It happens while Drupal is still in bootstrap mode.
+ *
+ * @see hook_init()
  */
 function hook_boot() {
-  // we need user_access() in the shutdown function. make sure it gets loaded
+  // We need user_access() in the shutdown function. Make sure it gets loaded.
   drupal_load('module', 'user');
   drupal_register_shutdown_function('devel_shutdown');
 }
 
 /**
- * Perform setup tasks. See also, hook_boot.
+ * Perform setup tasks for non-cached page requests.
  *
  * This hook is run at the beginning of the page request. It is typically
- * used to set up global parameters which are needed later in the request.
- * when this hook is called, all modules are already loaded in memory.
+ * used to set up global parameters that are needed later in the request.
+ * When this hook is called, all modules are already loaded in memory.
  *
  * This hook is not run on cached pages.
  *
  * To add CSS or JS that should be present on all pages, modules should not
  * implement this hook, but declare these files in their .info file.
+ *
+ * @see hook_boot()
  */
 function hook_init() {
   // Since this file should only be loaded on the front page, it cannot be
@@ -1967,6 +1971,12 @@ function hook_permission() {
 /**
  * Register a module (or theme's) theme implementations.
  *
+ * The implementations declared by this hook have two purposes: either they
+ * specify how a particular render array is to be rendered as HTML (this is
+ * usually the case if the theme function is assigned to the render array's
+ * #theme property), or they return the HTML that should be returned by an
+ * invocation of theme().
+ *
  * The following parameters are all optional.
  *
  * @param array $existing
@@ -1994,21 +2004,26 @@ function hook_permission() {
  * @return array
  *   An associative array of theme hook information. The keys on the outer
  *   array are the internal names of the hooks, and the values are arrays
- *   containing information about the hook. Each array may contain the
- *   following elements:
- *   - variables: (required if "render element" not present) An array of
- *     variables that this theme hook uses. This value allows the theme layer
- *     to properly utilize templates. Each array key represents the name of the
- *     variable and the value will be used as the default value if it is not
- *     given when theme() is called. Template implementations receive these
- *     arguments as variables in the template file. Function implementations
- *     are passed this array data in the $variables parameter.
- *   - render element: (required if "variables" not present) A string that is
- *     the name of the sole renderable element to pass to the theme function.
- *     The string represents the name of the "variable" that will hold the
- *     renderable array inside any optional preprocess or process functions.
- *     Cannot be used with the "variables" item; only one or the other, not
- *     both, can be present in a hook's info array.
+ *   containing information about the hook. Each information array must contain
+ *   either a 'variables' element or a 'render element' element, but not both.
+ *   Use 'render element' if you are theming a single element or element tree
+ *   composed of elements, such as a form array, a page array, or a single
+ *   checkbox element. Use 'variables' if your theme implementation is
+ *   intended to be called directly through theme() and has multiple arguments
+ *   for the data and style; in this case, the variables not supplied by the
+ *   calling function will be given default values and passed to the template
+ *   or theme function. The returned theme information array can contain the
+ *   following key/value pairs:
+ *   - variables: (see above) Each array key is the name of the variable, and
+ *     the value given is used as the default value if the function calling
+ *     theme() does not supply it. Template implementations receive each array
+ *     key as a variable in the template file (so they must be legal PHP
+ *     variable names). Function implementations are passed the variables in a
+ *     single $variables function argument.
+ *   - render element: (see above) The name of the renderable element or element
+ *     tree to pass to the theme function. This name is used as the name of the
+ *     variable that holds the renderable element or tree in preprocess and
+ *     process functions.
  *   - file: The file the implementation resides in. This file will be included
  *     prior to the theme being rendered, to make sure that the function or
  *     preprocess function (as needed) is actually loaded; this makes it
@@ -2119,7 +2134,7 @@ function hook_theme($existing, $type, $theme, $path) {
 function hook_theme_registry_alter(&$theme_registry) {
   // Kill the next/previous forum topic navigation links.
   foreach ($theme_registry['forum_topic_navigation']['preprocess functions'] as $key => $value) {
-    if ($value = 'template_preprocess_forum_topic_navigation') {
+    if ($value == 'template_preprocess_forum_topic_navigation') {
       unset($theme_registry['forum_topic_navigation']['preprocess functions'][$key]);
     }
   }
@@ -2627,17 +2642,21 @@ function hook_file_presave($file) {
 /**
  * Respond to a file being added.
  *
- * This hook is called before a file has been added to the database. The hook
+ * This hook is called after a file has been added to the database. The hook
  * doesn't distinguish between files created as a result of a copy or those
  * created by an upload.
  *
  * @param $file
- *   The file that is about to be saved.
+ *   The file that has been added.
  *
  * @see file_save()
  */
 function hook_file_insert($file) {
-
+  // Add a message to the log, if the file is a jpg
+  $validate = file_validate_extensions($file, 'jpg');
+  if (empty($validate)) {
+    watchdog('file', 'A jpg has been added.');
+  }
 }
 
 /**
@@ -2899,12 +2918,19 @@ function hook_requirements($phase) {
  * more tables and their related keys and indexes. A schema is defined by
  * hook_schema() which must live in your module's .install file.
  *
- * By implementing hook_schema() and specifying the tables your module
- * declares, you can easily create and drop these tables on all
- * supported database engines. You don't have to deal with the
- * different SQL dialects for table creation and alteration of the
- * supported database engines.
+ * This hook is called at both install and uninstall time, and in the latter
+ * case, it cannot rely on the .module file being loaded or hooks being known.
+ * If the .module file is needed, it may be loaded with drupal_load().
+ *
+ * The tables declared by this hook will be automatically created when
+ * the module is first enabled, and removed when the module is uninstalled.
+ * This happens before hook_install() is invoked, and after hook_uninstall()
+ * is invoked, respectively.
  *
+ * By declaring the tables used by your module via an implementation of
+ * hook_schema(), these tables will be available on all supported database
+ * engines. You don't have to deal with the different SQL dialects for table
+ * creation and alteration of the supported database engines *
  * See the Schema API Handbook at http://drupal.org/node/146843 for
  * details on schema definition structures.
  *
@@ -3060,11 +3086,13 @@ function hook_query_TAG_alter(QueryAlterableInterface $query) {
  * If the module implements hook_schema(), the database tables will
  * be created before this hook is fired.
  *
- * This hook will only be called the first time a module is enabled or after it
+ * Implementations of this hook are by convention declared in the module's
+ * .install file. The implementation can rely on the .module file being loaded.
+ * The hook will only be called the first time a module is enabled or after it
  * is re-enabled after being uninstalled. The module's schema version will be
- * set to the module's greatest numbered update hook. Because of this, anytime a
- * hook_update_N() is added to the module, this function needs to be updated to
- * reflect the current version of the database schema.
+ * set to the module's greatest numbered update hook. Because of this, any time
+ * a hook_update_N() is added to the module, this function needs to be updated
+ * to reflect the current version of the database schema.
  *
  * See the Schema API documentation at
  * @link http://drupal.org/node/146843 http://drupal.org/node/146843 @endlink
@@ -3290,9 +3318,10 @@ function hook_update_last_removed() {
  * The module should not remove its entry from the {system} table. Database
  * tables defined by hook_schema() will be removed automatically.
  *
- * The uninstall hook will fire when the module gets uninstalled but before the
- * module's database tables are removed, allowing your module to query its own
- * tables during this routine.
+ * The uninstall hook must be implemented in the module's .install file. It
+ * will fire when the module gets uninstalled but before the module's database
+ * tables are removed, allowing your module to query its own tables during
+ * this routine.
  *
  * When hook_uninstall() is called, your module will already be disabled, so
  * its .module file will not be automatically included. If you need to call API
@@ -3314,7 +3343,9 @@ function hook_uninstall() {
 /**
  * Perform necessary actions after module is enabled.
  *
- * The hook is called every time the module is enabled.
+ * The hook is called every time the module is enabled. It should be
+ * implemented in the module's .install file. The implementation can
+ * rely on the .module file being loaded.
  *
  * @see module_enable()
  * @see hook_install()
@@ -3327,7 +3358,9 @@ function hook_enable() {
 /**
  * Perform necessary actions before module is disabled.
  *
- * The hook is called every time the module is disabled.
+ * The hook is called every time the module is disabled. It should be
+ * implemented in the module's .install file. The implementation can rely
+ * on the .module file being loaded.
  *
  * @see hook_uninstall()
  * @see hook_modules_disabled()
@@ -4418,7 +4451,7 @@ function hook_menu_site_status_alter(&$menu_site_status, $path) {
 /**
  * Register information about FileTransfer classes provided by a module.
  *
- * The FileTransfer class allows transfering files over a specific type of
+ * The FileTransfer class allows transferring files over a specific type of
  * connection. Core provides classes for FTP and SSH. Contributed modules are
  * free to extend the FileTransfer base class to add other connection types,
  * and if these classes are registered via hook_filetransfer_info(), those
diff --git a/modules/system/system.info b/modules/system/system.info
index ad635623476e84c60ca65029515585dc8ff4f5c2..f91c3545ed9b9b9fc7ebcae6928cfa84466c921e 100644
--- a/modules/system/system.info
+++ b/modules/system/system.info
@@ -12,8 +12,8 @@ files[] = system.test
 required = TRUE
 configure = admin/config/system
 
-; Information added by drupal.org packaging script on 2011-08-31
-version = "7.8"
+; Information added by drupal.org packaging script on 2011-10-26
+version = "7.9"
 project = "drupal"
-datestamp = "1314817616"
+datestamp = "1319660730"
 
diff --git a/modules/system/system.install b/modules/system/system.install
index 6cbbb9ed018c543237c6985b94eec687fe902b0d..219f067d12ca98c2c93ed9a9171b6eb4eef9009c 100644
--- a/modules/system/system.install
+++ b/modules/system/system.install
@@ -2977,3 +2977,13 @@ function system_update_7071() {
  * @} End of "defgroup updates-6.x-to-7.x"
  * The next series of updates should start at 8000.
  */
+
+/**
+ * @defgroup updates-7.x-extra Extra system updates for 7.x
+ * @{
+ */
+
+/**
+ * @} End of "defgroup updates-7.x-extra"
+ * The next series of updates should start at 8000.
+ */
diff --git a/modules/system/system.module b/modules/system/system.module
index 922035df32289c4938b39af9f4516093973b374c..d0a542efb0eb428f85f865efe8dcf2c6d06f48f8 100644
--- a/modules/system/system.module
+++ b/modules/system/system.module
@@ -1359,7 +1359,7 @@ function system_library() {
     ),
   );
   $libraries['ui.mouse'] = array(
-    'title' => 'jQuery UI: Droppable',
+    'title' => 'jQuery UI: Mouse',
     'website' => 'http://docs.jquery.com/UI/Mouse',
     'version' => '1.8.7',
     'js' => array(
@@ -2912,7 +2912,7 @@ function system_get_module_admin_tasks($module, $info) {
       ->condition('ml.hidden', 0, '>=')
       ->condition('ml.module', 'system')
       ->condition('m.number_parts', 1, '>')
-      ->condition('m.page_callback', 'system_admin_menu_block_page', '!=');
+      ->condition('m.page_callback', 'system_admin_menu_block_page', '<>');
     foreach ($query->execute() as $link) {
       _menu_link_translate($link);
       if ($link['access']) {
diff --git a/modules/system/system.tar.inc b/modules/system/system.tar.inc
index fd1d3c8256a629df40df89a239e2eafc906cf389..32bf7f066e5cc9173ac34ab88e42d3e384539cee 100644
--- a/modules/system/system.tar.inc
+++ b/modules/system/system.tar.inc
@@ -169,7 +169,7 @@ class Archive_Tar // extends PEAR
     // }}}
 
     /**
-    * OS independant PHP extension load. Remember to take care
+    * OS independent PHP extension load. Remember to take care
     * on the correct extension name for case sensitive OSes.
     * The function is the copy of PEAR::loadExtension().
     *
diff --git a/modules/system/system.test b/modules/system/system.test
index d482afa229ab624c58b11ed44deb888bd38f078b..a75153f6a57ef5513ba41eb86622a0a5c1ebafd6 100644
--- a/modules/system/system.test
+++ b/modules/system/system.test
@@ -1816,7 +1816,7 @@ class TokenReplaceTestCase extends DrupalWebTestCase {
     $result = token_replace($source, array('node' => $node), array('language' => $language, 'clear' => TRUE));
     $result = $this->assertEqual($target, $result, 'Valid tokens replaced while invalid tokens cleared out.');
 
-    // Test without using the clear parameter (non-existant token untouched).
+    // Test without using the clear parameter (non-existent token untouched).
     $target .= '[user:name]';
     $target .= '[bogus:token]';
     $result = token_replace($source, array('node' => $node), array('language' => $language));
diff --git a/modules/taxonomy/taxonomy.info b/modules/taxonomy/taxonomy.info
index 5f8d55c0f377b9e3af85caba93d4949879d7c3ca..8c6a8cc3c1dbbbff115523f0e79c11b79bf79a8f 100644
--- a/modules/taxonomy/taxonomy.info
+++ b/modules/taxonomy/taxonomy.info
@@ -8,8 +8,8 @@ files[] = taxonomy.module
 files[] = taxonomy.test
 configure = admin/structure/taxonomy
 
-; Information added by drupal.org packaging script on 2011-08-31
-version = "7.8"
+; Information added by drupal.org packaging script on 2011-10-26
+version = "7.9"
 project = "drupal"
-datestamp = "1314817616"
+datestamp = "1319660730"
 
diff --git a/modules/taxonomy/taxonomy.module b/modules/taxonomy/taxonomy.module
index eb81870f998395c64ff8d1a69bb7f145e661478e..df047e70723ef31d7836a70f25112bd914a5b75f 100644
--- a/modules/taxonomy/taxonomy.module
+++ b/modules/taxonomy/taxonomy.module
@@ -441,7 +441,7 @@ function taxonomy_vocabulary_save($vocabulary) {
 
   unset($vocabulary->original);
   cache_clear_all();
-  entity_get_controller('taxonomy_vocabulary')->resetCache(array($vocabulary->vid));
+  taxonomy_vocabulary_static_reset(array($vocabulary->vid));
 
   return $status;
 }
@@ -473,7 +473,7 @@ function taxonomy_vocabulary_delete($vid) {
     module_invoke_all('entity_delete', $vocabulary, 'taxonomy_vocabulary');
 
     cache_clear_all();
-    entity_get_controller('taxonomy_vocabulary')->resetCache();
+    taxonomy_vocabulary_static_reset();
 
     return SAVED_DELETED;
   }
@@ -806,7 +806,7 @@ function taxonomy_term_is_page($term) {
 }
 
 /**
- * Clear all static cache variables for terms..
+ * Clear all static cache variables for terms.
  */
 function taxonomy_terms_static_reset() {
   drupal_static_reset('taxonomy_term_count_nodes');
@@ -819,6 +819,17 @@ function taxonomy_terms_static_reset() {
   entity_get_controller('taxonomy_term')->resetCache();
 }
 
+/**
+ * Clear all static cache variables for vocabularies.
+ *
+ * @param $ids
+ * An array of ids to reset in entity controller cache.
+ */
+function taxonomy_vocabulary_static_reset($ids = NULL) {
+  drupal_static_reset('taxonomy_vocabulary_get_names');
+  entity_get_controller('taxonomy_vocabulary')->resetCache($ids);
+}
+
 /**
  * Return an array of all vocabulary objects.
  *
@@ -836,7 +847,12 @@ function taxonomy_get_vocabularies() {
  *   An array of vocabulary ids, names, machine names, keyed by machine name.
  */
 function taxonomy_vocabulary_get_names() {
-  $names = db_query('SELECT name, machine_name, vid FROM {taxonomy_vocabulary}')->fetchAllAssoc('machine_name');
+  $names = &drupal_static(__FUNCTION__);
+
+  if (!isset($names)) {
+    $names = db_query('SELECT name, machine_name, vid FROM {taxonomy_vocabulary}')->fetchAllAssoc('machine_name');
+  }
+
   return $names;
 }
 
@@ -1049,7 +1065,7 @@ function taxonomy_get_tree($vid, $parent = 0, $max_depth = NULL, $load_entities
  * Provides a case-insensitive and trimmed mapping, to maximize the
  * likelihood of a successful match.
  *
- * @param name
+ * @param $name
  *   Name of the term to search for.
  *
  * @return
diff --git a/modules/taxonomy/taxonomy.pages.inc b/modules/taxonomy/taxonomy.pages.inc
index 0cca252d7e2a7d512ac15036ab03f8214f569502..2a8d961a3e2cf6ea38c0f5d78db585f69490c7f5 100644
--- a/modules/taxonomy/taxonomy.pages.inc
+++ b/modules/taxonomy/taxonomy.pages.inc
@@ -14,6 +14,9 @@
  *   The page content.
  */
 function taxonomy_term_page($term) {
+  // Assign the term name as the page title.
+  drupal_set_title($term->name);
+
   // Build breadcrumb based on the hierarchy of the term.
   $current = (object) array(
     'tid' => $term->tid,
diff --git a/modules/toolbar/toolbar.info b/modules/toolbar/toolbar.info
index 00c49916f5e5a5ab8d9b3a47c563aed7b9205ef3..0ce95df6fa973506081a5e62d3e2d7e3a4a99ad0 100644
--- a/modules/toolbar/toolbar.info
+++ b/modules/toolbar/toolbar.info
@@ -4,8 +4,8 @@ core = 7.x
 package = Core
 version = VERSION
 
-; Information added by drupal.org packaging script on 2011-08-31
-version = "7.8"
+; Information added by drupal.org packaging script on 2011-10-26
+version = "7.9"
 project = "drupal"
-datestamp = "1314817616"
+datestamp = "1319660730"
 
diff --git a/modules/tracker/tracker.info b/modules/tracker/tracker.info
index 34c7025b85bd912784ffdffc5a4bfa2f1abaa8b3..90c40c841440d19579935d9c179c2267abc341e4 100644
--- a/modules/tracker/tracker.info
+++ b/modules/tracker/tracker.info
@@ -6,8 +6,8 @@ version = VERSION
 core = 7.x
 files[] = tracker.test
 
-; Information added by drupal.org packaging script on 2011-08-31
-version = "7.8"
+; Information added by drupal.org packaging script on 2011-10-26
+version = "7.9"
 project = "drupal"
-datestamp = "1314817616"
+datestamp = "1319660730"
 
diff --git a/modules/translation/tests/translation_test.info b/modules/translation/tests/translation_test.info
index deab4ac30003989eed5492cade6b396c096e75e2..6411ef4d0223f96ed68a33b7b8708c48d0276668 100644
--- a/modules/translation/tests/translation_test.info
+++ b/modules/translation/tests/translation_test.info
@@ -5,8 +5,8 @@ package = Testing
 version = VERSION
 hidden = TRUE
 
-; Information added by drupal.org packaging script on 2011-08-31
-version = "7.8"
+; Information added by drupal.org packaging script on 2011-10-26
+version = "7.9"
 project = "drupal"
-datestamp = "1314817616"
+datestamp = "1319660730"
 
diff --git a/modules/translation/translation.info b/modules/translation/translation.info
index 0902dd584be2a668dd41b50e92013e0cadca697c..87c037c0df797458d47840be5a8c17fe7b8c3de0 100644
--- a/modules/translation/translation.info
+++ b/modules/translation/translation.info
@@ -6,8 +6,8 @@ version = VERSION
 core = 7.x
 files[] = translation.test
 
-; Information added by drupal.org packaging script on 2011-08-31
-version = "7.8"
+; Information added by drupal.org packaging script on 2011-10-26
+version = "7.9"
 project = "drupal"
-datestamp = "1314817616"
+datestamp = "1319660730"
 
diff --git a/modules/trigger/tests/trigger_test.info b/modules/trigger/tests/trigger_test.info
index 10df57963124771f790e0a7d5ec09cd55b24f1aa..27ae210c55c52f97671365ea18ad0c27185be150 100644
--- a/modules/trigger/tests/trigger_test.info
+++ b/modules/trigger/tests/trigger_test.info
@@ -4,8 +4,8 @@ package = Testing
 core = 7.x
 hidden = TRUE
 
-; Information added by drupal.org packaging script on 2011-08-31
-version = "7.8"
+; Information added by drupal.org packaging script on 2011-10-26
+version = "7.9"
 project = "drupal"
-datestamp = "1314817616"
+datestamp = "1319660730"
 
diff --git a/modules/trigger/trigger.info b/modules/trigger/trigger.info
index 354d8da63d48b5a69449ed816a2c23ff49eaf4f4..d2cfba3fe62a9e8e8326a3066aeda710f2c9c0ce 100644
--- a/modules/trigger/trigger.info
+++ b/modules/trigger/trigger.info
@@ -6,8 +6,8 @@ core = 7.x
 files[] = trigger.test
 configure = admin/structure/trigger
 
-; Information added by drupal.org packaging script on 2011-08-31
-version = "7.8"
+; Information added by drupal.org packaging script on 2011-10-26
+version = "7.9"
 project = "drupal"
-datestamp = "1314817616"
+datestamp = "1319660730"
 
diff --git a/modules/update/tests/aaa_update_test.info b/modules/update/tests/aaa_update_test.info
index ebe2b6f067272ad97de0d0580385c16225e9d490..a66702642245d1bf1322808f68322e4d250e2993 100644
--- a/modules/update/tests/aaa_update_test.info
+++ b/modules/update/tests/aaa_update_test.info
@@ -4,8 +4,8 @@ package = Testing
 core = 7.x
 hidden = TRUE
 
-; Information added by drupal.org packaging script on 2011-08-31
-version = "7.8"
+; Information added by drupal.org packaging script on 2011-10-26
+version = "7.9"
 project = "drupal"
-datestamp = "1314817616"
+datestamp = "1319660730"
 
diff --git a/modules/update/tests/bbb_update_test.info b/modules/update/tests/bbb_update_test.info
index 0c0e9029515b9871d24d12f4d75714f175a7610f..1757fd89877e9c2ac8c1ca6ce73b179b2cd267da 100644
--- a/modules/update/tests/bbb_update_test.info
+++ b/modules/update/tests/bbb_update_test.info
@@ -4,8 +4,8 @@ package = Testing
 core = 7.x
 hidden = TRUE
 
-; Information added by drupal.org packaging script on 2011-08-31
-version = "7.8"
+; Information added by drupal.org packaging script on 2011-10-26
+version = "7.9"
 project = "drupal"
-datestamp = "1314817616"
+datestamp = "1319660730"
 
diff --git a/modules/update/tests/ccc_update_test.info b/modules/update/tests/ccc_update_test.info
index a7bfdea408cae86e81bd35584ec893bfbc23198a..aaf929d1817410dcd9d00d651a72e284cbd95eeb 100644
--- a/modules/update/tests/ccc_update_test.info
+++ b/modules/update/tests/ccc_update_test.info
@@ -4,8 +4,8 @@ package = Testing
 core = 7.x
 hidden = TRUE
 
-; Information added by drupal.org packaging script on 2011-08-31
-version = "7.8"
+; Information added by drupal.org packaging script on 2011-10-26
+version = "7.9"
 project = "drupal"
-datestamp = "1314817616"
+datestamp = "1319660730"
 
diff --git a/modules/update/tests/update_test.info b/modules/update/tests/update_test.info
index 91ac448cbdf13d1f54914e57f745291cbedbc618..8f577b2e004c4b0b7577341bf445d5515ac24e4a 100644
--- a/modules/update/tests/update_test.info
+++ b/modules/update/tests/update_test.info
@@ -5,8 +5,8 @@ version = VERSION
 core = 7.x
 hidden = TRUE
 
-; Information added by drupal.org packaging script on 2011-08-31
-version = "7.8"
+; Information added by drupal.org packaging script on 2011-10-26
+version = "7.9"
 project = "drupal"
-datestamp = "1314817616"
+datestamp = "1319660730"
 
diff --git a/modules/update/tests/update_test.module b/modules/update/tests/update_test.module
index 4e32d336afea644da469f2cdf5d91c3a280c4fee..4acb6ef837e605af25927aa7aeda03fea82212de 100644
--- a/modules/update/tests/update_test.module
+++ b/modules/update/tests/update_test.module
@@ -12,6 +12,12 @@ function update_test_menu() {
     'access callback' => TRUE,
     'type' => MENU_CALLBACK,
   );
+  $items['503-error'] = array(
+    'title' => t('503 Service unavailable'),
+    'page callback' => 'update_callback_service_unavailable',
+    'access callback' => TRUE,
+    'type' => MENU_CALLBACK,
+  );
 
   return $items;
 }
@@ -148,3 +154,11 @@ class UpdateTestFileTransfer {
     return $form;
   }
 }
+
+/**
+ * Return an Error 503 (Service unavailable) page.
+ */
+function update_callback_service_unavailable() {
+  drupal_add_http_header('Status', '503 Service unavailable');
+  print "503 Service Temporarily Unavailable";
+}
diff --git a/modules/update/update.fetch.inc b/modules/update/update.fetch.inc
index ff69cbb114d66adf509c0c59a07c59458802465f..7ac0dbefbc2bb1555f87736823653fa9ec79b97d 100644
--- a/modules/update/update.fetch.inc
+++ b/modules/update/update.fetch.inc
@@ -143,7 +143,7 @@ function _update_process_fetch_task($project) {
 
   if (empty($fail[$fetch_url_base]) || $fail[$fetch_url_base] < $max_fetch_attempts) {
     $xml = drupal_http_request($url);
-    if (isset($xml->data)) {
+    if (!isset($xml->error) && isset($xml->data)) {
       $data = $xml->data;
     }
   }
diff --git a/modules/update/update.info b/modules/update/update.info
index ed0f29c6b8eb54e4d3862de1573da46bb54c7ee5..ecdfa5468a0634d34630a5814c53ce9097cbd51e 100644
--- a/modules/update/update.info
+++ b/modules/update/update.info
@@ -6,8 +6,8 @@ core = 7.x
 files[] = update.test
 configure = admin/reports/updates/settings
 
-; Information added by drupal.org packaging script on 2011-08-31
-version = "7.8"
+; Information added by drupal.org packaging script on 2011-10-26
+version = "7.9"
 project = "drupal"
-datestamp = "1314817616"
+datestamp = "1319660730"
 
diff --git a/modules/update/update.manager.inc b/modules/update/update.manager.inc
index 35b292905153f311aeb96008e229f88b2e092d84..59858ebe810ea6411b15786111653737d08a8804 100644
--- a/modules/update/update.manager.inc
+++ b/modules/update/update.manager.inc
@@ -162,10 +162,16 @@ function update_manager_update_form($form, $form_state = array(), $context) {
     $needs_manual = $project['project_type'] == 'core';
 
     if ($needs_manual) {
-      // Since it won't be tableselect, #weight will add an extra column to the
-      // table if it's defined, so just unset it. The order doesn't matter that
-      // much in the manual updates table, anyway.
+      // There are no checkboxes in the 'Manual updates' table so it will be
+      // rendered by theme('table'), not theme('tableselect'). Since the data
+      // formats are incompatible, we convert now to the format expected by
+      // theme('table').
       unset($entry['#weight']);
+      $attributes = $entry['#attributes'];
+      unset($entry['#attributes']);
+      $entry = array(
+        'data' => $entry,
+      ) + $attributes;
     }
     else {
       $form['project_downloads'][$name] = array(
diff --git a/modules/update/update.test b/modules/update/update.test
index a88f617e6ef1a4b166c0bd422e6612237616f43a..c0f471a0a973105debb2797ae879027f30115c94 100644
--- a/modules/update/update.test
+++ b/modules/update/update.test
@@ -13,7 +13,7 @@
  * dummy .info file data (specified via hook_system_info_alter() in the
  * update_test helper module) describing what's currently installed.  Each
  * test case defines a set of projects to install, their current state (via
- * the 'update_test_system_info' variable) and the desired availabile update
+ * the 'update_test_system_info' variable) and the desired available update
  * data (via the 'update_test_xml_map' variable), and then performs a series
  * of assertions that the report matches our expectations given the specific
  * initial state and availability scenario.
@@ -32,9 +32,9 @@ class UpdateTestHelper extends DrupalWebTestCase {
    *
    * @see update_test_mock_page()
    */
-  protected function refreshUpdateStatus($xml_map) {
+  protected function refreshUpdateStatus($xml_map, $url = 'update-test') {
     // Tell update module to fetch from the URL provided by update_test module.
-    variable_set('update_fetch_url', url('update-test', array('absolute' => TRUE)));
+    variable_set('update_fetch_url', url($url, array('absolute' => TRUE)));
     // Save the map for update_test_mock_page() to use.
     variable_set('update_test_xml_map', $xml_map);
     // Manually check the update status.
@@ -215,6 +215,16 @@ class UpdateCoreTestCase extends UpdateTestHelper {
     $this->assertNoText(t('There is a security update available for your version of Drupal.'));
   }
 
+  /**
+   * Tests the update module when the update server returns 503 (Service unavailable) errors.
+   */
+  function testServiceUnavailable() {
+    $this->refreshUpdateStatus(array(), '503-error');
+    // Ensure that no "Warning: SimpleXMLElement..." parse errors are found.
+    $this->assertNoText('SimpleXMLElement');
+    $this->assertUniqueText(t('Failed to get available update data for one project.'));
+  }
+
   protected function setSystemInfo7_0() {
     $setting = array(
       '#all' => array(
diff --git a/modules/user/tests/user_form_test.info b/modules/user/tests/user_form_test.info
index 4218378809172e7e06f26a98638c46b23d4f0e06..fb9be0c120d5597c2b0932e738c9ba1dba99ece4 100644
--- a/modules/user/tests/user_form_test.info
+++ b/modules/user/tests/user_form_test.info
@@ -5,8 +5,8 @@ version = VERSION
 core = 7.x
 hidden = TRUE
 
-; Information added by drupal.org packaging script on 2011-08-31
-version = "7.8"
+; Information added by drupal.org packaging script on 2011-10-26
+version = "7.9"
 project = "drupal"
-datestamp = "1314817616"
+datestamp = "1319660730"
 
diff --git a/modules/user/user-profile-category.tpl.php b/modules/user/user-profile-category.tpl.php
index 0de7d5d0061ce14d20615b33b016285d4f6f48c3..0a86c762a97b4cd2a88db54d5003916e008e034b 100644
--- a/modules/user/user-profile-category.tpl.php
+++ b/modules/user/user-profile-category.tpl.php
@@ -24,7 +24,7 @@
  * @see template_preprocess_user_profile_category()
  */
 ?>
-<?php if ($title) : ?>
+<?php if ($title): ?>
   <h3><?php print $title; ?></h3>
 <?php endif; ?>
 
diff --git a/modules/user/user-profile.tpl.php b/modules/user/user-profile.tpl.php
index 50e6111173630d2b64a748ba3d18b6582991b157..a1611c8353120422b28150f4453bd4ebf3159855 100644
--- a/modules/user/user-profile.tpl.php
+++ b/modules/user/user-profile.tpl.php
@@ -8,21 +8,21 @@
  * e.g., example.com/user/123. 123 being the users ID.
  *
  * Use render($user_profile) to print all profile items, or print a subset
- * such as render($content['field_example']). Always call render($user_profile)
- * at the end in order to print all remaining items. If the item is a category,
- * it will contain all its profile items. By default, $user_profile['summary']
- * is provided which contains data on the user's history. Other data can be
- * included by modules. $user_profile['user_picture'] is available
- * for showing the account picture.
+ * such as render($user_profile['user_picture']). Always call
+ * render($user_profile) at the end in order to print all remaining items. If
+ * the item is a category, it will contain all its profile items. By default,
+ * $user_profile['summary'] is provided, which contains data on the user's
+ * history. Other data can be included by modules. $user_profile['user_picture']
+ * is available for showing the account picture.
  *
  * Available variables:
  *   - $user_profile: An array of profile items. Use render() to print them.
  *   - Field variables: for each field instance attached to the user a
- *     corresponding variable is defined; e.g., $user->field_example has a
+ *     corresponding variable is defined; e.g., $account->field_example has a
  *     variable $field_example defined. When needing to access a field's raw
  *     values, developers/themers are strongly encouraged to use these
  *     variables. Otherwise they will have to explicitly specify the desired
- *     field language, e.g. $user->field_example['en'], thus overriding any
+ *     field language, e.g. $account->field_example['en'], thus overriding any
  *     language negotiation rule that was previously applied.
  *
  * @see user-profile-category.tpl.php
diff --git a/modules/user/user.info b/modules/user/user.info
index 39156ea453007a1e103ad2179a854122274b8b8c..ffd23a904e49431728c4cdba15a013d517fb603c 100644
--- a/modules/user/user.info
+++ b/modules/user/user.info
@@ -9,8 +9,8 @@ required = TRUE
 configure = admin/config/people
 stylesheets[all][] = user.css
 
-; Information added by drupal.org packaging script on 2011-08-31
-version = "7.8"
+; Information added by drupal.org packaging script on 2011-10-26
+version = "7.9"
 project = "drupal"
-datestamp = "1314817616"
+datestamp = "1319660730"
 
diff --git a/modules/user/user.install b/modules/user/user.install
index 9d855ea1d0ad09b4d576d4808ef0939d51931540..9119aac079aa46cdcda868a6780e1494fced6f06 100644
--- a/modules/user/user.install
+++ b/modules/user/user.install
@@ -428,6 +428,13 @@ function user_update_7000(&$sandbox) {
     $result = db_query_range("SELECT uid, pass FROM {users} WHERE uid > 0 ORDER BY uid", $sandbox['user_from'], $count);
     foreach ($result as $account) {
       $has_rows = TRUE;
+
+      // If the $account->pass value is not a MD5 hash (a 32 character
+      // hexadecimal string) then skip it.
+      if (!preg_match('/^[0-9a-f]{32}$/', $account->pass)) {
+        continue;
+      }
+
       $new_hash = user_hash_password($account->pass, $hash_count_log2);
       if ($new_hash) {
         // Indicate an updated password.
diff --git a/modules/user/user.module b/modules/user/user.module
index 044ad4698822f8a91efa5e435ce7637665455820..48b17af907479782df64acac8b066833e45f7c69 100644
--- a/modules/user/user.module
+++ b/modules/user/user.module
@@ -211,19 +211,19 @@ function user_field_extra_fields() {
   $return['user']['user'] = array(
     'form' => array(
       'account' => array(
-        'label' => 'User name and password',
-        'description' => t('User module account form elements'),
+        'label' => t('User name and password'),
+        'description' => t('User module account form elements.'),
         'weight' => -10,
       ),
       'timezone' => array(
-        'label' => 'Timezone',
+        'label' => t('Timezone'),
         'description' => t('User module timezone form element.'),
         'weight' => 6,
       ),
     ),
     'display' => array(
       'summary' => array(
-        'label' => 'History',
+        'label' => t('History'),
         'description' => t('User module history view element.'),
         'weight' => 5,
       ),
@@ -1007,6 +1007,7 @@ function user_account_form(&$form, &$form_state) {
 
   // Account information.
   $form['account'] = array(
+    '#type'   => 'container',
     '#weight' => -10,
   );
   // Only show name field on registration form or user can change own username.
@@ -1065,6 +1066,7 @@ function user_account_form(&$form, &$form_state) {
         '#access' => !empty($protected_values),
         '#description' => $current_pass_description,
         '#weight' => -5,
+        '#attributes' => array('autocomplete' => 'off'),
       );
       $form['#validate'][] = 'user_validate_current_pass';
     }
diff --git a/modules/user/user.pages.inc b/modules/user/user.pages.inc
index 697a82d2c2c5cf132dcc6fa28d3ca11f8f1f9142..25f4528f0264f642ec81cae9b0f56306b18c22ef 100644
--- a/modules/user/user.pages.inc
+++ b/modules/user/user.pages.inc
@@ -76,9 +76,11 @@ function user_pass_submit($form, &$form_state) {
 
   $account = $form_state['values']['account'];
   // Mail one time login URL and instructions using current language.
-  _user_mail_notify('password_reset', $account, $language);
-  watchdog('user', 'Password reset instructions mailed to %name at %email.', array('%name' => $account->name, '%email' => $account->mail));
-  drupal_set_message(t('Further instructions have been sent to your e-mail address.'));
+  $mail = _user_mail_notify('password_reset', $account, $language);
+  if (!empty($mail)) {
+    watchdog('user', 'Password reset instructions mailed to %name at %email.', array('%name' => $account->name, '%email' => $account->mail));
+    drupal_set_message(t('Further instructions have been sent to your e-mail address.'));
+  }
 
   $form_state['redirect'] = 'user';
   return;
diff --git a/profiles/minimal/minimal.info b/profiles/minimal/minimal.info
index a3d2163c133a58482c158d2fdc745e4736aaa593..8460d5a0e4ce9a37175bc3626f2577a1a38cc5e1 100644
--- a/profiles/minimal/minimal.info
+++ b/profiles/minimal/minimal.info
@@ -6,8 +6,8 @@ dependencies[] = block
 dependencies[] = dblog
 files[] = minimal.profile
 
-; Information added by drupal.org packaging script on 2011-08-31
-version = "7.8"
+; Information added by drupal.org packaging script on 2011-10-26
+version = "7.9"
 project = "drupal"
-datestamp = "1314817616"
+datestamp = "1319660730"
 
diff --git a/profiles/standard/standard.info b/profiles/standard/standard.info
index ad20cc485a7886c8fc6d536c8e22f3b434f059b9..ec9b2b9cdae95aa8ac884fec61b8bf3f5fa55bb0 100644
--- a/profiles/standard/standard.info
+++ b/profiles/standard/standard.info
@@ -25,8 +25,8 @@ dependencies[] = file
 dependencies[] = rdf
 files[] = standard.profile
 
-; Information added by drupal.org packaging script on 2011-08-31
-version = "7.8"
+; Information added by drupal.org packaging script on 2011-10-26
+version = "7.9"
 project = "drupal"
-datestamp = "1314817616"
+datestamp = "1319660730"
 
diff --git a/profiles/testing/modules/drupal_system_listing_compatible_test/drupal_system_listing_compatible_test.info b/profiles/testing/modules/drupal_system_listing_compatible_test/drupal_system_listing_compatible_test.info
index acf65afcea3ee21aba368963a6320c6ddfaed51b..3fa1c74220a2425d0c120b3779d7c60947c62bca 100644
--- a/profiles/testing/modules/drupal_system_listing_compatible_test/drupal_system_listing_compatible_test.info
+++ b/profiles/testing/modules/drupal_system_listing_compatible_test/drupal_system_listing_compatible_test.info
@@ -5,8 +5,8 @@ version = VERSION
 core = 7.x
 hidden = TRUE
 
-; Information added by drupal.org packaging script on 2011-08-31
-version = "7.8"
+; Information added by drupal.org packaging script on 2011-10-26
+version = "7.9"
 project = "drupal"
-datestamp = "1314817616"
+datestamp = "1319660730"
 
diff --git a/profiles/testing/modules/drupal_system_listing_incompatible_test/drupal_system_listing_incompatible_test.info b/profiles/testing/modules/drupal_system_listing_incompatible_test/drupal_system_listing_incompatible_test.info
index 0a922240ed934f7da9e1afde8ca59273c8537bd5..a34fd600c2ea0e40d17bd7a7ccbef2d23c589255 100644
--- a/profiles/testing/modules/drupal_system_listing_incompatible_test/drupal_system_listing_incompatible_test.info
+++ b/profiles/testing/modules/drupal_system_listing_incompatible_test/drupal_system_listing_incompatible_test.info
@@ -8,8 +8,8 @@ version = VERSION
 core = 6.x
 hidden = TRUE
 
-; Information added by drupal.org packaging script on 2011-08-31
-version = "7.8"
+; Information added by drupal.org packaging script on 2011-10-26
+version = "7.9"
 project = "drupal"
-datestamp = "1314817616"
+datestamp = "1319660730"
 
diff --git a/profiles/testing/testing.info b/profiles/testing/testing.info
index 9fea2e6bdd0f85c5c18ed911b8c6dbd69280ea95..436fad73ea6285700a707dbadc3b8849b2b3aa91 100644
--- a/profiles/testing/testing.info
+++ b/profiles/testing/testing.info
@@ -4,8 +4,8 @@ version = VERSION
 core = 7.x
 hidden = TRUE
 
-; Information added by drupal.org packaging script on 2011-08-31
-version = "7.8"
+; Information added by drupal.org packaging script on 2011-10-26
+version = "7.9"
 project = "drupal"
-datestamp = "1314817616"
+datestamp = "1319660730"
 
diff --git a/scripts/generate-d6-content.sh b/scripts/generate-d6-content.sh
index 5079c2338526b46a774eb31765f0cc98a1097dbd..fc4c68f96c7d17a83ee15a3c8b4adfa25971cf11 100644
--- a/scripts/generate-d6-content.sh
+++ b/scripts/generate-d6-content.sh
@@ -75,7 +75,7 @@ for ($i = 0; $i < 24; $i++) {
   $vocabulary['weight'] = $i;
   taxonomy_save_vocabulary($vocabulary);
   $parents = array();
-  // Vocabularies without hierarcy get one term, single parent vocabularies get
+  // Vocabularies without hierarchy get one term, single parent vocabularies get
   // one parent and one child term. Multiple parent vocabularies get three
   // terms: t0, t1, t2 where t0 is a parent of both t1 and t2.
   for ($j = 0; $j < $vocabulary['hierarchy'] + 1; $j++) {
diff --git a/scripts/run-tests.sh b/scripts/run-tests.sh
index 02e897e41763089e60c0850d88b150780a3b287d..429b28b2405f9d6f467941e34155287b7d35fcf6 100755
--- a/scripts/run-tests.sh
+++ b/scripts/run-tests.sh
@@ -67,6 +67,8 @@ if ($args['list']) {
   exit;
 }
 
+$test_list = simpletest_script_get_test_list();
+
 // Try to allocate unlimited time to run the tests.
 drupal_set_time_limit(0);
 
@@ -122,7 +124,7 @@ All arguments are long options.
   --clean     Cleans up database tables or directories from previous, failed,
               tests and then exits (no tests are run).
 
-  --url       Immediately preceeds a URL to set the host and path. You will
+  --url       Immediately precedes a URL to set the host and path. You will
               need this parameter if Drupal is in a subdirectory on your
               localhost and you have not set \$base_url in settings.php. Tests
               can be run under SSL by including https:// in the URL.
@@ -485,12 +487,13 @@ function simpletest_script_reporter_init() {
     echo "\n";
   }
 
-  echo "Test run started: " . format_date($_SERVER['REQUEST_TIME'], 'long') . "\n";
+  echo "Test run started:\n";
+  echo " " . format_date($_SERVER['REQUEST_TIME'], 'long') . "\n";
   timer_start('run-tests');
   echo "\n";
 
-  echo "Test summary:\n";
-  echo "-------------\n";
+  echo "Test summary\n";
+  echo "------------\n";
   echo "\n";
 }
 
@@ -571,7 +574,7 @@ function simpletest_script_reporter_timer_stop() {
   echo "\n";
   $end = timer_stop('run-tests');
   echo "Test run duration: " . format_interval($end['time'] / 1000);
-  echo "\n";
+  echo "\n\n";
 }
 
 /**
diff --git a/sites/default/default.settings.php b/sites/default/default.settings.php
index 0472f02b1c3bdf1344cf9ddad90e302d799083c4..f8894aaf5c69877ed0d2276af0d1fa0dcce26fa9 100644
--- a/sites/default/default.settings.php
+++ b/sites/default/default.settings.php
@@ -22,19 +22,19 @@
  * http://www.drupal.org/mysite/test/, the 'settings.php'
  * is searched in the following directories:
  *
- *  1. sites/www.drupal.org.mysite.test
- *  2. sites/drupal.org.mysite.test
- *  3. sites/org.mysite.test
+ * - sites/www.drupal.org.mysite.test
+ * - sites/drupal.org.mysite.test
+ * - sites/org.mysite.test
  *
- *  4. sites/www.drupal.org.mysite
- *  5. sites/drupal.org.mysite
- *  6. sites/org.mysite
+ * - sites/www.drupal.org.mysite
+ * - sites/drupal.org.mysite
+ * - sites/org.mysite
  *
- *  7. sites/www.drupal.org
- *  8. sites/drupal.org
- *  9. sites/org
+ * - sites/www.drupal.org
+ * - sites/drupal.org
+ * - sites/org
  *
- * 10. sites/default
+ * - sites/default
  *
  * If you are installing on a non-standard port number, prefix the
  * hostname with that number. For example,
@@ -285,9 +285,10 @@ ini_set('session.cookie_lifetime', 2000000);
  * same Drupal site, you can either redirect them all to a single domain (see
  * comment in .htaccess), or uncomment the line below and specify their shared
  * base domain. Doing so assures that users remain logged in as they cross
- * between your various domains.
+ * between your various domains. Make sure to always start the $cookie_domain
+ * with a leading dot, as per RFC 2109.
  */
-# $cookie_domain = 'example.com';
+# $cookie_domain = '.example.com';
 
 /**
  * Variable overrides:
@@ -321,41 +322,49 @@ ini_set('session.cookie_lifetime', 2000000);
 # $conf['maintenance_theme'] = 'bartik';
 
 /**
- * Enable this setting to determine the correct IP address of the remote
- * client by examining information stored in the X-Forwarded-For headers.
- * X-Forwarded-For headers are a standard mechanism for identifying client
- * systems connecting through a reverse proxy server, such as Squid or
- * Pound. Reverse proxy servers are often used to enhance the performance
+ * Reverse Proxy Configuration:
+ *
+ * Reverse proxy servers are often used to enhance the performance
  * of heavily visited sites and may also provide other site caching,
- * security or encryption benefits. If this Drupal installation operates
- * behind a reverse proxy, this setting should be enabled so that correct
- * IP address information is captured in Drupal's session management,
- * logging, statistics and access management systems; if you are unsure
- * about this setting, do not have a reverse proxy, or Drupal operates in
- * a shared hosting environment, this setting should remain commented out.
+ * security, or encryption benefits. In an environment where Drupal
+ * is behind a reverse proxy, the real IP address of the client should
+ * be determined such that the correct client IP address is available
+ * to Drupal's logging, statistics, and access management systems. In
+ * the most simple scenario, the proxy server will add an
+ * X-Forwarded-For header to the request that contains the client IP
+ * address. However, HTTP headers are vulnerable to spoofing, where a
+ * malicious client could bypass restrictions by setting the
+ * X-Forwarded-For header directly. Therefore, Drupal's proxy
+ * configuration requires the IP addresses of all remote proxies to be
+ * specified in $conf['reverse_proxy_addresses'] to work correctly.
+ *
+ * Enable this setting to get Drupal to determine the client IP from
+ * the X-Forwarded-For header (or $conf['reverse_proxy_header'] if set).
+ * If you are unsure about this setting, do not have a reverse proxy,
+ * or Drupal operates in a shared hosting environment, this setting
+ * should remain commented out.
+ *
+ * In order for this setting to be used you must specify every possible
+ * reverse proxy IP address in $conf['reverse_proxy_addresses'].
+ * If a complete list of reverse proxies is not available in your
+ * environment (for example, if you use a CDN) you may set the
+ * $_SERVER['REMOTE_ADDR'] variable directly in settings.php.
+ * Be aware, however, that it is likely that this would allow IP
+ * address spoofing unless more advanced precautions are taken.
  */
 # $conf['reverse_proxy'] = TRUE;
 
 /**
- * Set this value if your proxy server sends the client IP in a header other
- * than X-Forwarded-For.
- *
- * The "X-Forwarded-For" header is a comma+space separated list of IP addresses,
- * only the last one (the left-most) will be used.
+ * Specify every reverse proxy IP address in your environment.
+ * This setting is required if $conf['reverse_proxy'] is TRUE.
  */
-# $conf['reverse_proxy_header'] = 'HTTP_X_CLUSTER_CLIENT_IP';
+# $conf['reverse_proxy_addresses'] = array('a.b.c.d', ...);
 
 /**
- * reverse_proxy accepts an array of IP addresses.
- *
- * Each element of this array is the IP address of any of your reverse
- * proxies. Filling this array Drupal will trust the information stored
- * in the X-Forwarded-For headers only if Remote IP address is one of
- * these, that is the request reaches the web server from one of your
- * reverse proxies. Otherwise, the client could directly connect to
- * your web server spoofing the X-Forwarded-For headers.
+ * Set this value if your proxy server sends the client IP in a header
+ * other than X-Forwarded-For.
  */
-# $conf['reverse_proxy_addresses'] = array('a.b.c.d', ...);
+# $conf['reverse_proxy_header'] = 'HTTP_X_CLUSTER_CLIENT_IP';
 
 /**
  * Page caching:
@@ -427,6 +436,42 @@ ini_set('session.cookie_lifetime', 2000000);
 #   'a.b.c.d',
 # );
 
+/**
+ * Fast 404 pages:
+ *
+ * Drupal can generate fully themed 404 pages. However, some of these responses
+ * are for images or other resource files that are not displayed to the user.
+ * This can waste bandwidth, and also generate server load.
+ *
+ * The options below return a simple, fast 404 page for URLs matching a
+ * specific pattern:
+ * - 404_fast_paths_exclude: A regular expression to match paths to exclude,
+ *   such as images generated by image styles, or dynamically-resized images.
+ *   If you need to add more paths, you can add '|path' to the expression.
+ * - 404_fast_paths: A regular expression to match paths that should return a
+ *   simple 404 page, rather than the fully themed 404 page. If you don't have
+ *   any aliases ending in htm or html you can add '|s?html?' to the expression.
+ * - 404_fast_html: The html to return for simple 404 pages.
+ *
+ * Add leading hash signs if you would like to disable this functionality.
+ */
+$conf['404_fast_paths_exclude'] = '/\/(?:styles)\//';
+$conf['404_fast_paths'] = '/\.(?:txt|png|gif|jpe?g|css|js|ico|swf|flv|cgi|bat|pl|dll|exe|asp)$/i';
+$conf['404_fast_html'] = '<html xmlns="http://www.w3.org/1999/xhtml"><head><title>404 Not Found</title></head><body><h1>Not Found</h1><p>The requested URL "@path" was not found on this server.</p></body></html>';
+
+/**
+ * By default, fast 404s are returned as part of the normal page request
+ * process, which will properly serve valid pages that happen to match and will
+ * also log actual 404s to the Drupal log. Alternatively you can choose to
+ * return a 404 now by uncommenting the following line. This will reduce server
+ * load, but will cause even valid pages that happen to match the pattern to
+ * return 404s, rather than the actual page. It will also prevent the Drupal
+ * system log entry. Ensure you understand the effects of this before enabling.
+ *
+ * To enable this functionality, remove the leading hash sign below.
+ */
+# drupal_fast_404();
+
 /**
  * Authorized file system operations:
  *
diff --git a/themes/bartik/bartik.info b/themes/bartik/bartik.info
index 56b166e546ed6e842fe91a64da4003a164a90ce8..36548d34c312fae8d8a7ebd3547e159560402d8b 100644
--- a/themes/bartik/bartik.info
+++ b/themes/bartik/bartik.info
@@ -34,8 +34,8 @@ regions[footer] = Footer
 settings[shortcut_module_link] = 0
 
 
-; Information added by drupal.org packaging script on 2011-08-31
-version = "7.8"
+; Information added by drupal.org packaging script on 2011-10-26
+version = "7.9"
 project = "drupal"
-datestamp = "1314817616"
+datestamp = "1319660730"
 
diff --git a/themes/garland/comment.tpl.php b/themes/garland/comment.tpl.php
index 900afc1065352f51fb6e2d71c622aa430d25cea7..952cc017032591d39c81caa3c6c8b88f9ff158f1 100644
--- a/themes/garland/comment.tpl.php
+++ b/themes/garland/comment.tpl.php
@@ -6,7 +6,7 @@
 
     <span class="submitted"><?php print $submitted ?></span>
 
-  <?php if ($new) : ?>
+  <?php if ($new): ?>
     <span class="new"><?php print drupal_ucfirst($new) ?></span>
   <?php endif; ?>
 
diff --git a/themes/garland/garland.info b/themes/garland/garland.info
index 931ccb5faafb34318fda931815f4ad6bec8f0fc3..832df4d1afc1ced4b47d966f13d210860fdc0307 100644
--- a/themes/garland/garland.info
+++ b/themes/garland/garland.info
@@ -7,8 +7,8 @@ stylesheets[all][] = style.css
 stylesheets[print][] = print.css
 settings[garland_width] = fluid
 
-; Information added by drupal.org packaging script on 2011-08-31
-version = "7.8"
+; Information added by drupal.org packaging script on 2011-10-26
+version = "7.9"
 project = "drupal"
-datestamp = "1314817616"
+datestamp = "1319660730"
 
diff --git a/themes/seven/reset.css b/themes/seven/reset.css
index 0bdc29aef80d2e7be84ed2b75d93b8895abbcc66..446d45e1690c8148f29e93ad2d0d602bb88df592 100644
--- a/themes/seven/reset.css
+++ b/themes/seven/reset.css
@@ -110,11 +110,6 @@ tr.even .form-item,
 .item-list .pager li,
 .pager-current,
 .tips,
-dl.multiselect dd,
-dl.multiselect dd .form-item,
-dl.multiselect dd select,
-dl.multiselect dt,
-dl.multiselect .form-item,
 ul.primary,
 ul.primary li,
 ul.primary li a,
diff --git a/themes/seven/seven.info b/themes/seven/seven.info
index 133430d59a3e6b85592063ff42ca5878fad81439..0aae316098c1997814f832776016e8c93c163c15 100644
--- a/themes/seven/seven.info
+++ b/themes/seven/seven.info
@@ -13,8 +13,8 @@ regions[page_bottom] = Page bottom
 regions[sidebar_first] = First sidebar
 regions_hidden[] = sidebar_first
 
-; Information added by drupal.org packaging script on 2011-08-31
-version = "7.8"
+; Information added by drupal.org packaging script on 2011-10-26
+version = "7.9"
 project = "drupal"
-datestamp = "1314817616"
+datestamp = "1319660730"
 
diff --git a/themes/seven/style-rtl.css b/themes/seven/style-rtl.css
index 6fb8b6250f88822fd853fc679d6a17458d83dbe1..a41d32547807d93c2781be46f5c4ece0d387b8c9 100644
--- a/themes/seven/style-rtl.css
+++ b/themes/seven/style-rtl.css
@@ -8,7 +8,6 @@ dl dl {
 }
 ul,
 .block ul,
-.item-list ul,
 .item-list ul {
   margin: 0.25em 1.5em 0.25em 0;
 }
@@ -177,13 +176,6 @@ ul.action-links a {
   background-position: right center;
 }
 
-/* admin/content and admin/people */
-dl.multiselect,
-dl.multiselect dt,
-dl.multiselect dd {
-  margin: 0 0 0 10px;
-}
-
 /* Update options. */
 div.admin-options label,
 div.admin-options div.form-item {
diff --git a/themes/seven/style.css b/themes/seven/style.css
index bf40a3d5cce8fbadb3b4b22ae9ac7df470baeaa7..dea99bf1b44bb6bc87b88388f4a336ee858cee3a 100644
--- a/themes/seven/style.css
+++ b/themes/seven/style.css
@@ -100,12 +100,14 @@ acronym {
 }
 ul,
 .block ul,
-.item-list ul,
 .item-list ul {
   list-style-type: disc;
   list-style-image: none;
   margin: 0.25em 0 0.25em 1.5em; /* LTR */
 }
+.item-list .pager li {
+  padding: 0.5em;
+}
 .item-list ul li,
 li.leaf,
 ul.menu li {
@@ -316,7 +318,7 @@ ul.secondary {
 }
 ul.secondary li {
   margin: 0 5px;
-  float: right; /* LTR */
+  float: none; /* LTR */
 }
 ul.secondary li a {
   background-color: #ddd;
@@ -598,11 +600,9 @@ div.teaser-checkbox .form-item,
   margin: 0;
   padding: 0;
 }
-.form-item label.option {
-  text-transform: none;
-}
 .form-item label.option {
   font-size: 0.923em;
+  text-transform: none;
 }
 .form-item label.option input {
   vertical-align: middle;
@@ -772,19 +772,6 @@ div.admin-panel h3 {
   margin-top: 0;
 }
 
-/* admin/content and admin/people */
-dl.multiselect,
-dl.multiselect dt,
-dl.multiselect dd {
-  margin: 0 10px 0 0; /* LTR */
-}
-dl.multiselect select,
-dl.multiselect dd select {
-  font-size: 0.923em;
-  background: #fff;
-  border: 1px solid #ccc;
-}
-
 /* Update options. */
 div.admin-options {
   background: #f8f8f8;
diff --git a/themes/stark/stark.info b/themes/stark/stark.info
index c8254346418781fe9e9d837f5e258dfa7b093ee5..e0c14d88aee9a0bf229b9628a71e143c253d870e 100644
--- a/themes/stark/stark.info
+++ b/themes/stark/stark.info
@@ -5,8 +5,8 @@ version = VERSION
 core = 7.x
 stylesheets[all][] = layout.css
 
-; Information added by drupal.org packaging script on 2011-08-31
-version = "7.8"
+; Information added by drupal.org packaging script on 2011-10-26
+version = "7.9"
 project = "drupal"
-datestamp = "1314817616"
+datestamp = "1319660730"
 
diff --git a/themes/tests/test_theme/test_theme.info b/themes/tests/test_theme/test_theme.info
index 7fedd3fb1389136bb0f480193a3b6c3c5157587a..b9e41384d9c225f7c010f005cdfbb36fd9c9fc9f 100644
--- a/themes/tests/test_theme/test_theme.info
+++ b/themes/tests/test_theme/test_theme.info
@@ -15,8 +15,8 @@ hidden = TRUE
 ; file within the theme folder.
 stylesheets[all][] = system.base.css
 
-; Information added by drupal.org packaging script on 2011-08-31
-version = "7.8"
+; Information added by drupal.org packaging script on 2011-10-26
+version = "7.9"
 project = "drupal"
-datestamp = "1314817616"
+datestamp = "1319660730"
 
diff --git a/themes/tests/update_test_basetheme/update_test_basetheme.info b/themes/tests/update_test_basetheme/update_test_basetheme.info
index 52aa843c1d38a43ae02b3bdafa2517b3329b6149..ed9b9f1dd1058c947a2cf4cf9d656add92dbcd8e 100644
--- a/themes/tests/update_test_basetheme/update_test_basetheme.info
+++ b/themes/tests/update_test_basetheme/update_test_basetheme.info
@@ -3,8 +3,8 @@ description = Test theme which acts as a base theme for other test subthemes.
 core = 7.x
 hidden = TRUE
 
-; Information added by drupal.org packaging script on 2011-08-31
-version = "7.8"
+; Information added by drupal.org packaging script on 2011-10-26
+version = "7.9"
 project = "drupal"
-datestamp = "1314817616"
+datestamp = "1319660730"
 
diff --git a/themes/tests/update_test_subtheme/update_test_subtheme.info b/themes/tests/update_test_subtheme/update_test_subtheme.info
index b042cf60d4d0d28922d11c9ed622bdeb009de92e..798de4f7c0344e068c844a9944c1074087c1716b 100644
--- a/themes/tests/update_test_subtheme/update_test_subtheme.info
+++ b/themes/tests/update_test_subtheme/update_test_subtheme.info
@@ -4,8 +4,8 @@ core = 7.x
 base theme = update_test_basetheme
 hidden = TRUE
 
-; Information added by drupal.org packaging script on 2011-08-31
-version = "7.8"
+; Information added by drupal.org packaging script on 2011-10-26
+version = "7.9"
 project = "drupal"
-datestamp = "1314817616"
+datestamp = "1319660730"
 
diff --git a/update.php b/update.php
index fac9ca7d95fb4948600e760970130cd649f2dbaf..b223e768569dfe6c780849eacd335416a0956be0 100644
--- a/update.php
+++ b/update.php
@@ -458,7 +458,7 @@ else {
   $output = update_access_denied_page();
 }
 if (isset($output) && $output) {
-  // Explictly start a session so that the update.php token will be accepted.
+  // Explicitly start a session so that the update.php token will be accepted.
   drupal_session_start();
   // We defer the display of messages until all updates are done.
   $progress_page = ($batch = batch_get()) && isset($batch['running']);