Skip to content
Browse files

Update Drupal Core 6.22 ==> 6.25

  • Loading branch information...
1 parent b91c215 commit 6d885e4d8ce973bc58a44d4987b5e4aec1fcf565 @kwcoffman kwcoffman committed
Showing with 1,139 additions and 666 deletions.
  1. +18 −0 CHANGELOG.txt
  2. +2 −2 INSTALL.mysql.txt
  3. +333 −268 LICENSE.txt
  4. +1 −20 includes/actions.inc
  5. +1 −1 includes/batch.inc
  6. +7 −3 includes/bootstrap.inc
  7. +50 −12 includes/common.inc
  8. +4 −3 includes/database.inc
  9. +18 −10 includes/file.inc
  10. +8 −7 includes/form.inc
  11. +19 −41 includes/locale.inc
  12. +62 −0 includes/lock-install.inc
  13. +2 −1 includes/lock.inc
  14. +3 −2 includes/menu.inc
  15. +33 −18 includes/module.inc
  16. +12 −7 includes/pager.inc
  17. +37 −0 includes/session.inc
  18. +7 −6 includes/theme.inc
  19. +0 −1 includes/unicode.entities.inc
  20. +2 −2 includes/unicode.inc
  21. +6 −0 install.php
  22. +1 −1 misc/drupal.js
  23. +12 −1 modules/aggregator/aggregator.admin.inc
  24. +3 −3 modules/aggregator/aggregator.info
  25. +43 −33 modules/aggregator/aggregator.module
  26. +3 −3 modules/block/block.info
  27. +11 −7 modules/block/block.module
  28. +3 −3 modules/blog/blog.info
  29. +1 −1 modules/blog/blog.pages.inc
  30. +3 −3 modules/blogapi/blogapi.info
  31. +3 −3 modules/book/book.info
  32. +1 −1 modules/book/book.module
  33. +3 −3 modules/color/color.info
  34. +3 −3 modules/comment/comment.info
  35. +33 −2 modules/comment/comment.install
  36. +3 −3 modules/contact/contact.info
  37. +3 −3 modules/dblog/dblog.info
  38. +3 −3 modules/filter/filter.info
  39. +3 −3 modules/forum/forum.info
  40. +1 −1 modules/forum/forum.module
  41. +3 −3 modules/help/help.info
  42. +3 −3 modules/locale/locale.info
  43. +19 −0 modules/locale/locale.install
  44. +3 −3 modules/menu/menu.info
  45. +1 −1 modules/node/node.admin.inc
  46. +3 −3 modules/node/node.info
  47. +20 −13 modules/node/node.module
  48. +3 −3 modules/openid/openid.info
  49. +6 −3 modules/openid/openid.module
  50. +3 −3 modules/path/path.info
  51. +56 −10 modules/path/path.module
  52. +3 −3 modules/php/php.info
  53. +3 −3 modules/ping/ping.info
  54. +3 −3 modules/poll/poll.info
  55. +16 −18 modules/poll/poll.module
  56. +3 −3 modules/profile/profile.info
  57. +3 −3 modules/search/search.info
  58. +2 −2 modules/search/search.module
  59. +3 −3 modules/statistics/statistics.info
  60. +3 −3 modules/syslog/syslog.info
  61. +3 −3 modules/system/system.info
  62. +39 −9 modules/system/system.module
  63. +3 −3 modules/taxonomy/taxonomy.info
  64. +75 −23 modules/taxonomy/taxonomy.module
  65. +3 −3 modules/throttle/throttle.info
  66. +3 −3 modules/tracker/tracker.info
  67. +3 −3 modules/translation/translation.info
  68. +1 −1 modules/translation/translation.module
  69. +3 −3 modules/trigger/trigger.info
  70. +1 −1 modules/trigger/trigger.module
  71. +13 −1 modules/update/update.fetch.inc
  72. +3 −3 modules/update/update.info
  73. +3 −3 modules/upload/upload.info
  74. +7 −2 modules/upload/upload.module
  75. +3 −3 modules/user/user.info
  76. +37 −12 modules/user/user.module
  77. +3 −3 themes/bluemarine/bluemarine.info
  78. +3 −3 themes/chameleon/chameleon.info
  79. +3 −3 themes/chameleon/marvin/marvin.info
  80. +0 −1 themes/engines/phptemplate/phptemplate.engine
  81. +3 −3 themes/garland/garland.info
  82. +3 −3 themes/garland/minnelli/minnelli.info
  83. +1 −1 themes/garland/style.css
  84. +3 −3 themes/pushbutton/pushbutton.info
View
18 CHANGELOG.txt
@@ -1,4 +1,22 @@
+Drupal 6.25, 2012-02-29
+----------------------
+- Fixed regressions introduced in Drupal 6.24 only.
+
+Drupal 6.24, 2012-02-01
+----------------------
+- Improved performance of search indexing and user operations by adding indexes.
+- Fixed issues with themes getting disabled due to missing locking in
+ system_theme_data().
+- Fix issue with blocks being disabled on updates in _block_rehash().
+- Further improvements to PHP 5.3, PHP 4 and PostgreSQL compatibility.
+- Improved code documentation at various places.
+- Fixed a variety of other bugs.
+
+Drupal 6.23, 2012-02-01
+----------------------
+- Fixed security issues (Cross site scripting), see SA-CORE-2012-001.
+
Drupal 6.22, 2011-05-25
----------------------
- Made Drupal 6 work better with IIS and Internet Explorer.
View
4 INSTALL.mysql.txt
@@ -20,8 +20,8 @@ initial database files. Next you must login and set the access database rights:
Again, you will be asked for the 'username' database password. At the MySQL
prompt, enter following command:
- GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, INDEX, ALTER
- ON databasename.*
+ GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, INDEX, ALTER,
+ CREATE TEMPORARY TABLES ON databasename.*
TO 'username'@'localhost' IDENTIFIED BY 'password';
where
View
601 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.
View
21 includes/actions.inc
@@ -25,25 +25,6 @@
*/
/**
- * @defgroup actions Actions
- * @{
- * Functions that perform an action on a certain system object.
- *
- * All modules should declare their action functions to be in this group and
- * each action function should reference its configuration form, validate, and
- * submit functions using \@see. Conversely, form, validate, and submit
- * functions should reference the action function using \@see. For examples of
- * this see comment_unpublish_by_keyword_action(), which has the following in
- * its doxygen documentation:
- *
- * \@ingroup actions
- * \@see comment_unpublish_by_keyword_action_form().
- * \@see comment_unpublish_by_keyword_action_submit().
- *
- * @} End of "defgroup actions".
- */
-
-/**
* Perform a given list of actions by executing their callback functions.
*
* Given the IDs of actions to perform, find out what the callbacks
@@ -355,7 +336,7 @@ function actions_synchronize($actions_in_code = array(), $delete_orphans = FALSE
else {
$link = l(t('Remove orphaned actions'), 'admin/settings/actions/orphan');
$count = count($actions_in_db);
- watchdog('actions', format_plural($count, 'One orphaned action (%orphans) exists in the actions table. !link', '@count orphaned actions (%orphans) exist in the actions table. !link'), array('@count' => $count, '%orphans' => $orphans, '!link' => $link), WATCHDOG_WARNING);
+ watchdog('actions', format_plural($count, 'One orphaned action (%orphans) exists in the actions table. !link', '@count orphaned actions (%orphans) exist in the actions table. !link'), array('@count' => $count, '%orphans' => $orphans, '!link' => $link), WATCHDOG_INFO);
}
}
}
View
2 includes/batch.inc
@@ -189,7 +189,7 @@ function _batch_process() {
call_user_func_array($function, array_merge($args, array(&$batch_context)));
}
- if ($finished == 1) {
+ if ($finished >= 1) {
// Make sure this step isn't counted double when computing $current.
$finished = 0;
// Remove the operation and clear the sandbox.
View
10 includes/bootstrap.inc
@@ -378,6 +378,10 @@ function conf_init() {
global $db_url, $db_prefix, $db_collation, $cookie_domain, $conf, $installed_profile, $update_free_access;
$conf = array();
+ if (!isset($_SERVER['SERVER_PROTOCOL']) || ($_SERVER['SERVER_PROTOCOL'] != 'HTTP/1.0' && $_SERVER['SERVER_PROTOCOL'] != 'HTTP/1.1')) {
+ $_SERVER['SERVER_PROTOCOL'] = 'HTTP/1.0';
+ }
+
if (isset($_SERVER['HTTP_HOST'])) {
// As HTTP_HOST is user input, ensure it only contains characters allowed
// in hostnames. See RFC 952 (and RFC 2181).
@@ -385,7 +389,7 @@ function conf_init() {
$_SERVER['HTTP_HOST'] = strtolower($_SERVER['HTTP_HOST']);
if (!drupal_valid_http_host($_SERVER['HTTP_HOST'])) {
// HTTP_HOST is invalid, e.g. if containing slashes it may be an attack.
- header('HTTP/1.1 400 Bad Request');
+ header($_SERVER['SERVER_PROTOCOL'] .' 400 Bad Request');
exit;
}
}
@@ -749,7 +753,7 @@ function drupal_page_cache_header($cache) {
if ($if_modified_since && $if_none_match
&& $if_none_match == $etag // etag must match
&& $if_modified_since == $last_modified) { // if-modified-since must match
- header('HTTP/1.1 304 Not Modified');
+ header($_SERVER['SERVER_PROTOCOL'] .' 304 Not Modified');
// All 304 responses must send an etag if the 200 response for the same object contained an etag
header("Etag: $etag");
return;
@@ -1149,7 +1153,7 @@ function _drupal_bootstrap($phase) {
case DRUPAL_BOOTSTRAP_ACCESS:
// Deny access to hosts which were banned - t() is not yet available.
if (drupal_is_denied('host', ip_address())) {
- header('HTTP/1.1 403 Forbidden');
+ header($_SERVER['SERVER_PROTOCOL'] .' 403 Forbidden');
print 'Sorry, '. check_plain(ip_address()) .' has been banned.';
exit();
}
View
62 includes/common.inc
@@ -31,6 +31,12 @@ if (!defined('E_DEPRECATED')) {
}
/**
+ * Error code indicating that the request made by drupal_http_request() exceeded
+ * the specified timeout.
+ */
+define('HTTP_REQUEST_TIMEOUT', -1);
+
+/**
* Set content for a specified region.
*
* @param $region
@@ -354,7 +360,7 @@ function drupal_goto($path = '', $query = NULL, $fragment = NULL, $http_response
*/
function drupal_site_offline() {
drupal_maintenance_theme();
- drupal_set_header('HTTP/1.1 503 Service unavailable');
+ drupal_set_header($_SERVER['SERVER_PROTOCOL'] .' 503 Service unavailable');
drupal_set_title(t('Site off-line'));
print theme('maintenance_page', filter_xss_admin(variable_get('site_offline_message',
t('@site is currently under maintenance. We should be back shortly. Thank you for your patience.', array('@site' => variable_get('site_name', 'Drupal'))))));
@@ -364,7 +370,7 @@ function drupal_site_offline() {
* Generates a 404 error if the request can not be handled.
*/
function drupal_not_found() {
- drupal_set_header('HTTP/1.1 404 Not Found');
+ drupal_set_header($_SERVER['SERVER_PROTOCOL'] .' 404 Not Found');
watchdog('page not found', check_plain($_GET['q']), NULL, WATCHDOG_WARNING);
@@ -394,7 +400,7 @@ function drupal_not_found() {
* Generates a 403 error if the request is not allowed.
*/
function drupal_access_denied() {
- drupal_set_header('HTTP/1.1 403 Forbidden');
+ drupal_set_header($_SERVER['SERVER_PROTOCOL'] .' 403 Forbidden');
watchdog('access denied', check_plain($_GET['q']), NULL, WATCHDOG_WARNING);
@@ -435,11 +441,15 @@ function drupal_access_denied() {
* @param $retry
* An integer representing how many times to retry the request in case of a
* redirect.
+ * @param $timeout
+ * A float representing the maximum number of seconds the function call may
+ * take. The default is 30 seconds. If a timeout occurs, the error code is set
+ * to the HTTP_REQUEST_TIMEOUT constant.
* @return
* An object containing the HTTP request headers, response code, protocol,
* status message, headers, data and redirect status.
*/
-function drupal_http_request($url, $headers = array(), $method = 'GET', $data = NULL, $retry = 3) {
+function drupal_http_request($url, $headers = array(), $method = 'GET', $data = NULL, $retry = 3, $timeout = 30.0) {
global $db_prefix;
$result = new stdClass();
@@ -459,18 +469,20 @@ function drupal_http_request($url, $headers = array(), $method = 'GET', $data =
return $result;
}
+ timer_start(__FUNCTION__);
+
switch ($uri['scheme']) {
case 'http':
case 'feed':
$port = isset($uri['port']) ? $uri['port'] : 80;
$host = $uri['host'] . ($port != 80 ? ':'. $port : '');
- $fp = @fsockopen($uri['host'], $port, $errno, $errstr, 15);
+ $fp = @fsockopen($uri['host'], $port, $errno, $errstr, $timeout);
break;
case 'https':
// Note: Only works for PHP 4.3 compiled with OpenSSL.
$port = isset($uri['port']) ? $uri['port'] : 443;
$host = $uri['host'] . ($port != 443 ? ':'. $port : '');
- $fp = @fsockopen('ssl://'. $uri['host'], $port, $errno, $errstr, 20);
+ $fp = @fsockopen('ssl://'. $uri['host'], $port, $errno, $errstr, $timeout);
break;
default:
$result->error = 'invalid schema '. $uri['scheme'];
@@ -544,11 +556,25 @@ function drupal_http_request($url, $headers = array(), $method = 'GET', $data =
$result->request = $request;
- fwrite($fp, $request);
+ // Calculate how much time is left of the original timeout value.
+ $time_left = $timeout - timer_read(__FUNCTION__) / 1000;
+ if ($time_left > 0) {
+ stream_set_timeout($fp, floor($time_left), floor(1000000 * fmod($time_left, 1)));
+ fwrite($fp, $request);
+ }
// Fetch response.
$response = '';
- while (!feof($fp) && $chunk = fread($fp, 1024)) {
+ while (!feof($fp)) {
+ // Calculate how much time is left of the original timeout value.
+ $time_left = $timeout - timer_read(__FUNCTION__) / 1000;
+ if ($time_left <= 0) {
+ $result->code = HTTP_REQUEST_TIMEOUT;
+ $result->error = 'request timed out';
+ return $result;
+ }
+ stream_set_timeout($fp, floor($time_left), floor(1000000 * fmod($time_left, 1)));
+ $chunk = fread($fp, 1024);
$response .= $chunk;
}
fclose($fp);
@@ -597,9 +623,13 @@ function drupal_http_request($url, $headers = array(), $method = 'GET', $data =
case 302: // Moved temporarily
case 307: // Moved temporarily
$location = $result->headers['Location'];
-
- if ($retry) {
- $result = drupal_http_request($result->headers['Location'], $headers, $method, $data, --$retry);
+ $timeout -= timer_read(__FUNCTION__) / 1000;
+ if ($timeout <= 0) {
+ $result->code = HTTP_REQUEST_TIMEOUT;
+ $result->error = 'request timed out';
+ }
+ elseif ($retry) {
+ $result = drupal_http_request($result->headers['Location'], $headers, $method, $data, --$retry, $timeout);
$result->redirect_code = $result->code;
}
$result->redirect_url = $location;
@@ -652,7 +682,9 @@ function drupal_error_handler($errno, $message, $filename, $line, $context) {
}
}
- $entry = check_plain($types[$errno]) .': '. filter_xss($message) .' in '. check_plain($filename) .' on line '. check_plain($line) .'.';
+ // Try to use filter_xss(). If it's too early in the bootstrap process for
+ // filter_xss() to be loaded, use check_plain() instead.
+ $entry = check_plain($types[$errno]) .': '. (function_exists('filter_xss') ? filter_xss($message) : check_plain($message)) .' in '. check_plain($filename) .' on line '. check_plain($line) .'.';
// Force display of error messages in update.php.
if (variable_get('error_level', 1) == 1 || strstr($_SERVER['SCRIPT_NAME'], 'update.php')) {
@@ -1788,8 +1820,11 @@ function drupal_add_link($attributes) {
*
* Typical candidates for caching are for example styles for nodes across
* the site, or used in the theme.
+ *
* @return
* An array of CSS files.
+ *
+ * @see drupal_get_css()
*/
function drupal_add_css($path = NULL, $type = 'module', $media = 'all', $preprocess = TRUE) {
static $css = array();
@@ -1835,8 +1870,11 @@ function drupal_add_css($path = NULL, $type = 'module', $media = 'all', $preproc
* @param $css
* (optional) An array of CSS files. If no array is provided, the default
* stylesheets array is used instead.
+ *
* @return
* A string of XHTML CSS tags.
+ *
+ * @see drupal_add_css()
*/
function drupal_get_css($css = NULL) {
$output = '';
View
7 includes/database.inc
@@ -115,10 +115,11 @@ function db_prefix_tables($sql) {
* code.
*
* @param $name
- * The name assigned to the newly active database connection. If omitted, the
+ * The key in the $db_url global variable from settings.php. If omitted, the
* default connection will be made active.
*
- * @return the name of the previously active database or FALSE if non was found.
+ * @return
+ * The name of the previously active database, or FALSE if none was found.
*/
function db_set_active($name = 'default') {
global $db_url, $db_type, $active_db;
@@ -173,7 +174,7 @@ function _db_error_page($error = '') {
global $db_type;
drupal_init_language();
drupal_maintenance_theme();
- drupal_set_header('HTTP/1.1 503 Service Unavailable');
+ drupal_set_header($_SERVER['SERVER_PROTOCOL'] .' 503 Service Unavailable');
drupal_set_title('Site off-line');
$message = '<p>The site is currently not available due to technical problems. Please try again later. Thank you for your understanding.</p>';
View
28 includes/file.inc
@@ -459,6 +459,7 @@ function file_create_filename($basename, $directory) {
}
else {
$name = $basename;
+ $ext = '';
}
$counter = 0;
@@ -682,7 +683,7 @@ function file_validate_extensions($file, $extensions) {
// Bypass validation for uid = 1.
if ($user->uid != 1) {
- $regex = '/\.('. ereg_replace(' +', '|', preg_quote($extensions)) .')$/i';
+ $regex = '/\.('. @ereg_replace(' +', '|', preg_quote($extensions)) .')$/i';
if (!preg_match($regex, $file->filename)) {
$errors[] = t('Only files with the following extensions are allowed: %files-allowed.', array('%files-allowed' => $extensions));
}
@@ -830,8 +831,13 @@ function file_save_data($data, $dest, $replace = FILE_EXISTS_RENAME) {
/**
* Set the status of a file.
*
- * @param file A Drupal file object
- * @param status A status value to set the file to.
+ * @param $file
+ * A Drupal file object.
+ * @param $status
+ * A status value to set the file to. One of:
+ * - FILE_STATUS_PERMANENT
+ * - FILE_STATUS_TEMPORARY
+ *
* @return FALSE on failure, TRUE on success and $file->status will contain the
* status.
*/
@@ -918,6 +924,7 @@ function file_download() {
/**
* Finds all files that match a given mask in a given directory.
+ *
* Directories and files beginning with a period are excluded; this
* prevents hidden files and directories (such as SVN working directories)
* from being scanned.
@@ -934,18 +941,19 @@ function file_download() {
* When TRUE, the directory scan will recurse the entire tree
* starting at the provided directory.
* @param $key
- * The key to be used for the returned array of files. Possible
- * values are "filename", for the path starting with $dir,
- * "basename", for the basename of the file, and "name" for the name
- * of the file without an extension.
+ * The key to be used for the returned associative array of files. Possible
+ * values are "filename", for the path starting with $dir; "basename", for
+ * the basename of the file; and "name" for the name of the file without the
+ * extension.
* @param $min_depth
* Minimum depth of directories to return files from.
* @param $depth
- * Current depth of recursion. This parameter is only used internally and should not be passed.
+ * Current depth of recursion. This parameter is only used internally and
+ * should not be passed in.
*
* @return
* An associative array (keyed on the provided key) of objects with
- * "path", "basename", and "name" members corresponding to the
+ * "filename", "basename", and "name" members corresponding to the
* matching files.
*/
function file_scan_directory($dir, $mask, $nomask = array('.', '..', 'CVS'), $callback = 0, $recurse = TRUE, $key = 'filename', $min_depth = 0, $depth = 0) {
@@ -959,7 +967,7 @@ function file_scan_directory($dir, $mask, $nomask = array('.', '..', 'CVS'), $ca
// Give priority to files in this folder by merging them in after any subdirectory files.
$files = array_merge(file_scan_directory("$dir/$file", $mask, $nomask, $callback, $recurse, $key, $min_depth, $depth + 1), $files);
}
- elseif ($depth >= $min_depth && ereg($mask, $file)) {
+ elseif ($depth >= $min_depth && @ereg($mask, $file)) {
// Always use this match over anything already set in $files with the same $$key.
$filename = "$dir/$file";
$basename = basename($file);
View
15 includes/form.inc
@@ -41,8 +41,8 @@
*
* For information on the format of the structured arrays used to define forms,
* and more detailed explanations of the Form API workflow, see the
- * @link http://api.drupal.org/api/file/developer/topics/forms_api_reference.html reference @endlink
- * and the @link http://api.drupal.org/api/file/developer/topics/forms_api.html quickstart guide. @endlink
+ * @link http://api.drupal.org/api/file/developer/topics/forms_api_reference.html/6 reference @endlink
+ * and the @link http://drupal.org/node/204270 Form API guide. @endlink
*/
/**
@@ -1720,9 +1720,9 @@ function expand_date($element) {
/**
* Validates the date type to stop dates like February 30, 2006.
*/
-function date_validate($form) {
- if (!checkdate($form['#value']['month'], $form['#value']['day'], $form['#value']['year'])) {
- form_error($form, t('The specified date is invalid.'));
+function date_validate($element) {
+ if (!checkdate($element['#value']['month'], $element['#value']['day'], $element['#value']['year'])) {
+ form_error($element, t('The specified date is invalid.'));
}
}
@@ -2324,8 +2324,9 @@ function form_clean_id($id = NULL, $flush = FALSE) {
* 'file' => 'path_to_file_containing_myfunctions',
* );
* batch_set($batch);
- * // only needed if not inside a form _submit handler :
- * batch_process();
+ * // Only needed if not inside a form _submit handler.
+ * // Setting redirect in batch_process.
+ * batch_process('node/1');
* @endcode
*
* Note: if the batch 'title', 'init_message', 'progress_message', or
View
60 includes/locale.inc
@@ -2158,35 +2158,12 @@ function _locale_rebuild_js($langcode = NULL) {
}
// Construct the array for JavaScript translations.
- // We sort on plural so that we have all plural forms before singular forms.
- $result = db_query("SELECT s.lid, s.source, t.plid, t.plural, t.translation FROM {locales_source} s LEFT JOIN {locales_target} t ON s.lid = t.lid AND t.language = '%s' WHERE s.location LIKE '%%.js%%' AND s.textgroup = 'default' ORDER BY t.plural DESC", $language->language);
+ // Only add strings with a translation to the translations array.
+ $result = db_query("SELECT s.lid, s.source, t.translation FROM {locales_source} s INNER JOIN {locales_target} t ON s.lid = t.lid AND t.language = '%s' WHERE s.location LIKE '%%.js%%' AND s.textgroup = 'default'", $language->language);
- $translations = $plurals = array();
+ $translations = array();
while ($data = db_fetch_object($result)) {
- // Only add this to the translations array when there is actually a translation.
- if (!empty($data->translation)) {
- if ($data->plural) {
- // When the translation is a plural form, first add it to another array and
- // wait for the singular (parent) translation.
- if (!isset($plurals[$data->plid])) {
- $plurals[$data->plid] = array($data->plural => $data->translation);
- }
- else {
- $plurals[$data->plid] += array($data->plural => $data->translation);
- }
- }
- elseif (isset($plurals[$data->lid])) {
- // There are plural translations for this translation, so get them from
- // the plurals array and add them to the final translations array.
- $translations[$data->source] = array($data->plural => $data->translation) + $plurals[$data->lid];
- unset($plurals[$data->lid]);
- }
- else {
- // There are no plural forms for this translation, so just add it to
- // the translations array.
- $translations[$data->source] = $data->translation;
- }
- }
+ $translations[$data->source] = $data->translation;
}
// Construct the JavaScript file, if there are translations.
@@ -2621,20 +2598,21 @@ function _locale_batch_build($files, $finished = NULL, $components = array()) {
$operations = array();
foreach ($files as $file) {
// We call _locale_batch_import for every batch operation.
- $operations[] = array('_locale_batch_import', array($file->filename)); }
- $batch = array(
- 'operations' => $operations,
- 'title' => $t('Importing interface translations'),
- 'init_message' => $t('Starting import'),
- 'error_message' => $t('Error importing interface translations'),
- 'file' => './includes/locale.inc',
- // This is not a batch API construct, but data passed along to the
- // installer, so we know what did we import already.
- '#components' => $components,
- );
- if (isset($finished)) {
- $batch['finished'] = $finished;
- }
+ $operations[] = array('_locale_batch_import', array($file->filename));
+ }
+ $batch = array(
+ 'operations' => $operations,
+ 'title' => $t('Importing interface translations'),
+ 'init_message' => $t('Starting import'),
+ 'error_message' => $t('Error importing interface translations'),
+ 'file' => './includes/locale.inc',
+ // This is not a batch API construct, but data passed along to the
+ // installer, so we know what did we import already.
+ '#components' => $components,
+ );
+ if (isset($finished)) {
+ $batch['finished'] = $finished;
+ }
return $batch;
}
return FALSE;
View
62 includes/lock-install.inc
@@ -0,0 +1,62 @@
+<?php
+
+/**
+ * @file
+ * A stub lock implementation to be used during the installation
+ * process when database access is not yet available. Because Drupal's
+ * install system should never be running in more than on concurrant
+ * request, we can bypass any need for locking.
+ */
+
+/**
+ * Initialize the locking system.
+ */
+function lock_init() {
+}
+
+/**
+ * Acquire (or renew) a lock, but do not block if it fails.
+ *
+ * @return
+ * TRUE if the lock was acquired, FALSE if it failed.
+ */
+function lock_acquire($name, $timeout = 30.0) {
+ return TRUE;
+}
+
+/**
+ * Check if lock acquired by a different process may be available.
+ *
+ * @return
+ * TRUE if there is no lock or it was removed, FALSE otherwise.
+ */
+function lock_may_be_available($name) {
+ return TRUE;
+}
+
+/**
+ * Wait for a lock to be available.
+ *
+ * @return
+ * TRUE if the lock holds, FALSE if it is available.
+ */
+function lock_wait($name, $delay = 30) {
+ return FALSE;
+}
+
+/**
+ * Release a lock previously acquired by lock_acquire().
+ *
+ * This will release the named lock if it is still held by the current request.
+ *
+ * @param $name
+ * The name of the lock.
+ */
+function lock_release($name) {
+}
+
+/**
+ * Release all previously acquired locks.
+ */
+function lock_release_all($lock_id = NULL) {
+}
View
3 includes/lock.inc
@@ -102,7 +102,8 @@ function lock_acquire($name, $timeout = 30.0) {
$expire = (float)$usec + (float)$sec + $timeout;
if (isset($locks[$name])) {
// Try to extend the expiration of a lock we already acquired.
- if (!db_result(db_query("UPDATE {semaphore} SET expire = %f WHERE name = '%s' AND value = '%s'", $expire, $name, _lock_id()))) {
+ db_query("UPDATE {semaphore} SET expire = %f WHERE name = '%s' AND value = '%s'", $expire, $name, _lock_id());
+ if (!db_affected_rows()) {
// The lock was broken.
unset($locks[$name]);
}
View
5 includes/menu.inc
@@ -48,8 +48,9 @@
* Access to the callback functions is also protected by the menu system.
* The "access callback" with an optional "access arguments" of each menu
* item is called before the page callback proceeds. If this returns TRUE,
- * then access is granted; if FALSE, then access is denied. Menu items may
- * omit this attribute to use the value provided by an ancestor item.
+ * then access is granted; if FALSE, then access is denied. Default local task
+ * menu items (see next paragraph) may omit this attribute to use the value
+ * provided by the parent item.
*
* In the default Drupal interface, you will notice many links rendered as
* tabs. These are known in the menu system as "local tasks", and they are
View
51 includes/module.inc
@@ -93,6 +93,14 @@ function module_list($refresh = FALSE, $bootstrap = TRUE, $sort = FALSE, $fixed_
* The array of filesystem objects used to rebuild the cache.
*/
function module_rebuild_cache() {
+ $write_database = TRUE;
+ // If lock not acquired, return $files data without writing to database.
+ if (!lock_acquire('module_rebuild_cache')) {
+ $write_database = FALSE;
+ // Wait for the parallel thread to be done so we are more likely
+ // to get updated and consistent data.
+ lock_wait('module_rebuild_cache');
+ }
// Get current list of modules
$files = drupal_system_listing('\.module$', 'modules', 'name', 0);
@@ -119,32 +127,39 @@ function module_rebuild_cache() {
unset($files[$filename]);
continue;
}
- // Merge in defaults and save.
- $files[$filename]->info = $file->info + $defaults;
// Invoke hook_system_info_alter() to give installed modules a chance to
// modify the data in the .info files if necessary.
drupal_alter('system_info', $files[$filename]->info, $files[$filename]);
- // Log the critical hooks implemented by this module.
- $bootstrap = 0;
- foreach (bootstrap_hooks() as $hook) {
- if (module_hook($file->name, $hook)) {
- $bootstrap = 1;
- break;
+ // Merge in defaults and save.
+ $files[$filename]->info = $file->info + $defaults;
+ }
+
+ // If lock not acquired, return $files data without writing to database.
+ if ($write_database) {
+ foreach ($files as $filename => $file) {
+ // Log the critical hooks implemented by this module.
+ $bootstrap = 0;
+ foreach (bootstrap_hooks() as $hook) {
+ if (module_hook($file->name, $hook)) {
+ $bootstrap = 1;
+ break;
+ }
}
- }
- // Update the contents of the system table:
- if (isset($file->status) || (isset($file->old_filename) && $file->old_filename != $file->filename)) {
- db_query("UPDATE {system} SET info = '%s', name = '%s', filename = '%s', bootstrap = %d WHERE filename = '%s'", serialize($files[$filename]->info), $file->name, $file->filename, $bootstrap, $file->old_filename);
- }
- else {
- // This is a new module.
- $files[$filename]->status = 0;
- $files[$filename]->throttle = 0;
- db_query("INSERT INTO {system} (name, info, type, filename, status, throttle, bootstrap) VALUES ('%s', '%s', '%s', '%s', %d, %d, %d)", $file->name, serialize($files[$filename]->info), 'module', $file->filename, 0, 0, $bootstrap);
+ // Update the contents of the system table:
+ if (isset($file->status)) {
+ db_query("UPDATE {system} SET info = '%s', name = '%s', filename = '%s', bootstrap = %d WHERE filename = '%s'", serialize($files[$filename]->info), $file->name, $file->filename, $bootstrap, $file->old_filename);
+ }
+ else {
+ // This is a new module.
+ $files[$filename]->status = 0;
+ $files[$filename]->throttle = 0;
+ db_query("INSERT INTO {system} (name, info, type, filename, status, throttle, bootstrap) VALUES ('%s', '%s', '%s', '%s', %d, %d, %d)", $file->name, serialize($files[$filename]->info), 'module', $file->filename, 0, 0, $bootstrap);
+ }
}
+ lock_release('module_rebuild_cache');
}
$files = _module_build_dependencies($files);
return $files;
View
19 includes/pager.inc
@@ -90,7 +90,7 @@ function pager_get_querystring() {
}
/**
- * Format a query pager.
+ * Returns HTML for a query pager.
*
* Menu callbacks that display paged query results should call theme('pager') to
* retrieve a pager control so that users can view other results.
@@ -223,7 +223,7 @@ function theme_pager($tags = array(), $limit = 10, $element = 0, $parameters = a
*/
/**
- * Format a "first page" link.
+ * Returns HTML for a "first page" link.
*
* @param $text
* The name (or image) of the link.
@@ -251,7 +251,7 @@ function theme_pager_first($text, $limit, $element = 0, $parameters = array()) {
}
/**
- * Format a "previous page" link.
+ * Returns HTML for a "previous page" link.
*
* @param $text
* The name (or image) of the link.
@@ -290,7 +290,7 @@ function theme_pager_previous($text, $limit, $element = 0, $interval = 1, $param
}
/**
- * Format a "next page" link.
+ * Returns HTML for a "next page" link.
*
* @param $text
* The name (or image) of the link.
@@ -328,7 +328,7 @@ function theme_pager_next($text, $limit, $element = 0, $interval = 1, $parameter
}
/**
- * Format a "last page" link.
+ * Returns HTML for a "last page" link.
*
* @param $text
* The name (or image) of the link.
@@ -357,8 +357,13 @@ function theme_pager_last($text, $limit, $element = 0, $parameters = array()) {
/**
- * Format a link to a specific query result page.
+ * Returns HTML for a link to a specific query result page.
*
+ * @param $text
+ * The link text. Also used to figure out the title attribute of the link,
+ * if it is not provided in $attributes['title']; in this case, $text must
+ * be one of the standard pager link text strings that would be generated by
+ * the pager theme functions, such as a number or t('« first').
* @param $page_new
* The first result to display on the linked page.
* @param $element
@@ -366,7 +371,7 @@ function theme_pager_last($text, $limit, $element = 0, $parameters = array()) {
* @param $parameters
* An associative array of query string parameters to append to the pager link.
* @param $attributes
- * An associative array of HTML attributes to apply to a pager anchor tag.
+ * An associative array of HTML attributes to apply to the pager link.
* @return
* An HTML string that generates the link.
*
View
37 includes/session.inc
@@ -13,6 +13,25 @@ function sess_close() {
return TRUE;
}
+/**
+ * Reads an entire session from the database (internal use only).
+ *
+ * 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 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 $key
+ * The session ID of the session to retrieve.
+ *
+ * @return
+ * The user's session, or an empty string if no session exists.
+ */
function sess_read($key) {
global $user;
@@ -54,6 +73,24 @@ function sess_read($key) {
return $user->session;
}
+/**
+ * Writes an entire session to the database (internal use only).
+ *
+ * This function is registered with session_set_save_handler() to support
+ * database-backed sessions.
+ *
+ * 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 $key
+ * The session ID of the session to write to.
+ * @param $value
+ * Session data to write as a serialized string.
+ *
+ * @return
+ * Always returns TRUE.
+ */
function sess_write($key, $value) {
global $user;
View
13 includes/theme.inc
@@ -523,7 +523,7 @@ function list_themes($refresh = FALSE) {
}
/**
- * Generate the themed output.
+ * Generates the themed output.
*
* All requests for theme hooks must go through this function. It examines
* the request and routes it to the appropriate theme function. The theme
@@ -539,14 +539,14 @@ function list_themes($refresh = FALSE) {
* functions may be used to modify the $variables array. They are processed in
* this order when available:
*
- * - template_preprocess(&$variables)
+ * - template_preprocess(&$variables, $hook)
* This sets a default set of variables for all template implementations.
*
* - template_preprocess_HOOK(&$variables)
* This is the first preprocessor called specific to the hook; it should be
* implemented by the module that registers it.
*
- * - MODULE_preprocess(&$variables)
+ * - MODULE_preprocess(&$variables, $hook)
* This will be called for all templates; it should only be used if there
* is a real need. It's purpose is similar to template_preprocess().
*
@@ -557,7 +557,7 @@ function list_themes($refresh = FALSE) {
* preprocess function of foo_preprocess_node() can be created to intercept
* and alter the variable.
*
- * - ENGINE_engine_preprocess(&$variables)
+ * - ENGINE_engine_preprocess(&$variables, $hook)
* This function should only be implemented by theme engines and exists
* so that it can set necessary variables for all hooks.
*
@@ -565,7 +565,7 @@ function list_themes($refresh = FALSE) {
* This is the same as the previous function, but it is called for a single
* theming hook.
*
- * - ENGINE_preprocess(&$variables)
+ * - ENGINE_preprocess(&$variables, $hook)
* This is meant to be used by themes that utilize a theme engine. It is
* provided so that the preprocessor is not locked into a specific theme.
* This makes it easy to share and transport code but theme authors must be
@@ -581,7 +581,7 @@ function list_themes($refresh = FALSE) {
* The same applies from the previous function, but it is called for a
* specific hook.
*
- * - THEME_preprocess(&$variables)
+ * - THEME_preprocess(&$variables, $hook)
* These functions are based upon the raw theme; they should primarily be
* used by themes that do not use an engine or by sub-themes. It serves the
* same purpose as ENGINE_preprocess().
@@ -606,6 +606,7 @@ function list_themes($refresh = FALSE) {
* implementations for named objects.
* @param ...
* Additional arguments to pass along to the theme function.
+ *
* @return
* An HTML string that generates the themed output.
*/
View
1 includes/unicode.entities.inc
@@ -1,5 +1,4 @@
<?php
-// $Id $
/**
* @file
View
4 includes/unicode.inc
@@ -134,7 +134,7 @@ function drupal_xml_parser_create(&$data) {
}
// Check for an encoding declaration in the XML prolog if no BOM was found.
- if (!$bom && ereg('^<\?xml[^>]+encoding="([^"]+)"', $data, $match)) {
+ if (!$bom && @ereg('^<\?xml[^>]+encoding="([^"]+)"', $data, $match)) {
$encoding = $match[1];
}
@@ -144,7 +144,7 @@ function drupal_xml_parser_create(&$data) {
$out = drupal_convert_to_utf8($data, $encoding);
if ($out !== FALSE) {
$encoding = 'utf-8';
- $data = ereg_replace('^(<\?xml[^>]+encoding)="([^"]+)"', '\\1="utf-8"', $out);
+ $data = @ereg_replace('^(<\?xml[^>]+encoding)="([^"]+)"', '\\1="utf-8"', $out);
}
else {
watchdog('php', 'Could not convert XML encoding %s to UTF-8.', array('%s' => $encoding), WATCHDOG_WARNING);
View
6 install.php
@@ -130,6 +130,12 @@ function install_main() {
if (!$verify) {
install_change_settings($profile, $install_locale);
}
+ // The default lock implementation uses a database table,
+ // so we cannot use it for install, but we still need
+ // the API functions available.
+ require_once './includes/lock-install.inc';
+ $conf['lock_inc'] = './includes/lock-install.inc';
+ lock_init();
// Install system.module.
drupal_install_system();
View
2 misc/drupal.js
@@ -149,7 +149,7 @@ Drupal.formatPlural = function(count, singular, plural, args) {
else {
args['@count['+ index +']'] = args['@count'];
delete args['@count'];
- return Drupal.t(plural.replace('@count', '@count['+ index +']'));
+ return Drupal.t(plural.replace('@count', '@count['+ index +']'), args);
}
};
View
13 modules/aggregator/aggregator.admin.inc
@@ -26,7 +26,15 @@ function aggregator_view() {
$header = array(t('Title'), t('Items'), t('Last update'), t('Next update'), array('data' => t('Operations'), 'colspan' => '3'));
$rows = array();
while ($feed = db_fetch_object($result)) {
- $rows[] = array(l($feed->title, "aggregator/sources/$feed->fid"), format_plural($feed->items, '1 item', '@count items'), ($feed->checked ? t('@time ago', array('@time' => format_interval(time() - $feed->checked))) : t('never')), ($feed->checked ? t('%time left', array('%time' => format_interval($feed->checked + $feed->refresh - time()))) : t('never')), l(t('edit'), "admin/content/aggregator/edit/feed/$feed->fid"), l(t('remove items'), "admin/content/aggregator/remove/$feed->fid"), l(t('update items'), "admin/content/aggregator/update/$feed->fid"));
+ $rows[] = array(
+ l($feed->title, "aggregator/sources/$feed->fid"),
+ format_plural($feed->items, '1 item', '@count items'),
+ ($feed->checked ? t('@time ago', array('@time' => format_interval(time() - $feed->checked))) : t('never')),
+ ($feed->checked ? t('%time left', array('%time' => format_interval($feed->checked + $feed->refresh - time()))) : t('never')),
+ l(t('edit'), "admin/content/aggregator/edit/feed/$feed->fid"),
+ l(t('remove items'), "admin/content/aggregator/remove/$feed->fid"),
+ l(t('update items'), "admin/content/aggregator/update/$feed->fid", array('query' => array('token' => drupal_get_token("aggregator/update/$feed->fid")))),
+ );
}
$output .= theme('table', $header, $rows);
@@ -209,6 +217,9 @@ function aggregator_admin_remove_feed_submit($form, &$form_state) {
* An associative array describing the feed to be refreshed.
*/
function aggregator_admin_refresh_feed($feed) {
+ if (!isset($_GET['token']) || !drupal_valid_token($_GET['token'], 'aggregator/update/' . $feed['fid'])) {
+ return drupal_access_denied();
+ }
aggregator_refresh($feed);
drupal_goto('admin/content/aggregator');
}
View
6 modules/aggregator/aggregator.info
@@ -4,8 +4,8 @@ package = Core - optional
version = VERSION
core = 6.x
-; Information added by drupal.org packaging script on 2011-05-25
-version = "6.22"
+; Information added by drupal.org packaging script on 2012-02-29
+version = "6.25"
project = "drupal"
-datestamp = "1306357015"
+datestamp = "1330534547"
View
76 modules/aggregator/aggregator.module
@@ -298,38 +298,38 @@ function aggregator_cron() {
* Generates blocks for the latest news items in each category and feed.
*/
function aggregator_block($op = 'list', $delta = 0, $edit = array()) {
- if (user_access('access news feeds')) {
- if ($op == 'list') {
- $result = db_query('SELECT cid, title FROM {aggregator_category} ORDER BY title');
- while ($category = db_fetch_object($result)) {
- $block['category-'. $category->cid]['info'] = t('!title category latest items', array('!title' => $category->title));
- }
- $result = db_query('SELECT fid, title FROM {aggregator_feed} ORDER BY fid');
- while ($feed = db_fetch_object($result)) {
- $block['feed-'. $feed->fid]['info'] = t('!title feed latest items', array('!title' => $feed->title));
- }
+ if ($op == 'list') {
+ $result = db_query('SELECT cid, title FROM {aggregator_category} ORDER BY title');
+ while ($category = db_fetch_object($result)) {
+ $block['category-'. $category->cid]['info'] = t('!title category latest items', array('!title' => $category->title));
}
- else if ($op == 'configure') {
- list($type, $id) = explode('-', $delta);
- if ($type == 'category') {
- $value = db_result(db_query('SELECT block FROM {aggregator_category} WHERE cid = %d', $id));
- }
- else {
- $value = db_result(db_query('SELECT block FROM {aggregator_feed} WHERE fid = %d', $id));
- }
- $form['block'] = array('#type' => 'select', '#title' => t('Number of news items in block'), '#default_value' => $value, '#options' => drupal_map_assoc(array(2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20)));
- return $form;
+ $result = db_query('SELECT fid, title FROM {aggregator_feed} ORDER BY fid');
+ while ($feed = db_fetch_object($result)) {
+ $block['feed-'. $feed->fid]['info'] = t('!title feed latest items', array('!title' => $feed->title));
}
- else if ($op == 'save') {
- list($type, $id) = explode('-', $delta);
- if ($type == 'category') {
- $value = db_query('UPDATE {aggregator_category} SET block = %d WHERE cid = %d', $edit['block'], $id);
- }
- else {
- $value = db_query('UPDATE {aggregator_feed} SET block = %d WHERE fid = %d', $edit['block'], $id);
- }
+ }
+ else if ($op == 'configure') {
+ list($type, $id) = explode('-', $delta);
+ if ($type == 'category') {
+ $value = db_result(db_query('SELECT block FROM {aggregator_category} WHERE cid = %d', $id));
}
- else if ($op == 'view') {
+ else {
+ $value = db_result(db_query('SELECT block FROM {aggregator_feed} WHERE fid = %d', $id));
+ }
+ $form['block'] = array('#type' => 'select', '#title' => t('Number of news items in block'), '#default_value' => $value, '#options' => drupal_map_assoc(array(2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20)));
+ return $form;
+ }
+ else if ($op == 'save') {
+ list($type, $id) = explode('-', $delta);
+ if ($type == 'category') {
+ $value = db_query('UPDATE {aggregator_category} SET block = %d WHERE cid = %d', $edit['block'], $id);
+ }
+ else {
+ $value = db_query('UPDATE {aggregator_feed} SET block = %d WHERE fid = %d', $edit['block'], $id);
+ }
+ }
+ else if ($op == 'view') {
+ if (user_access('access news feeds')) {
list($type, $id) = explode('-', $delta);
switch ($type) {
case 'feed':
@@ -358,9 +358,9 @@ function aggregator_block($op = 'list', $delta = 0, $edit = array()) {
$block['content'] = theme('item_list', $items) . $read_more;
}
}
- if (isset($block)) {
- return $block;
- }
+ }
+ if (isset($block)) {
+ return $block;
}
}
@@ -751,7 +751,17 @@ function aggregator_parse_feed(&$data, $feed) {
else {
$link = $feed['link'];
}
- $guid = isset($item['GUID']) ? $item['GUID'] : '';
+
+ // Atom feeds use ID rather than GUID.
+ if (isset($item['GUID'])) {
+ $guid = $item['GUID'];
+ }
+ elseif (isset($item['ID'])) {
+ $guid = $item['ID'];
+ }
+ else {
+ $guid = '';
+ }
// Atom feeds have a CONTENT and/or SUMMARY tag instead of a DESCRIPTION tag.
if (!empty($item['CONTENT:ENCODED'])) {
View
6 modules/block/block.info
@@ -4,8 +4,8 @@ package = Core - required
version = VERSION
core = 6.x
-; Information added by drupal.org packaging script on 2011-05-25
-version = "6.22"
+; Information added by drupal.org packaging script on 2012-02-29
+version = "6.25"
project = "drupal"
-datestamp = "1306357015"
+datestamp = "1330534547"
View
18 modules/block/block.module
@@ -301,8 +301,12 @@ function _block_rehash($theme = NULL) {
// Remove blocks that are no longer defined by the code from the database.
foreach ($old_blocks as $module => $old_module_blocks) {
- foreach ($old_module_blocks as $delta => $block) {
- db_query("DELETE FROM {blocks} WHERE module = '%s' AND delta = '%s' AND theme = '%s'", $module, $delta, $theme);
+ // This cleanup does not apply to disabled modules, to avoid configuration
+ // being lost when modules are disabled.
+ if (module_exists($module)) {
+ foreach ($old_module_blocks as $delta => $block) {
+ db_query("DELETE FROM {blocks} WHERE module = '%s' AND delta = '%s' AND theme = '%s'", $module, $delta, $theme);
+ }
}
}
return $blocks;
@@ -437,14 +441,14 @@ function block_user($type, $edit, &$account, $category = NULL) {
* The name of a region.
*
* @return
- * An array of block objects, indexed with <i>module</i>_<i>delta</i>.
- * If you are displaying your blocks in one or two sidebars, you may check
- * whether this array is empty to see how many columns are going to be
- * displayed.
+ * An array of block objects, indexed with module name and block delta
+ * concatenated with an underscore, thus: MODULE_DELTA. If you are displaying
+ * your blocks in one or two sidebars, you may check whether this array is
+ * empty to see how many columns are going to be displayed.
*
* @todo
* Now that the blocks table has a primary key, we should use that as the
- * array key instead of <i>module</i>_<i>delta</i>.
+ * array key instead of MODULE_DELTA.
*/
function block_list($region) {
global $user, $theme_key;
View
6 modules/blog/blog.info
@@ -4,8 +4,8 @@ package = Core - optional
version = VERSION
core = 6.x
-; Information added by drupal.org packaging script on 2011-05-25
-version = "6.22"
+; Information added by drupal.org packaging script on 2012-02-29
+version = "6.25"
project = "drupal"
-datestamp = "1306357015"
+datestamp = "1330534547"
View
2 modules/blog/blog.pages.inc
@@ -63,7 +63,7 @@ function blog_page_last() {
$output = theme('item_list', $items);
- $result = pager_query(db_rewrite_sql("SELECT n.nid, n.created FROM {node} n WHERE n.type = 'blog' AND n.status = 1 ORDER BY n.sticky DESC, n.created DESC"), variable_get('default_nodes_main', 10));
+ $result = pager_query(db_rewrite_sql("SELECT n.nid, n.sticky, n.created FROM {node} n WHERE n.type = 'blog' AND n.status = 1 ORDER BY n.sticky DESC, n.created DESC"), variable_get('default_nodes_main', 10));
$has_posts = FALSE;
while ($node = db_fetch_object($result)) {
View
6 modules/blogapi/blogapi.info
@@ -4,8 +4,8 @@ package = Core - optional
version = VERSION
core = 6.x
-; Information added by drupal.org packaging script on 2011-05-25
-version = "6.22"
+; Information added by drupal.org packaging script on 2012-02-29
+version = "6.25"
project = "drupal"
-datestamp = "1306357015"
+datestamp = "1330534547"
View
6 modules/book/book.info
@@ -4,8 +4,8 @@ package = Core - optional
version = VERSION
core = 6.x
-; Information added by drupal.org packaging script on 2011-05-25
-version = "6.22"
+; Information added by drupal.org packaging script on 2012-02-29
+version = "6.25"
project = "drupal"
-datestamp = "1306357015"
+datestamp = "1330534547"
View
2 modules/book/book.module
@@ -649,7 +649,7 @@ function book_build_active_trail($book_link) {
* Appends book navigation to all nodes in the book, and handles book outline
* insertions and updates via the node form.
*/
-function book_nodeapi(&$node, $op, $teaser, $page) {
+function book_nodeapi(&$node, $op, $teaser = NULL, $page = NULL) {
switch ($op) {
case 'load':
// Note - we cannot use book_link_load() because it will call node_load()
View
6 modules/color/color.info
@@ -4,8 +4,8 @@ package = Core - optional
version = VERSION
core = 6.x
-; Information added by drupal.org packaging script on 2011-05-25
-version = "6.22"
+; Information added by drupal.org packaging script on 2012-02-29
+version = "6.25"
project = "drupal"
-datestamp = "1306357015"
+datestamp = "1330534547"
View
6 modules/comment/comment.info
@@ -4,8 +4,8 @@ package = Core - optional
version = VERSION
core = 6.x
-; Information added by drupal.org packaging script on 2011-05-25
-version = "6.22"
+; Information added by drupal.org packaging script on 2012-02-29
+version = "6.25"
project = "drupal"
-datestamp = "1306357015"
+datestamp = "1330534547"
View
35 modules/comment/comment.install
@@ -66,6 +66,35 @@ function comment_update_6003() {
return $ret;
}
+/**
+ * @defgroup updates-6.x-extra Extra system updates for 6.x
+ * @{
+ */
+
+/**
+ * Add index to to node_comment_statistics on comment_count
+ */
+function comment_update_6004() {
+ $ret = array();
+ db_add_index($ret, 'node_comment_statistics', 'comment_count', array('comment_count'));
+ return $ret;
+}
+
+/**
+ * Add indices to uid fields.
+ */
+function comment_update_6005() {
+ $ret = array();
+ db_add_index($ret, 'comments', 'comment_uid', array('uid'));
+ db_add_index($ret, 'node_comment_statistics', 'last_comment_uid', array('last_comment_uid'));
+ return $ret;
+}
+
+/**
+ * @} End of "defgroup updates-6.x-extra"
+ * The next series of updates should start at 7000.
+ */
+
/**
* Implementation of hook_schema().
@@ -166,6 +195,7 @@ function comment_schema() {
'indexes' => array(
'pid' => array('pid'),
'nid' => array('nid'),
+ 'comment_uid' => array('uid'),
'status' => array('status'), // This index is probably unused
),
'primary key' => array('cid'),