Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Merge remote-tracking branch 'upstream/staging' into plgtpl

  • Loading branch information...
commit 62f1de52462b0dd335778f1560440281a1f932f5 2 parents 0be77b1 + c600d0a
@phproberto phproberto authored
Showing with 2,365 additions and 2,298 deletions.
  1. +1 −1  docs/manual/en-US/Developer_Manual.ent
  2. +27 −0 docs/manual/en-US/chapters/classes/jcryptpasswordsimple.xml
  3. +25 −0 docs/manual/en-US/chapters/interfaces/jcryptpassword.xml
  4. +2 −0  docs/manual/en-US/chapters/packages.xml
  5. +15 −0 docs/manual/en-US/chapters/packages/crypt.xml
  6. +6 −6 libraries/compat/jsonserializable.php
  7. +0 −1  libraries/import.legacy.php
  8. +1 −1  libraries/joomla/application/cli.php
  9. +0 −1  libraries/joomla/application/web.php
  10. +0 −1  libraries/joomla/application/web/router/base.php
  11. +2 −2 libraries/joomla/archive/archive.php
  12. +2 −2 libraries/joomla/archive/bzip2.php
  13. +2 −2 libraries/joomla/archive/gzip.php
  14. +2 −2 libraries/joomla/archive/tar.php
  15. +4 −6 libraries/joomla/archive/zip.php
  16. +0 −2  libraries/joomla/cache/cache.php
  17. +0 −4 libraries/joomla/cache/storage/file.php
  18. +0 −6 libraries/joomla/client/ftp.php
  19. +0 −1  libraries/joomla/client/helper.php
  20. +0 −5 libraries/joomla/crypt/cipher/simple.php
  21. +52 −0 libraries/joomla/crypt/password.php
  22. +148 −0 libraries/joomla/crypt/password/simple.php
  23. +3 −16 libraries/joomla/database/driver.php
  24. +4 −2 libraries/joomla/database/driver/mysql.php
  25. +4 −3 libraries/joomla/database/driver/mysqli.php
  26. +5 −2 libraries/joomla/database/driver/oracle.php
  27. +5 −3 libraries/joomla/database/driver/pdo.php
  28. +5 −5 libraries/joomla/database/driver/postgresql.php
  29. +4 −6 libraries/joomla/database/driver/sqlsrv.php
  30. +6 −7 libraries/joomla/database/factory.php
  31. +0 −3  libraries/joomla/database/importer/mysql.php
  32. +0 −4 libraries/joomla/database/importer/postgresql.php
  33. +48 −4 libraries/joomla/document/html/renderer/message.php
  34. +0 −2  libraries/joomla/event/dispatcher.php
  35. +6 −6 libraries/joomla/filesystem/file.php
  36. +0 −5 libraries/joomla/filesystem/folder.php
  37. +1 −1  libraries/joomla/filesystem/stream.php
  38. +0 −1  libraries/joomla/filter/input.php
  39. +14 −0 libraries/joomla/filter/output.php
  40. +0 −4 libraries/joomla/form/field.php
  41. +0 −1  libraries/joomla/form/fields/accesslevel.php
  42. +0 −1  libraries/joomla/form/fields/cachehandler.php
  43. +0 −2  libraries/joomla/form/fields/checkboxes.php
  44. +0 −1  libraries/joomla/form/fields/combo.php
  45. +0 −1  libraries/joomla/form/fields/databaseconnection.php
  46. +0 −1  libraries/joomla/form/fields/filelist.php
  47. +0 −1  libraries/joomla/form/fields/folderlist.php
  48. +0 −2  libraries/joomla/form/fields/groupedlist.php
  49. +0 −1  libraries/joomla/form/fields/integer.php
  50. +0 −2  libraries/joomla/form/fields/list.php
  51. +0 −1  libraries/joomla/form/fields/plugins.php
  52. +0 −2  libraries/joomla/form/fields/radio.php
  53. +0 −1  libraries/joomla/form/fields/rules.php
  54. +0 −1  libraries/joomla/form/fields/sessionhandler.php
  55. +0 −1  libraries/joomla/form/fields/sql.php
  56. +0 −1  libraries/joomla/form/fields/timezone.php
  57. +0 −1  libraries/joomla/form/fields/usergroup.php
  58. +0 −12 libraries/joomla/form/form.php
  59. +0 −1  libraries/joomla/form/helper.php
  60. +0 −1  libraries/joomla/form/rules/equals.php
  61. +0 −2  libraries/joomla/form/rules/rules.php
  62. +1 −1  libraries/joomla/form/rules/url.php
  63. +0 −1  libraries/joomla/github/gists.php
  64. 0  libraries/joomla/html/{html → }/access.php
  65. +0 −1  libraries/joomla/html/{html → }/behavior.php
  66. 0  libraries/joomla/html/{html → }/content.php
  67. 0  libraries/joomla/html/{html → }/date.php
  68. 0  libraries/joomla/html/{html → }/email.php
  69. 0  libraries/joomla/html/{html → }/form.php
  70. +1 −1  libraries/joomla/html/{html → }/grid.php
  71. +0 −2  libraries/joomla/html/html.php
  72. 0  libraries/joomla/html/{html → }/jgrid.php
  73. 0  libraries/joomla/html/{html → }/list.php
  74. 0  libraries/joomla/html/{html → }/number.php
  75. 0  libraries/joomla/html/{html → }/rules.php
  76. 0  libraries/joomla/html/{html → }/select.php
  77. 0  libraries/joomla/html/{html → }/sliders.php
  78. 0  libraries/joomla/html/{html → }/string.php
  79. 0  libraries/joomla/html/{html → }/tabs.php
  80. 0  libraries/joomla/html/{html → }/tel.php
  81. 0  libraries/joomla/html/{html → }/user.php
  82. +32 −0 libraries/joomla/http/http.php
  83. +9 −2 libraries/joomla/http/transport/curl.php
  84. +2 −3 libraries/joomla/http/transport/socket.php
  85. +14 −1 libraries/joomla/input/input.php
  86. +0 −3  libraries/joomla/installer/adapters/component.php
  87. +0 −1  libraries/joomla/installer/adapters/file.php
  88. +0 −1  libraries/joomla/installer/adapters/library.php
  89. +0 −1  libraries/joomla/installer/adapters/module.php
  90. +0 −1  libraries/joomla/installer/adapters/package.php
  91. +0 −1  libraries/joomla/installer/adapters/plugin.php
  92. +0 −1  libraries/joomla/installer/adapters/template.php
  93. +0 −6 libraries/joomla/installer/installer.php
  94. +11 −13 libraries/joomla/installer/librarymanifest.php
  95. +8 −9 libraries/joomla/installer/packagemanifest.php
  96. +15 −16 libraries/joomla/language/language.php
  97. +0 −1  libraries/joomla/log/log.php
  98. +0 −2  libraries/joomla/log/logger/formattedtext.php
  99. +0 −5 libraries/joomla/pagination/pagination.php
  100. +0 −3  libraries/joomla/registry/format/ini.php
  101. +0 −2  libraries/joomla/registry/format/xml.php
  102. +1 −4 libraries/joomla/registry/registry.php
  103. +6 −7 libraries/joomla/string/string.php
  104. +0 −1  libraries/joomla/table/extension.php
  105. +0 −12 libraries/joomla/table/nested.php
  106. +0 −8 libraries/joomla/table/table.php
  107. +1 −11 libraries/joomla/user/authentication.php
  108. +0 −1  libraries/joomla/utilities/arrayhelper.php
  109. +0 −1  libraries/joomla/utilities/utility.php
  110. +0 −1  libraries/legacy/base/observable.php
  111. +0 −1  libraries/legacy/component/helper.php
  112. +0 −2  libraries/legacy/controller/admin.php
  113. +3 −9 libraries/legacy/controller/form.php
  114. +1 −3 libraries/legacy/controller/legacy.php
  115. +2 −6 libraries/legacy/editor/editor.php
  116. +0 −1  libraries/legacy/error/error.php
  117. +0 −2  libraries/legacy/form/field/category.php
  118. +5 −8 libraries/legacy/form/field/componentlayout.php
  119. +2 −3 libraries/legacy/form/field/modulelayout.php
  120. +0 −208 libraries/legacy/help/help.php
  121. +0 −9 libraries/legacy/model/admin.php
  122. +0 −1  libraries/legacy/model/legacy.php
  123. +0 −3  libraries/legacy/pathway/pathway.php
  124. +0 −1  libraries/legacy/table/category.php
  125. +0 −2  libraries/legacy/table/content.php
  126. +0 −1  libraries/legacy/table/menu/type.php
  127. +0 −139 libraries/legacy/toolbar/button.php
  128. +0 −107 libraries/legacy/toolbar/button/confirm.php
  129. +0 −59 libraries/legacy/toolbar/button/custom.php
  130. +0 −89 libraries/legacy/toolbar/button/help.php
  131. +0 −82 libraries/legacy/toolbar/button/link.php
  132. +0 −103 libraries/legacy/toolbar/button/popup.php
  133. +0 −63 libraries/legacy/toolbar/button/separator.php
  134. +0 −103 libraries/legacy/toolbar/button/standard.php
  135. +0 −307 libraries/legacy/toolbar/toolbar.php
  136. +2 −1  libraries/loader.php
  137. +2 −3 media/system/js/validate-uncompressed.js
  138. +3 −0  tests/bootstrap.php
  139. +0 −63 tests/suites/legacy/toolbar/JToolbarButtonTest.php
  140. +0 −106 tests/suites/legacy/toolbar/JToolbarTest.php
  141. +0 −40 tests/suites/legacy/toolbar/button/JButtonConfirmTest.php
  142. +0 −39 tests/suites/legacy/toolbar/button/JButtonCustomTest.php
  143. +0 −39 tests/suites/legacy/toolbar/button/JButtonHelpTest.php
  144. +0 −39 tests/suites/legacy/toolbar/button/JButtonLinkTest.php
  145. +0 −39 tests/suites/legacy/toolbar/button/JButtonPopupTest.php
  146. +0 −39 tests/suites/legacy/toolbar/button/JButtonSeparatorTest.php
  147. +0 −39 tests/suites/legacy/toolbar/button/JButtonStandardTest.php
  148. +82 −0 tests/suites/unit/joomla/crypt/password/JCryptPasswordSimpleTest.php
  149. +8 −2 tests/suites/unit/joomla/date/JDateTest.php
  150. +29 −0 tests/suites/unit/joomla/event/JEventStub.php
  151. +200 −14 tests/suites/unit/joomla/event/JEventTest.php
  152. +16 −0 tests/suites/unit/joomla/filter/JFilterOutputTest.php
  153. +0 −2  tests/suites/unit/joomla/form/rules/JFormRuleBooleanTest.php
  154. +0 −1  tests/suites/unit/joomla/form/rules/JFormRuleColorTest.php
  155. +0 −2  tests/suites/unit/joomla/form/rules/JFormRuleEmailTest.php
  156. +0 −2  tests/suites/unit/joomla/form/rules/JFormRuleEqualsTest.php
  157. +0 −1  tests/suites/unit/joomla/form/rules/JFormRuleOptionsTest.php
  158. +0 −5 tests/suites/unit/joomla/form/rules/JFormRuleRulesTest.php
  159. +0 −2  tests/suites/unit/joomla/form/rules/JFormRuleTelTest.php
  160. +0 −2  tests/suites/unit/joomla/form/rules/JFormRuleUrlTest.php
  161. +0 −2  tests/suites/unit/joomla/form/rules/JFormRuleUsernameTest.php
  162. +147 −2 tests/suites/unit/joomla/html/JHtmlTest.php
  163. +1 −1  tests/suites/unit/joomla/html/html/JHtmlAccessTest.php
  164. +1 −1  tests/suites/unit/joomla/html/html/JHtmlBehaviorTest.php
  165. +1 −1  tests/suites/unit/joomla/html/html/JHtmlContentTest.php
  166. +1 −1  tests/suites/unit/joomla/html/html/JHtmlDateTest.php
  167. +1 −1  tests/suites/unit/joomla/html/html/JHtmlEmailTest.php
  168. +1 −1  tests/suites/unit/joomla/html/html/JHtmlFormTest.php
  169. +1 −1  tests/suites/unit/joomla/html/html/JHtmlGridTest.php
  170. +1 −1  tests/suites/unit/joomla/html/html/JHtmlJgridTest.php
  171. +1 −1  tests/suites/unit/joomla/html/html/JHtmlListTest.php
  172. +1 −1  tests/suites/unit/joomla/html/html/JHtmlNumberTest.php
  173. +1 −1  tests/suites/unit/joomla/html/html/JHtmlRulesTest.php
  174. +1 −1  tests/suites/unit/joomla/html/html/JHtmlSelectTest.php
  175. +1 −1  tests/suites/unit/joomla/html/html/JHtmlStringTest.php
  176. +1 −1  tests/suites/unit/joomla/html/html/JHtmlTelTest.php
  177. +1 −1  tests/suites/unit/joomla/html/html/JHtmlUserTest.php
  178. +16 −0 tests/suites/unit/joomla/http/JHttpTest.php
  179. +0 −3  tests/suites/unit/joomla/input/JInputCLITest.php
  180. +26 −2 tests/suites/unit/joomla/input/JInputTest.php
  181. +214 −0 tests/suites/unit/joomla/installer/JInstallerTest.php
  182. +23 −10 tests/suites/unit/joomla/language/JLanguageHelperTest.php
  183. +5 −5 tests/suites/unit/joomla/language/JLanguageInspector.php
  184. +561 −106 tests/suites/unit/joomla/language/JLanguageTest.php
  185. +78 −0 tests/suites/unit/joomla/language/data/language/en-GB/en-GB.localise.php
  186. +97 −0 tests/suites/unit/joomla/language/data/language/en-GB/en-GB.xml
  187. +0 −1  tests/suites/unit/joomla/log/loggers/JLogLoggerFormattedTextTest.php
  188. +0 −1  tests/suites/unit/joomla/log/loggers/JLogLoggerW3CTest.php
  189. +153 −79 tests/suites/unit/joomla/session/JSessionTest.php
  190. +23 −2 tests/suites/unit/joomla/string/JStringTest.php
  191. +12 −0 tests/suites/unit/joomla/user/JAuthenticationTest.php
  192. +140 −0 tests/suites/unit/joomla/user/JUserHelperTest.php
  193. +5 −0 tests/tmp/.gitignore
View
2  docs/manual/en-US/Developer_Manual.ent
@@ -1,4 +1,4 @@
<!ENTITY PRODUCT "Joomla Platform">
<!ENTITY BOOKID "Developer_Manual">
-<!ENTITY YEAR "2011">
+<!ENTITY YEAR "2012">
<!ENTITY HOLDER "| Open Source Matters |">
View
27 docs/manual/en-US/chapters/classes/jcryptpasswordsimple.xml
@@ -0,0 +1,27 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
+"http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
+<!ENTITY % BOOK_ENTITIES SYSTEM "../../Developer_Manual.ent">
+%BOOK_ENTITIES;
+]>
+<section id="chap-Joomla_Platform_Manual-JCryptPasswordSimple">
+ <title>JCryptPasswordSimple</title>
+
+ <section>
+ <title>Usage</title>
+
+ <para>In addition to the interface <interface>JCryptPassword</interface> there is also a basic implementation provided
+ which provides for use with the most common password schemes. This if found in the <classname>JCryptPasswordSimple</classname>
+ class.</para>
+
+ <para>Aside from the two methods <methodname>create</methodname> and <methodname>verify</methodname> methods, this
+ implementation also adds an additional method called <methodname>setCost</methodname>. This method is used to
+ set a cost parameter for methods that support workload factors. It takes an integer cost factor as a parameter.</para>
+
+ <para><classname>JCryptPasswordSimple</classname> provides support for bcrypt, MD5 and the traditional Joomla! CMS hashing
+ scheme. The hash format can be specified during hash creation by using the constants <constant>JCryptPassword::BLOWFISH</constant>,
+ <constant>JCryptPassword::MD5</constant> and <constant>JCryptPassword::JOOMLA</constant>. An appropriate salt will be
+ automatically generated when required.
+ </para>
+ </section>
+</section>
View
25 docs/manual/en-US/chapters/interfaces/jcryptpassword.xml
@@ -0,0 +1,25 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
+"http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
+<!ENTITY % BOOK_ENTITIES SYSTEM "../../Developer_Manual.ent">
+%BOOK_ENTITIES;
+]>
+<section>
+ <title>JCryptPassword</title>
+
+ <para><interfacename>JCryptPassword</interfacename> is an interface that requires a class to be implemented with a
+ <methodname>create</methodname> and a <methodname>verify</methodname> method.</para>
+
+ <para>The <methodname>create</methodname> method should take a plain text password and a type and return a hashed password.</para>
+
+ <para>The <methodname>verify</methodname> method should accept a plain text password and a hashed password and return a boolean
+ indicating whether or not the password matched the password in the hash.</para>
+
+ <para>The <interfacename>JCryptPassword</interfacename> interface defines the following constants for use with implementations:
+ <itemizedlist>
+ <listitem><para><constant>JCryptPassword::BLOWFISH</constant></para></listitem>
+ <listitem><para><constant>JCryptPassword::JOOMLA</constant></para></listitem>
+ <listitem><para><constant>JCryptPassword::MD5</constant></para></listitem>
+ </itemizedlist>
+ </para>
+</section>
View
2  docs/manual/en-US/chapters/packages.xml
@@ -9,6 +9,8 @@
<para>This is information about the core platform packages.</para>
+ <xi:include href="packages/crypt.xml" xmlns:xi="http://www.w3.org/2001/XInclude" />
+
<xi:include href="packages/database.xml" xmlns:xi="http://www.w3.org/2001/XInclude" />
<xi:include href="packages/github.xml" xmlns:xi="http://www.w3.org/2001/XInclude" />
View
15 docs/manual/en-US/chapters/packages/crypt.xml
@@ -0,0 +1,15 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
+"http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
+<!ENTITY % BOOK_ENTITIES SYSTEM "../../Developer_Manual.ent">
+%BOOK_ENTITIES;
+]>
+<section id="chap-Joomla_Platform_Manual-Crypt">
+ <title>The Crypt Package</title>
+
+ <para>The Crypt password provides a set of classes that can be used for encrypting and hashing data.</para>
+
+ <xi:include href="../interfaces/jcryptpassword.xml" xmlns:xi="http://www.w3.org/2001/XInclude" />
+
+ <xi:include href="../classes/jcryptpasswordsimple.xml" xmlns:xi="http://www.w3.org/2001/XInclude" />
+</section>
View
12 libraries/compat/jsonserializable.php
@@ -1,9 +1,9 @@
<?php
/**
- * @package Joomla.Compat
+ * @package Joomla.Compat
*
- * @copyright Copyright (C) 2005 - 2012 Open Source Matters, Inc. All rights reserved.
- * @license GNU General Public License version 2 or later; see LICENSE
+ * @copyright Copyright (C) 2005 - 2012 Open Source Matters, Inc. All rights reserved.
+ * @license GNU General Public License version 2 or later; see LICENSE
*/
defined('JPATH_PLATFORM') or die;
@@ -12,9 +12,9 @@
* JsonSerializable interface. This file should only be loaded on PHP < 5.4
* It allows us to implement it in classes without requiring PHP 5.4
*
- * @package Joomla.Compat
- * @since 12.2
- * @link http://www.php.net/manual/en/jsonserializable.jsonserialize.php
+ * @package Joomla.Compat
+ * @link http://www.php.net/manual/en/jsonserializable.jsonserialize.php
+ * @since 12.2
*/
interface JsonSerializable
{
View
1  libraries/import.legacy.php
@@ -70,7 +70,6 @@ class_exists('JLoader') or die;
// Register classes where the names have been changed to fit the autoloader rules
// @deprecated 12.3
-JLoader::register('JToolBar', JPATH_PLATFORM . '/legacy/toolbar/toolbar.php');
JLoader::register('JSimpleCrypt', JPATH_PLATFORM . '/legacy/simplecrypt/simplecrypt.php');
JLoader::register('JTree', JPATH_PLATFORM . '/legacy/base/tree.php');
JLoader::register('JNode', JPATH_PLATFORM . '/legacy/base/node.php');
View
2  libraries/joomla/application/cli.php
@@ -65,7 +65,7 @@ public function __construct(JInputCli $input = null, JRegistry $config = null, J
// Create the input based on the application logic.
else
{
- if (class_exists('Jinput'))
+ if (class_exists('JInput'))
{
$this->input = new JInputCLI;
}
View
1  libraries/joomla/application/web.php
@@ -840,7 +840,6 @@ protected function checkHeadersSent()
*/
protected function detectRequestUri()
{
- // Initialise variables.
$uri = '';
// First we need to detect the URI scheme.
View
1  libraries/joomla/application/web/router/base.php
@@ -128,7 +128,6 @@ public function addMaps($maps)
*/
protected function parseRoute($route)
{
- // Initialize variables.
$controller = false;
// Trim the query string off.
View
4 libraries/joomla/archive/archive.php
@@ -105,7 +105,7 @@ public static function extract($archivename, $extractdir)
{
$path = JPath::clean($extractdir);
JFolder::create($path);
- $result = JFile::copy($tmpfname, $path . '/' . JFile::stripExt(JFile::getName(strtolower($archivename))), null, 1);
+ $result = JFile::copy($tmpfname, $path . '/' . JFile::stripExt(basename(strtolower($archivename))), null, 1);
}
@unlink($tmpfname);
@@ -147,7 +147,7 @@ public static function extract($archivename, $extractdir)
{
$path = JPath::clean($extractdir);
JFolder::create($path);
- $result = JFile::copy($tmpfname, $path . '/' . JFile::stripExt(JFile::getName(strtolower($archivename))), null, 1);
+ $result = JFile::copy($tmpfname, $path . '/' . JFile::stripExt(basename(strtolower($archivename))), null, 1);
}
@unlink($tmpfname);
View
4 libraries/joomla/archive/bzip2.php
@@ -42,7 +42,6 @@ class JArchiveBzip2 implements JArchiveExtractable
*/
public function extract($archive, $destination, array $options = array ())
{
- // Initialise variables.
$this->_data = null;
if (!extension_loaded('bz2'))
@@ -60,7 +59,8 @@ public function extract($archive, $destination, array $options = array ())
if (!isset($options['use_streams']) || $options['use_streams'] == false)
{
// Old style: read the whole file and then parse it
- if (!$this->_data = JFile::read($archive))
+ $this->_data = file_get_contents($archive);
+ if (!$this->_data)
{
if (class_exists('JError'))
{
View
4 libraries/joomla/archive/gzip.php
@@ -54,7 +54,6 @@ class JArchiveGzip implements JArchiveExtractable
*/
public function extract($archive, $destination, array $options = array ())
{
- // Initialise variables.
$this->_data = null;
if (!extension_loaded('zlib'))
@@ -71,7 +70,8 @@ public function extract($archive, $destination, array $options = array ())
if (!isset($options['use_streams']) || $options['use_streams'] == false)
{
- if (!$this->_data = JFile::read($archive))
+ $this->_data = file_get_contents($archive);
+ if (!$this->_data)
{
if (class_exists('JError'))
{
View
4 libraries/joomla/archive/tar.php
@@ -71,11 +71,11 @@ class JArchiveTar implements JArchiveExtractable
*/
public function extract($archive, $destination, array $options = array())
{
- // Initialise variables.
$this->_data = null;
$this->_metadata = null;
- if (!$this->_data = JFile::read($archive))
+ $this->_data = file_get_contents($archive);
+ if (!$this->_data)
{
if (class_exists('JError'))
{
View
10 libraries/joomla/archive/zip.php
@@ -99,7 +99,6 @@ class JArchiveZip implements JArchiveExtractable
*/
public function create($archive, $files, array $options = array())
{
- // Initialise variables.
$contents = array();
$ctrldir = array();
@@ -139,11 +138,11 @@ public function extract($archive, $destination, array $options = array())
if ($this->hasNativeSupport())
{
- $this->_extractNative($archive, $destination, $options);
+ return $this->_extractNative($archive, $destination, $options);
}
else
{
- $this->_extract($archive, $destination, $options);
+ return $this->_extract($archive, $destination, $options);
}
}
@@ -206,7 +205,6 @@ public function checkZipData(&$data)
*/
private function _extract($archive, $destination, array $options)
{
- // Initialise variables.
$this->_data = null;
$this->_metadata = null;
@@ -222,7 +220,8 @@ private function _extract($archive, $destination, array $options)
}
}
- if (!$this->_data = JFile::read($archive))
+ $this->_data = file_get_contents($archive);
+ if (!$this->_data)
{
if (class_exists('JError'))
{
@@ -393,7 +392,6 @@ private function _extractNative($archive, $destination, array $options)
*/
private function _readZipInfo(&$data)
{
- // Initialise variables.
$entries = array();
// Find the last central directory header entry
View
2  libraries/joomla/cache/cache.php
@@ -463,7 +463,6 @@ public function &_getStorage()
*/
public static function getWorkarounds($data, $options = array())
{
- // Initialise variables.
$app = JFactory::getApplication();
$document = JFactory::getDocument();
$body = null;
@@ -550,7 +549,6 @@ public static function setWorkarounds($data, $options = array())
$loptions['modulemode'] = $options['modulemode'];
}
- // Initialise variables.
$app = JFactory::getApplication();
$document = JFactory::getDocument();
View
4 libraries/joomla/cache/storage/file.php
@@ -9,8 +9,6 @@
defined('JPATH_PLATFORM') or die;
-jimport('joomla.filesystem.file');
-
/**
* File cache storage handler
*
@@ -535,7 +533,6 @@ protected function _cleanPath($path, $ds = DIRECTORY_SEPARATOR)
protected function _filesInFolder($path, $filter = '.', $recurse = false, $fullpath = false
, $exclude = array('.svn', 'CVS', '.DS_Store', '__MACOSX'), $excludefilter = array('^\..*', '.*~'))
{
- // Initialise variables.
$arr = array();
// Check to make sure the path valid and clean
@@ -622,7 +619,6 @@ protected function _filesInFolder($path, $filter = '.', $recurse = false, $fullp
protected function _folders($path, $filter = '.', $recurse = false, $fullpath = false
, $exclude = array('.svn', 'CVS', '.DS_Store', '__MACOSX'), $excludefilter = array('^\..*'))
{
- // Initialise variables.
$arr = array();
// Check to make sure the path valid and clean
View
6 libraries/joomla/client/ftp.php
@@ -250,7 +250,6 @@ public function setOptions(array $options)
*/
public function connect($host = '127.0.0.1', $port = 21)
{
- // Initialise variables.
$errno = null;
$err = null;
@@ -396,7 +395,6 @@ public function pwd()
return $ret;
}
- // Initialise variables.
$match = array(null);
// Send print working directory command and verify success
@@ -1141,7 +1139,6 @@ public function write($remote, $buffer)
*/
public function listNames($path = null)
{
- // Initialise variables.
$data = null;
// If native FTP support is enabled let's use it...
@@ -1241,7 +1238,6 @@ public function listNames($path = null)
*/
public function listDetails($path = null, $type = 'all')
{
- // Initialise variables.
$dir_list = array();
$data = null;
$regs = null;
@@ -1477,7 +1473,6 @@ protected function _putCmd($cmd, $expectedResponse)
*/
protected function _verifyResponse($expected)
{
- // Initialise variables.
$parts = null;
// Wait for a response from the server, but timeout after the set time limit
@@ -1535,7 +1530,6 @@ protected function _verifyResponse($expected)
*/
protected function _passive()
{
- // Initialize variables.
$match = array();
$parts = array();
$errno = null;
View
1  libraries/joomla/client/helper.php
@@ -38,7 +38,6 @@ public static function getCredentials($client, $force = false)
if (!isset($credentials[$client]) || $force)
{
- // Initialise variables.
$config = JFactory::getConfig();
// Fetch the client layer configuration options for the specific client
View
5 libraries/joomla/crypt/cipher/simple.php
@@ -37,7 +37,6 @@ public function decrypt($data, JCryptKey $key)
throw new InvalidArgumentException('Invalid key of type: ' . $key->type . '. Expected simple.');
}
- // Initialise variables.
$decrypted = '';
$tmp = $key->public;
@@ -79,7 +78,6 @@ public function encrypt($data, JCryptKey $key)
throw new InvalidArgumentException('Invalid key of type: ' . $key->type . '. Expected simple.');
}
- // Initialise variables.
$encrypted = '';
$tmp = $key->private;
@@ -134,7 +132,6 @@ public function generateKey(array $options = array())
*/
private function _getRandomKey($length = 256)
{
- // Initialise variables.
$key = '';
$salt = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789';
$saltLength = strlen($salt);
@@ -160,7 +157,6 @@ private function _getRandomKey($length = 256)
*/
private function _hexToInt($s, $i)
{
- // Initialise variables.
$j = (int) $i * 2;
$k = 0;
$s1 = (string) $s;
@@ -241,7 +237,6 @@ private function _hexToInt($s, $i)
*/
private function _hexToIntArray($hex)
{
- // Initialise variables.
$array = array();
$j = (int) strlen($hex) / 2;
View
52 libraries/joomla/crypt/password.php
@@ -0,0 +1,52 @@
+<?php
+/**
+ * @package Joomla.Platform
+ * @subpackage Crypt
+ *
+ * @copyright Copyright (C) 2005 - 2012 Open Source Matters, Inc. All rights reserved.
+ * @license GNU General Public License version 2 or later; see LICENSE
+ */
+
+defined('JPATH_PLATFORM') or die;
+
+/**
+ * Joomla Platform Password Hashing Interface
+ *
+ * @package Joomla.Platform
+ * @subpackage Crypt
+ * @since 12.2
+ */
+interface JCryptPassword
+{
+ const BLOWFISH = '$2y$';
+
+ const JOOMLA = 'Joomla';
+
+ const PBKDF = '$pbkdf$';
+
+ const MD5 = '$1$';
+
+ /**
+ * Creates a password hash
+ *
+ * @param string $password The password to hash.
+ * @param string $prefix The prefix of the hashing function.
+ *
+ * @return string The hashed password.
+ *
+ * @since 12.2
+ */
+ public function create($password, $prefix = '$2a$');
+
+ /**
+ * Verifies a password hash
+ *
+ * @param string $password The password to verify.
+ * @param string $hash The password hash to check.
+ *
+ * @return boolean True if the password is valid, false otherwise.
+ *
+ * @since 12.2
+ */
+ public function verify($password, $hash);
+}
View
148 libraries/joomla/crypt/password/simple.php
@@ -0,0 +1,148 @@
+<?php
+/**
+ * @package Joomla.Platform
+ * @subpackage Crypt
+ *
+ * @copyright Copyright (C) 2005 - 2012 Open Source Matters, Inc. All rights reserved.
+ * @license GNU General Public License version 2 or later; see LICENSE
+ */
+
+defined('JPATH_PLATFORM') or die;
+
+/**
+ * Joomla Platform Password Crypter
+ *
+ * @package Joomla.Platform
+ * @subpackage Crypt
+ * @since 12.2
+ */
+class JCryptPasswordSimple implements JCryptPassword
+{
+ /**
+ * @var integer The cost parameter for hashing algorithms.
+ * @since 12.2
+ */
+ protected $cost = 10;
+
+ /**
+ * Creates a password hash
+ *
+ * @param string $password The password to hash.
+ * @param string $type The hash type.
+ *
+ * @return string The hashed password.
+ *
+ * @since 12.2
+ */
+ public function create($password, $type = JCryptPassword::BLOWFISH)
+ {
+ switch ($type)
+ {
+ case JCryptPassword::BLOWFISH:
+ $salt = $this->getSalt(22);
+
+ if (version_compare(PHP_VERSION, '5.3.7') >= 0)
+ {
+ $prefix = '$2y$';
+ }
+ else
+ {
+ $prefix = '$2a$';
+ }
+
+ $salt = $prefix . str_pad($this->cost, 2, '0', STR_PAD_LEFT) . '$' . $this->getSalt(22);
+
+ return crypt($password, $salt);
+
+ case JCryptPassword::MD5:
+ $salt = $this->getSalt(12);
+
+ $salt = '$1$' . $salt;
+
+ return crypt($password, $salt);
+
+ case JCryptPassword::JOOMLA:
+ $salt = $this->getSalt(32);
+
+ return md5($password . $salt) . ':' . $salt;
+
+ default:
+ throw new InvalidArgumentException(sprintf('Hash type %s is not supported', $type));
+ break;
+ }
+ }
+
+ /**
+ * Sets the cost parameter for the generated hash for algorithms that use a cost factor.
+ *
+ * @param integer $cost The new cost value.
+ *
+ * @return void
+ *
+ * @since 12.2
+ */
+ public function setCost($cost)
+ {
+ $this->cost = $cost;
+ }
+
+ /**
+ * Generates a salt of specified length. The salt consists of characters in the set [./0-9A-Za-z].
+ *
+ * @param integer $length The number of characters to return.
+ *
+ * @return string The string of random characters.
+ *
+ * @since 12.2
+ */
+ protected function getSalt($length)
+ {
+ $bytes = ceil($length * 6 / 8);
+
+ $randomData = str_replace('+', '.', base64_encode(JCrypt::getRandomBytes($bytes)));
+
+ return substr($randomData, 0, $length);
+ }
+
+ /**
+ * Verifies a password hash
+ *
+ * @param string $password The password to verify.
+ * @param string $hash The password hash to check.
+ *
+ * @return boolean True if the password is valid, false otherwise.
+ *
+ * @since 12.2
+ */
+ public function verify($password, $hash)
+ {
+ // Check if the hash is a blowfish hash.
+ if (substr($hash, 0, 4) == '$2a$' || substr($hash, 0, 4) == '$2y$')
+ {
+ if (version_compare(PHP_VERSION, '5.3.7') >= 0)
+ {
+ $prefix = '$2y$';
+ }
+ else
+ {
+ $prefix = '$2a$';
+ }
+ $hash = $prefix . substr($hash, 4);
+
+ return (crypt($password, $hash) === $hash);
+ }
+
+ // Check if the hash is an MD5 hash.
+ if (substr($hash, 0, 3) == '$1$')
+ {
+ return (crypt($password, $hash) === $hash);
+ }
+
+ // Check if the hash is a Joomla hash.
+ if (preg_match('#[a-z0-9]{32}:[A-Za-z0-9]{32}#', $hash) === 1)
+ {
+ return md5($password . substr($hash, 33)) == substr($hash, 0, 32);
+ }
+ return false;
+ }
+}
View
19 libraries/joomla/database/driver.php
@@ -9,8 +9,6 @@
defined('JPATH_PLATFORM') or die;
-jimport('joomla.filesystem.folder');
-
/**
* Joomla Platform Database Interface
*
@@ -216,7 +214,7 @@ public static function getConnectors()
/**
* Method to return a JDatabaseDriver instance based on the given options. There are three global options and then
* the rest are specific to the database driver. The 'driver' option defines which JDatabaseDriver class is
- * used for the connection -- the default is 'mysql'. The 'database' option determines which database is to
+ * used for the connection -- the default is 'mysqli'. The 'database' option determines which database is to
* be used for the connection. The 'select' option determines whether the connector should automatically select
* the chosen database.
*
@@ -232,9 +230,9 @@ public static function getConnectors()
public static function getInstance($options = array())
{
// Sanitize the database connector options.
- $options['driver'] = (isset($options['driver'])) ? preg_replace('/[^A-Z0-9_\.-]/i', '', $options['driver']) : 'mysql';
+ $options['driver'] = (isset($options['driver'])) ? preg_replace('/[^A-Z0-9_\.-]/i', '', $options['driver']) : 'mysqli';
$options['database'] = (isset($options['database'])) ? $options['database'] : null;
- $options['select'] = (isset($options['select'])) ? $options['select'] : true;
+ $options['select'] = (isset($options['select'])) ? $options['select'] : true;
// Get the options signature for the database connector.
$signature = md5(serialize($options));
@@ -815,7 +813,6 @@ public function hasUTFSupport()
*/
public function insertObject($table, &$object, $key = null)
{
- // Initialise variables.
$fields = array();
$values = array();
@@ -887,7 +884,6 @@ public function loadAssoc()
{
$this->connect();
- // Initialise variables.
$ret = null;
// Execute the query and get the result set cursor.
@@ -929,7 +925,6 @@ public function loadAssocList($key = null, $column = null)
{
$this->connect();
- // Initialise variables.
$array = array();
// Execute the query and get the result set cursor.
@@ -973,7 +968,6 @@ public function loadColumn($offset = 0)
{
$this->connect();
- // Initialise variables.
$array = array();
// Execute the query and get the result set cursor.
@@ -1084,7 +1078,6 @@ public function loadObject($class = 'stdClass')
{
$this->connect();
- // Initialise variables.
$ret = null;
// Execute the query and get the result set cursor.
@@ -1124,7 +1117,6 @@ public function loadObjectList($key = '', $class = 'stdClass')
{
$this->connect();
- // Initialise variables.
$array = array();
// Execute the query and get the result set cursor.
@@ -1164,7 +1156,6 @@ public function loadResult()
{
$this->connect();
- // Initialise variables.
$ret = null;
// Execute the query and get the result set cursor.
@@ -1198,7 +1189,6 @@ public function loadRow()
{
$this->connect();
- // Initialise variables.
$ret = null;
// Execute the query and get the result set cursor.
@@ -1237,7 +1227,6 @@ public function loadRowList($key = null)
{
$this->connect();
- // Initialise variables.
$array = array();
// Execute the query and get the result set cursor.
@@ -1391,7 +1380,6 @@ protected function quoteNameStr($strArr)
*/
public function replacePrefix($sql, $prefix = '#__')
{
- // Initialize variables.
$escaped = false;
$startPos = 0;
$quoteChar = '';
@@ -1607,7 +1595,6 @@ public function truncateTable($table)
*/
public function updateObject($table, &$object, $key, $nulls = false)
{
- // Initialise variables.
$fields = array();
$where = array();
View
6 libraries/joomla/database/driver/mysql.php
@@ -251,11 +251,13 @@ public function execute()
$sql .= ' LIMIT ' . $this->offset . ', ' . $this->limit;
}
+ // Increment the query counter.
+ $this->count++;
+
// If debugging is enabled then let's log the query.
if ($this->debug)
{
- // Increment the query counter and add the query to the object queue.
- $this->count++;
+ // Add the query to the object queue.
$this->log[] = $sql;
JLog::add($sql, JLog::DEBUG, 'databasequery');
View
7 libraries/joomla/database/driver/mysqli.php
@@ -313,7 +313,6 @@ public function getTableCreate($tables)
{
$this->connect();
- // Initialise variables.
$result = array();
// Sanitize input to an array and iterate over the list.
@@ -482,11 +481,13 @@ public function execute()
$sql .= ' LIMIT ' . $this->offset . ', ' . $this->limit;
}
+ // Increment the query counter.
+ $this->count++;
+
// If debugging is enabled then let's log the query.
if ($this->debug)
{
- // Increment the query counter and add the query to the object queue.
- $this->count++;
+ // Add the query to the object queue.
$this->log[] = $sql;
JLog::add($sql, JLog::DEBUG, 'databasequery');
View
7 libraries/joomla/database/driver/oracle.php
@@ -209,7 +209,6 @@ public function getTableCreate($tables)
{
$this->connect();
- // Initialise variables.
$result = array();
$query = $this->getQuery(true);
@@ -422,6 +421,11 @@ public function setDateFormat($dateFormat = 'DD-MON-RR')
$this->connect();
$this->setQuery("ALTER SESSION SET NLS_DATE_FORMAT = '$dateFormat'");
+ if (!$this->execute())
+ {
+ return false;
+ }
+
$this->setQuery("ALTER SESSION SET NLS_TIMESTAMP_FORMAT = '$dateFormat'");
if (!$this->execute())
@@ -527,7 +531,6 @@ public static function isSupported()
*/
public function replacePrefix($sql, $prefix = '#__')
{
- // Initialize variables.
$escaped = false;
$startPos = 0;
$quoteChar = "'";
View
8 libraries/joomla/database/driver/pdo.php
@@ -296,7 +296,7 @@ public function connect()
}
catch (PDOException $e)
{
- throw new RuntimeException('Could not connect to PDO' . ': ' . $e->getMessage(), 2);
+ throw new RuntimeException('Could not connect to PDO' . ': ' . $e->getMessage(), 2, $e);
}
}
@@ -373,11 +373,13 @@ public function execute()
$sql .= ' LIMIT ' . $this->offset . ', ' . $this->limit;
}
+ // Increment the query counter.
+ $this->count++;
+
// If debugging is enabled then let's log the query.
if ($this->debug)
{
- // Increment the query counter and add the query to the object queue.
- $this->count++;
+ // Add the query to the object queue.
$this->log[] = $sql;
JLog::add($sql, JLog::DEBUG, 'databasequery');
View
10 libraries/joomla/database/driver/postgresql.php
@@ -621,11 +621,13 @@ public function execute()
$sql .= ' LIMIT ' . $this->limit . ' OFFSET ' . $this->offset;
}
+ // Increment the query counter.
+ $this->count++;
+
// If debugging is enabled then let's log the query.
if ($this->debug)
{
- // Increment the query counter and add the query to the object queue.
- $this->count++;
+ // Add the query to the object queue.
$this->log[] = $sql;
JLog::add($sql, JLog::DEBUG, 'databasequery');
@@ -790,7 +792,7 @@ public function setUTF()
* @param array $columns Array of table's column returned by ::getTableColumns.
* @param string $field_name The table field's name.
* @param string $field_value The variable value to quote and return.
- *
+ *
* @return string The quoted string.
*
* @since 11.3
@@ -961,7 +963,6 @@ protected function freeResult($cursor = null)
*/
public function insertObject($table, &$object, $key = null)
{
- // Initialise variables.
$columns = $this->getTableColumns($table);
$fields = array();
@@ -1265,7 +1266,6 @@ public function unlockTables()
*/
public function updateObject($table, &$object, $key, $nulls = false)
{
- // Initialise variables.
$columns = $this->getTableColumns($table);
$fields = array();
$where = '';
View
10 libraries/joomla/database/driver/sqlsrv.php
@@ -335,7 +335,6 @@ public function getNumRows($cursor = null)
*/
public function getTableColumns($table, $typeOnly = true)
{
- // Initialise variables.
$result = array();
$table_temp = $this->replacePrefix((string) $table);
@@ -517,7 +516,6 @@ public function insertid()
*/
public function loadResult()
{
- // Initialise variables.
$ret = null;
// Execute the query and get the result set cursor.
@@ -566,12 +564,13 @@ public function execute()
$sql = $this->limit($sql, $this->limit, $this->offset);
}
+ // Increment the query counter.
+ $this->count++;
+
// If debugging is enabled then let's log the query.
if ($this->debug)
{
-
- // Increment the query counter and add the query to the object queue.
- $this->count++;
+ // Add the query to the object queue.
$this->log[] = $sql;
JLog::add($sql, JLog::DEBUG, 'databasequery');
@@ -654,7 +653,6 @@ public function replacePrefix($sql, $prefix = '#__')
{
$tablePrefix = 'jos_';
- // Initialize variables.
$escaped = false;
$startPos = 0;
$quoteChar = '';
View
13 libraries/joomla/database/factory.php
@@ -27,10 +27,9 @@ class JDatabaseFactory
private static $_instance = null;
/**
- * Method to return a JDatabaseDriver instance based on the given options. There are three global options and then
- * the rest are specific to the database driver. The 'driver' option defines which JDatabaseDriver class is
- * used for the connection -- the default is 'mysql'. The 'database' option determines which database is to
- * be used for the connection. The 'select' option determines whether the connector should automatically select
+ * Method to return a JDatabaseDriver instance based on the given options. There are three global options and then
+ * the rest are specific to the database driver. The 'database' option determines which database is to
+ * be used for the connection. The 'select' option determines whether the connector should automatically select
* the chosen database.
*
* Instances are unique to the given options and new objects are only created when a unique options array is
@@ -43,12 +42,12 @@ class JDatabaseFactory
*
* @since 12.1
*/
- public function getDriver($name = 'mysql', $options = array())
+ public function getDriver($name = 'mysqli', $options = array())
{
// Sanitize the database connector options.
- $options['driver'] = preg_replace('/[^A-Z0-9_\.-]/i', '', $name);
+ $options['driver'] = preg_replace('/[^A-Z0-9_\.-]/i', '', $name);
$options['database'] = (isset($options['database'])) ? $options['database'] : null;
- $options['select'] = (isset($options['select'])) ? $options['select'] : true;
+ $options['select'] = (isset($options['select'])) ? $options['select'] : true;
// Derive the class name from the driver.
$class = 'JDatabaseDriver' . ucfirst(strtolower($options['driver']));
View
3  libraries/joomla/database/importer/mysql.php
@@ -180,7 +180,6 @@ protected function getAddKeySQL($table, $keys)
*/
protected function getAlterTableSQL(SimpleXMLElement $structure)
{
- // Initialise variables.
$table = $this->getRealTableName($structure['name']);
$oldFields = $this->db->getTableColumns($table);
$oldKeys = $this->db->getTableKeys($table);
@@ -348,7 +347,6 @@ protected function getChangeColumnSQL($table, SimpleXMLElement $field)
*/
protected function getColumnSQL(SimpleXMLElement $field)
{
- // Initialise variables.
// TODO Incorporate into parent class and use $this.
$blobs = array('text', 'smalltext', 'mediumtext', 'largetext');
@@ -556,7 +554,6 @@ protected function getRealTableName($table)
*/
protected function mergeStructure()
{
- // Initialise variables.
$prefix = $this->db->getPrefix();
$tables = $this->db->getTableList();
View
4 libraries/joomla/database/importer/postgresql.php
@@ -177,7 +177,6 @@ protected function getAddIndexSQL(SimpleXMLElement $field)
*/
protected function getAlterTableSQL(SimpleXMLElement $structure)
{
- // Initialise variables.
$table = $this->getRealTableName($structure['name']);
$oldFields = $this->db->getTableColumns($table);
$oldKeys = $this->db->getTableKeys($table);
@@ -450,7 +449,6 @@ protected function getChangeColumnSQL($table, SimpleXMLElement $field)
*/
protected function getAlterColumnSQL($table, $field)
{
- // Initialise variables.
// TODO Incorporate into parent class and use $this.
$blobs = array('text', 'smalltext', 'mediumtext', 'largetext');
@@ -505,7 +503,6 @@ protected function getAlterColumnSQL($table, $field)
*/
protected function getColumnSQL(SimpleXMLElement $field)
{
- // Initialise variables.
// TODO Incorporate into parent class and use $this.
$blobs = array('text', 'smalltext', 'mediumtext', 'largetext');
@@ -698,7 +695,6 @@ protected function getRealTableName($table)
*/
protected function mergeStructure()
{
- // Initialise variables.
$prefix = $this->db->getPrefix();
$tables = $this->db->getTableList();
View
52 libraries/joomla/document/html/renderer/message.php
@@ -31,9 +31,37 @@ class JDocumentRendererMessage extends JDocumentRenderer
*/
public function render($name, $params = array (), $content = null)
{
- // Initialise variables.
+ $msgList = $this->getData();
$buffer = null;
- $lists = null;
+ $app = JFactory::getApplication();
+ $chromePath = JPATH_THEMES . '/' . $app->getTemplate() . '/html/message.php';
+ $itemOverride = false;
+
+ if (file_exists($chromePath))
+ {
+ include_once $chromePath;
+ if (function_exists('renderMessage'))
+ {
+ $itemOverride = true;
+ }
+ }
+
+ $buffer = ($itemOverride) ? renderMessage($msgList) : $this->renderDefaultMessage($msgList);
+
+ return $buffer;
+ }
+
+ /**
+ * Get and prepare system message data for output
+ *
+ * @return array An array contains system message
+ *
+ * @since 12.2
+ */
+ private function getData()
+ {
+ // Initialise variables.
+ $lists = array();
// Get the message queue
$messages = JFactory::getApplication()->getMessageQueue();
@@ -50,14 +78,29 @@ public function render($name, $params = array (), $content = null)
}
}
+ return $lists;
+ }
+
+ /**
+ * Render the system message if no message template file found
+ *
+ * @param array $msgList An array contains system message
+ *
+ * @return string System message markup
+ *
+ * @since 12.2
+ */
+ private function renderDefaultMessage($msgList)
+ {
// Build the return string
+ $buffer = '';
$buffer .= "\n<div id=\"system-message-container\">";
// If messages exist render them
- if (is_array($lists))
+ if (is_array($msgList))
{
$buffer .= "\n<dl id=\"system-message\">";
- foreach ($lists as $type => $msgs)
+ foreach ($msgList as $type => $msgs)
{
if (count($msgs))
{
@@ -76,6 +119,7 @@ public function render($name, $params = array (), $content = null)
}
$buffer .= "\n</div>";
+
return $buffer;
}
}
View
2  libraries/joomla/event/dispatcher.php
@@ -129,7 +129,6 @@ public function register($event, $handler)
*/
public function trigger($event, $args = array())
{
- // Initialise variables.
$result = array();
/*
@@ -254,7 +253,6 @@ public function attach($observer)
*/
public function detach($observer)
{
- // Initialise variables.
$retval = false;
$key = array_search($observer, $this->_observers);
View
12 libraries/joomla/filesystem/file.php
@@ -108,7 +108,6 @@ public static function copy($src, $dest, $path = null, $use_streams = false)
}
else
{
- // Initialise variables.
$FTPOptions = JClientHelper::getCredentials('ftp');
if ($FTPOptions['enabled'] == 1)
@@ -158,7 +157,6 @@ public static function copy($src, $dest, $path = null, $use_streams = false)
*/
public static function delete($file)
{
- // Initialise variables.
$FTPOptions = JClientHelper::getCredentials('ftp');
if (is_array($file))
@@ -253,7 +251,6 @@ public static function move($src, $dest, $path = '', $use_streams = false)
}
else
{
- // Initialise variables.
$FTPOptions = JClientHelper::getCredentials('ftp');
if ($FTPOptions['enabled'] == 1)
@@ -297,10 +294,12 @@ public static function move($src, $dest, $path = '', $use_streams = false)
* @return mixed Returns file contents or boolean False if failed
*
* @since 11.1
+ * @deprecated 13.3 Use the native file_get_contents() instead.
*/
public static function read($filename, $incpath = false, $amount = 0, $chunksize = 8192, $offset = 0)
{
- // Initialise variables.
+ JLog::add(__METHOD__ . ' is deprecated. Use native file_get_contents() syntax.', JLog::WARNING, 'deprecated');
+
$data = null;
if ($amount && $chunksize > $amount)
{
@@ -390,7 +389,6 @@ public static function write($file, &$buffer, $use_streams = false)
}
else
{
- // Initialise variables.
$FTPOptions = JClientHelper::getCredentials('ftp');
if ($FTPOptions['enabled'] == 1)
@@ -451,7 +449,6 @@ public static function upload($src, $dest, $use_streams = false)
}
else
{
- // Initialise variables.
$FTPOptions = JClientHelper::getCredentials('ftp');
$ret = false;
@@ -520,9 +517,12 @@ public static function exists($file)
* @return string filename
*
* @since 11.1
+ * @deprecated 13.3 Use basename() instead.
*/
public static function getName($file)
{
+ JLog::add(__METHOD__ . ' is deprecated. Use native basename() syntax.', JLog::WARNING, 'deprecated');
+
// Convert back slashes to forward slashes
$file = str_replace('\\', '/', $file);
$slash = strrpos($file, '/');
View
5 libraries/joomla/filesystem/folder.php
@@ -38,7 +38,6 @@ public static function copy($src, $dest, $path = '', $force = false, $use_stream
{
@set_time_limit(ini_get('max_execution_time'));
- // Initialise variables.
$FTPOptions = JClientHelper::getCredentials('ftp');
if ($path)
@@ -164,7 +163,6 @@ public static function copy($src, $dest, $path = '', $force = false, $use_stream
*/
public static function create($path = '', $mode = 0755)
{
- // Initialise variables.
$FTPOptions = JClientHelper::getCredentials('ftp');
static $nested = 0;
@@ -292,7 +290,6 @@ public static function delete($path)
return false;
}
- // Initialise variables.
$FTPOptions = JClientHelper::getCredentials('ftp');
// Check to make sure the path valid and clean
@@ -380,7 +377,6 @@ public static function delete($path)
*/
public static function move($src, $dest, $path = '', $use_streams = false)
{
- // Initialise variables.
$FTPOptions = JClientHelper::getCredentials('ftp');
if ($path)
@@ -559,7 +555,6 @@ protected static function _items($path, $filter, $recurse, $full, $exclude, $exc
{
@set_time_limit(ini_get('max_execution_time'));
- // Initialise variables.
$arr = array();
// Read the source directory
View
2  libraries/joomla/filesystem/stream.php
@@ -28,7 +28,7 @@
* @see http://php.net/manual/en/transports.php Socket Transports (used by some options, particularly HTTP proxy)
* @since 11.1
*/
-class JStream extends JObject
+class JStream
{
// Publicly settable vars (protected to let our parent read them)
/**
View
1  libraries/joomla/filter/input.php
@@ -542,7 +542,6 @@ protected function _cleanTags($source)
*/
protected function _cleanAttributes($attrSet)
{
- // Initialise variables.
$newSet = array();
$count = count($attrSet);
View
14 libraries/joomla/filter/output.php
@@ -213,4 +213,18 @@ public static function stripImages($string)
{
return preg_replace('#(<[/]?img.*>)#U', '', $string);
}
+
+ /**
+ * Strip iframe-tags from string
+ *
+ * @param string $string Sting to be cleaned.
+ *
+ * @return string Cleaned string
+ *
+ * @since 12.2
+ */
+ public static function stripIframes($string)
+ {
+ return preg_replace('#(<[/]?iframe.*>)#U', '', $string);
+ }
}
View
4 libraries/joomla/form/field.php
@@ -394,7 +394,6 @@ public function setup(SimpleXMLElement $element, $value, $group = null)
*/
protected function getId($fieldId, $fieldName)
{
- // Initialise variables.
$id = '';
// If there is a form control set for the attached form add it first.
@@ -451,7 +450,6 @@ protected function getId($fieldId, $fieldName)
*/
protected function getTitle()
{
- // Initialise variables.
$title = '';
if ($this->hidden)
@@ -476,7 +474,6 @@ protected function getTitle()
*/
protected function getLabel()
{
- // Initialise variables.
$label = '';
if ($this->hidden)
@@ -530,7 +527,6 @@ protected function getLabel()
*/
protected function getName($fieldName)
{
- // Initialise variables.
$name = '';
// If there is a form control set for the attached form add it first.
View
1  libraries/joomla/form/fields/accesslevel.php
@@ -40,7 +40,6 @@ class JFormFieldAccessLevel extends JFormFieldList
*/
protected function getInput()
{
- // Initialize variables.
$attr = '';
// Initialize some field attributes.
View
1  libraries/joomla/form/fields/cachehandler.php
@@ -39,7 +39,6 @@ class JFormFieldCacheHandler extends JFormFieldList
*/
protected function getOptions()
{
- // Initialize variables.
$options = array();
// Convert to name => name array.
View
2  libraries/joomla/form/fields/checkboxes.php
@@ -46,7 +46,6 @@ class JFormFieldCheckboxes extends JFormField
*/
protected function getInput()
{
- // Initialize variables.
$html = array();
// Initialize some field attributes.
@@ -103,7 +102,6 @@ protected function getInput()
*/
protected function getOptions()
{
- // Initialize variables.
$options = array();
foreach ($this->element->children() as $option)
View
1  libraries/joomla/form/fields/combo.php
@@ -38,7 +38,6 @@ class JFormFieldCombo extends JFormFieldList
*/
protected function getInput()
{
- // Initialize variables.
$html = array();
$attr = '';
View
1  libraries/joomla/form/fields/databaseconnection.php
@@ -44,7 +44,6 @@ class JFormFieldDatabaseConnection extends JFormFieldList
*/
protected function getOptions()
{
- // Initialize variables.
// This gets the connectors available in the platform and supported by the server.
$available = JDatabaseDriver::getConnectors();
View
1  libraries/joomla/form/fields/filelist.php
@@ -43,7 +43,6 @@ class JFormFieldFileList extends JFormFieldList
*/
protected function getOptions()
{
- // Initialize variables.
$options = array();
// Initialize some field attributes.
View
1  libraries/joomla/form/fields/folderlist.php
@@ -39,7 +39,6 @@ class JFormFieldFolderList extends JFormFieldList
*/
protected function getOptions()
{
- // Initialize variables.
$options = array();
// Initialize some field attributes.
View
2  libraries/joomla/form/fields/groupedlist.php
@@ -37,7 +37,6 @@ class JFormFieldGroupedList extends JFormField
*/
protected function getGroups()
{
- // Initialize variables.
$groups = array();
$label = 0;
@@ -136,7 +135,6 @@ protected function getGroups()
*/
protected function getInput()
{
- // Initialize variables.
$html = array();
$attr = '';
View
1  libraries/joomla/form/fields/integer.php
@@ -39,7 +39,6 @@ class JFormFieldInteger extends JFormFieldList
*/
protected function getOptions()
{
- // Initialize variables.
$options = array();
// Initialize some field attributes.
View
2  libraries/joomla/form/fields/list.php
@@ -37,7 +37,6 @@ class JFormFieldList extends JFormField
*/
protected function getInput()
{
- // Initialize variables.
$html = array();
$attr = '';
@@ -83,7 +82,6 @@ protected function getInput()
*/
protected function getOptions()
{
- // Initialize variables.
$options = array();
foreach ($this->element->children() as $option)
View
1  libraries/joomla/form/fields/plugins.php
@@ -37,7 +37,6 @@ class JFormFieldPlugins extends JFormFieldList
*/
protected function getOptions()
{
- // Initialise variables
$folder = $this->element['folder'];
if (!empty($folder))
View
2  libraries/joomla/form/fields/radio.php
@@ -37,7 +37,6 @@ class JFormFieldRadio extends JFormField
*/
protected function getInput()
{
- // Initialize variables.
$html = array();
// Initialize some field attributes.
@@ -83,7 +82,6 @@ protected function getInput()
*/
protected function getOptions()
{
- // Initialize variables.
$options = array();
foreach ($this->element->children() as $option)
View
1  libraries/joomla/form/fields/rules.php
@@ -303,7 +303,6 @@ protected function getInput()
*/
protected function getUserGroups()
{
- // Initialise variables.
$db = JFactory::getDBO();
$query = $db->getQuery(true);
$query->select('a.id AS value, a.title AS text, COUNT(DISTINCT b.id) AS level, a.parent_id')
View
1  libraries/joomla/form/fields/sessionhandler.php
@@ -39,7 +39,6 @@ class JFormFieldSessionHandler extends JFormFieldList
*/
protected function getOptions()
{
- // Initialize variables.
$options = array();
// Get the options from JSession.
View
1  libraries/joomla/form/fields/sql.php
@@ -38,7 +38,6 @@ class JFormFieldSQL extends JFormFieldList
*/
protected function getOptions()
{
- // Initialize variables.
$options = array();
// Initialize some field attributes.
View
1  libraries/joomla/form/fields/timezone.php
@@ -47,7 +47,6 @@ class JFormFieldTimezone extends JFormFieldGroupedList
*/
protected function getGroups()
{
- // Initialize variables.
$groups = array();
$keyField = $this->element['key_field'] ? (string) $this->element['key_field'] : 'id';
View
1  libraries/joomla/form/fields/usergroup.php
@@ -37,7 +37,6 @@ class JFormFieldUsergroup extends JFormField
*/
protected function getInput()
{
- // Initialize variables.
$options = array();
$attr = '';
View
12 libraries/joomla/form/form.php
@@ -201,7 +201,6 @@ public function filter($data, $group = null)
return false;
}
- // Initialise variables.
$input = new JRegistry($data);
$output = new JRegistry;
@@ -216,7 +215,6 @@ public function filter($data, $group = null)
// Filter the fields.
foreach ($fields as $field)
{
- // Initialise variables.
$name = (string) $field['name'];
// Get the field groups for the element.
@@ -33