Joomla! Platform 12.2

Version 12.2 ("Neil Armstrong") of the Joomla Platform was tagged and released on 21 September 2012. It is the second release of the 12.x series. Joomla Platform 12.2 was also included in the Joomla CMS 3.0 release. In addition to numerous bug fixes, it also brings new features, the main ones:

  • New (and generic) web application routers
  • New password hashing interface and basic implementation
  • Basic PHARchive support
  • New JInputJSON class
  • Allowing override of the xx-XX.localise.php
  • Composer support

With the addition of Composer and PHARchive support in this release, the Joomla Platform extends its available distribution channels and formats.

The full list of commits is available here and the api doc here

Project size

  • Classes: 300 (309 in platform 12.1)
  • Methods: 2136 (2122 in platform 12.1)

Summary of code quality

  • Check style: 124 warnings (142 in platform 12.1)
  • Duplicate code: 27 warnings (27 in platform 12.1)
  • Programming Mess Detector (PMD): 801 warnings (702 in platform 12.1)
  • Test Coverage: 38.16% (39.70% in platform 12.1).

New feature

Issue fixed


Update library





Backward incompatibility

The following pull requests made by community contributors were merged:

  1. [#874] new JLogger type: JLoggerCallback (issue #866) (okonomiyaki3000)

    This adds a new JLogger type that simply passes a log entry to a user defined callback function. Callback can be in any of the callback formats normally used by PHP, including lambda (available since PHP 5.3).

    In order to properly support lambda functions (Closure objects), a minor modification to JLog was required.

  2. [#829] fix for issue #27946 (jamesmoey)
  3. [#1025] Implement the JsonSerializable interface in JRegistry (realityking)

    This is would be the first use of one of the new PHP 5.4 features, but it maintains compatibility with PHP 5.3.

    How to use:

    $a = new JRegistry(); $a->set('foo', 'bar'); echo json_encode($a);

    This isn't immediately useful since PHP 5.4 is very rare for now, but it may be appreciated by someone building a custom app who runs 5.4.

  4. [#1099] Fix for issue #1094 (aaronschmitz)

    Cause JStream to actually iterate along the string rather than repeating the beginning.

  5. [#1184] Make the log package fully autoloadable. (realityking)
  6. [#1224] Update mooRainbow to version 1.4. (realityking)
  7. [#1226] Fix JPath::clean() to support UNC style paths. [#1220] (LouisLandry)

    This will close #1220.

    This should also resolve the old JoomlaCode tracker item:

    The fix comes complete with unit tests to help ensure we don't run into this problem again.

  8. [#1245] Running test on php 5.4 (chdemko)

    PHP 5.4 is not running test successfully:

    • E_STRICT became part of E_ALL (in PHP 5.4)
    • converting an array to a string now generates a notice
    • a class containing an abstract method must be abstract

    and some others issues

  9. [#1463] Remove the weird exception handling from string.php. (aaronschmitz)

    This handling can cause problems in JArrayHelper::sortObjects due to

    Iconv throws a notice if there is an illegal character regardless of whether ignore is set so this handling is pointless (and in fact broken since it will always fall back to IGNORE not TRANSLIT). Also, //TRANSLIT,IGNORE not //TRANSLIT//IGNORE will properly both transliterate and ignore.

    See also:

  10. [#1481] Making the Joomla platform loadable as a dependency from Composer (eirslett)

    Adding the file "composer.json" will allow Composer ( to import the Joomla Platform as a dependency. It is now temporarily defined as a package in, pointing to my fork, which can be changed if this pull request is accepted.

  11. [#1180] JSession still uses JRequest (florianv)

    It causes a fatal error when instanciating JSession because _start() still uses JRequest. I don't know if you want to use this construction

  12. [#1187] Add new params to media field: preview_width / preview_height (benjaminpick)

    Improvement of #1105 : Allowing full-size preview.

  13. [#1193] namespace support in JFactory::getConfig (florianv)
  14. [#1194] Use JPATH_THEMES constant to set themes directory in JApplicationWeb::render()(mbabker)

    The JPATH_THEMES constant is set in the CMS, unit tests, and in some of the example apps I've seen to define the path where themes (templates) are located. Instead of checking for a hard-coded themes folder under JPATH_BASE, this allows the themes directory to be set to this constant (which, for example, allows the CMS to continue using the "templates" directory if so desired when the applications are refactored) and retains the current fallback of __DIR__ . '/themes'

  15. [#1195] Fix PHP error: Access to undeclared static property (mbabker)

    With the current Platform, JComponentHelper is unusable due to the $_components property being declared with the underscore, but all uses within the class do not use the underscore. This makes it usable again.

  16. [#1196] Autoload JMenu and JRouter child classes (mbabker)

    Following the example in JPathway::getInstance(), I've modified JMenu and JRouter's getInstance methods to allow for autoloading the child classes. If the class can't be found first, then it will look in the hardcoded includes/<file>.php location for the class.

  17. [#1197] Additions to mock application classes. (eddieajau)

    Added basic TestMockApplicationCli class. Added mock response body support to TestMockApplicationWeb.

  18. [#1199] $lang is not initialised in adapter JInstallerTemplate::discover_install() (Denitz)
  19. [#1200] Copy edit/code style a comment (elinw)
  20. [#1201] Passing input array by reference (chdemko)

    The JInput constructor is not receiving its argument by reference. This is causing unexpected behevior:

    JFactory::getApplication()->input->set('foo', 'bar');

    This will set $_REQUEST['foo'] equal to 'bar' (because of var is set by ref)

    JFactory::getApplication()->input->post->set('foo', 'bar');

    This will not set $_POST['foo'] equal to 'bar' (because of, arg is not received by ref)

  21. [#1202] Allow JApplicationWeb::render() to receive params for a theme (mbabker)

    Similar to JApplication::render() and the CMS's application classes, this sets the params for a theme if they are set in the configuration.

  22. [#1203] Remove duplicated line (vietvh)
  23. [#1204] fix issue #1190 (ramalama)

    Fixes only addRecipient

  24. [#1205] Reverting 1201 (eddieajau)

    This pull is to revert the changes in 1201. For some reason it has changed the way internal data persist (made some independent tests fail). But looking at it, I actually think we should go further and not allow JInput to modify the source input (for example, it should get a copy of $_REQUEST, not a reference so that that input variable can make changes without affecting the rest of the application).

  25. [#1208] comment for database quote methods to avoid IDE error (florianv)
  26. [#1209] Updated database session code to avoid duplication of session id (garyamort)

    See for original request. Repository reorg removed the old fix, so here is a new, updated one.

  27. [#1210] Allow JArrayHelper::getColumn process associative array (of arrays/ objects) (piotr-cz)

    At the moment JArrayHelper::getColumn doesn't work on non-associative arrays. No idea why for loop has been used instead of foreach..

  28. [#1213] Fix magic method declaration in docblocks (elkuku)

    Those IDEs are getting smarter every day....

  29. [#1214] Add more tests for JUser (realityking)
  30. [#1215] Fixed an error inside component.php file, coming from an old change. (gpongelli)

    Added sqlValue method inside PostgreSQL's driver, added its use inside insertObject and inside updateObject. Added sqlValue's test.

  31. [#1216] Remove workaround for old WebKit versions. (realityking)

    This will improve (perceived) performance a bit for users of current versions of WebKit (and lower performance for older versions). since the majority of WebKit users use Chrome and update quickly this should be a net gain.

  32. [#1217] Change JApplication to use JCrypt, not JSimpleCrypt. + some clean-up (realityking)
  33. [#1219] Improve the JSession package. (realityking)

    First bunch of changes to rework the session package. This is mostly very safe stuff, only B/C problem is dropping the JObject.

  34. [#1221] Curl request() encodes $data regardless the Content-type header. (dianaprajescu)

    To post a file using curl the '@' prefix must be used with the file's full path. As of PHP 5.2.0, the CURLOPT_POSTFIELDS option must be an array if this prefix is used. That means the $data parameter of the request() method must not be encoded if the Content-type header is multipart/form-data.

  35. [#1223] Fix syntax error. (realityking)
  36. [#1225] Fixing up code styling from #1204. (LouisLandry)
  37. [#1227] JHtml::date format parameter documtentation is not correct (ramalama)

    JHtml::date says in the doc that the $format parameter is use with strftime. This is not correct: The underlying functions JDate::format and JDate::calendar are using the php date format.

    Updated the parameter hint.

  38. [#1228] Reduce dependency on JFolder (realityking)

    The cache package still depends on filesystem, however JCache itself doesn't. JLanguage only depends on the string package and JXMLElement after this. The session package shouldn't depend on the filesystem package anymore.

    Note: B/C issue created by removing JLanguage::parseXMLLanguageFiles(). It's simply not needed anymore due to the RecusiveDirectoryIterator in JLanguage::parseLanguageFiles()

  39. [#1229] Move JObserver and JObservable to legacy. (realityking)
  40. [#1230] Move JPagination to its own package. (realityking)
  41. [#1233] Updated doc chapter about testing (TestReflection) (florianv)
  42. [#1234] Added slash normalisation for JApplicationWeb media.uri properties. (robschley)
  43. [#1235] Remove JFormFields moved to the CMS tree. (realityking)
  44. [#1236] Fix a fatal bug in JSession and lay the groundwork for lazy sessions. (realityking)
  45. [#1237] JHtml doesn't need to depend on JDatabase. (realityking)
  46. [#1238] Use the PHP 5.3 const syntax where possible. (realityking)

    This is mainly for consistency with class constants. Note that this only works for constants that are not conditional and that they take only a simple value and not the result of an expression. Since they are compile time instead of runtime based they get cached a bit more efficient with an opcode cache (negligible improvement thou)

  47. [#1239] Deprecate the following methods in JFactory: getACL(), getUri() and getXML(). (realityking)
  48. [#1240] Fix a few issues with JLog autoloading. (realityking)
  49. [#1241] Fix code style error. (realityking)
  50. [#1242] JPaginationObject dosesn't need to extend JObject. (realityking)

    Also adds type hints to JPagination.

  51. [#1243] Fix a fatal bug in JAccess + docblock fix. (realityking)

    Also fixes a docblock in the session package that causes a mismatch in JDepend.

  52. [#1244] Move JEditor to the legacy folder. (realityking)
  53. [#1246] Correct response code for creating forks (mbabker)

    The GitHub API sends a 202 response on successful completion of forking a repo, not a 201. This fixes that as well as a few docblock lines in the class.

  54. [#1247] Fix failing unit tests. (realityking)
  55. [#1248] Fix an issue with providing a zero ID to JUser::getInstance (pasamio)

    This pull request resolves an edge case where two requests to JUser::getInstance (and by extension JFactory::getUser) would return a user with a different ID. When called with a user ID of 0, a user object is created and cached in JUser::getInstance and then returned. If this JUser object is then persisted to the database, it is updated to have it's new user ID. However if another call to JUser::getInstance is made for a user ID of zero again, the existing object with it's new user ID will be returned.

    This resolves the situation by ensuring that when the ID is zero that a new JUser object is returned and not cached.

  56. [#1249] Changed PostgreSQL's minimum version. (gpongelli)

    This pull only contains change of minimum required version of PostgreSQL database.

    Test class was run and returns same result under these PostgreSQL's versions: - 8.3.18 - 8.4.11 - 9.0.7 - 9.1.3

    This pull includes a change inside "insertObject" test because 8.3 version doesn't support 'RESTART IDENTITY' clause, so switched to old-style sequence restart.

  57. [#1250] Fixes for Oracle driver, Oracle query and PDO driver (pasamio)

    This pull request introduces various fixes for the Oracle driver, Oracle query class and PDO driver.

    Summarised changes:

    • Add double quote as the Oracle name quote to handle name quoting properly.
    • Added support for supplying a query to execute to verify that a connection is active.
    • Override default connection verification query for Oracle to support "dual" idiom.
    • Update getTableColumns() to support rewriting a prefix on Oracle.
    • Fix getTableColumns() to return results consistent with other drivers.
    • Add replacePrefix() to Oracle driver to ignore double quoted items (it being the name quote character).
    • Fix getEscaped() for PDO driver to not automatically quote it's results inline with other drivers.
    • Store a copy of the error message in PDO execute() before trying to run keep-alive query which wipes out previous value.
    • Suppress error message from lastInsertId() to avoid PDO warning you that a given database platform doesn't support it natively.
    • Add a sudden death when trying to check if connected when already trying to check if connected to prevent infinite loop.
    • Update Oracle query to only mangle the query for limiting and offset when applicable otherwise pass the query through unmodified.
  58. [#1255] Write unit tests for the JArchive package. (aaronschmitz)

    A few unit tests added... and some to go still.

  59. [#1256] Joomla CMS [#27267] Multiple Loggers fail when using formattedtext (chdemko)

    See and

  60. [#1260] BUGFIX: discover template install (rdeutz)

    lang was used but not set so the template installation failed and the style for the template wasn't created

  61. [#1262] change yes/no to true/false as will be committed in joomla-cms (benjaminpick)

    As decided in , true/false should be used instead of yes/no for consistency.

  62. [#1264] Remove commented code and related comment. (elinw)
  63. [#1267] Enabling multiple color fields (infograf768)

    only a single JFormFieldColor field can exist (functionally) within a form See:

    The whole mooRainbow.css is included as it had a wrong encoding

  64. [#1268] Checkboxes fixes and tests (elinw)

    This fixes a few issues in the checkboxes field and adds detailed tests. 1. Formerly the field was not checking for stored data when rendering, so it was always using the information from the field definition. Going to the field definition is now conditioned on there not being an existing value. 2. Formerly selecting more than one item to be checked (preset) was not working because the array of checked values was not being created correctly. Checkboxes continues to have the limitation that it cannot distinguish between a field that is deliberately saved as empty and one that has never been saved, so if the checked element is used it will always render with the checked items when the form is reopened. This is inherent to the structure of the checkboxes field type so developers should be aware of that and use the checked attribute with caution or consider using a "none of the above" option to force a value to be saved.

  65. [#1270] Add tests for JFormFieldCheckbox and fix an issue in the field. (elinw)
  66. [#1271] Adding new JInputJSON class (pasamio)

    This pull request introduces a new JInputJSON class that permits handling requests that include a JSON body and automatically populates itself from the JSON in the request.

  67. [#1273] Doc block style fixes in the table package. (elinw)
  68. [#1274] Rename tests so they will run (elinw)

    Rename the JFormRulesUrl and JFormRulesColor tests so they will run. Fix an issue in JString revealed by JFormRulesUrlTest. Add a test to JStringTest for that issue.

  69. [#1277] Run some code only when debug is on. (realityking)
  70. [#1282] Fix a parse error (elkuku)

    So it happened that a parse error was committed and Mr. Jenkins let is pass silently (almost) pushing it to the master branch.

    It would be nice to implement a call to php lint to prevent those "accidents" in the future.

  71. [#1283] Move more classes to legacy. (realityking)

    Unit tests for legacy run fine with this,

  72. [#1284] Add an exception to the equals rule. (elinw)
  73. [#1294] Force cached CSS/JavaScript reload after update (chdemko)

    When css/js/images are updated on a site, they are not reloaded on browsers that use caching. This pull request add a timestamp to files loaded by the JHtml library to force the reload of cached files.

  74. [#1293] Joomla CMS [#28535] Joomla 2.5.4 Timezones being doubled (chdemko)


  75. [#1292] Fix issue #1266 (dianaprajescu)

    I created the add function in order to avoid duplicated code since addRecipient, addCC, addBCC and addReplyTo are almost the same. #1266

  76. [#1289] Standardize default Content-Type handling across all transports. (piotr-cz)

    According to IETF ( and W3C ( are case-insensitive, but in both documentations used in camel case.

  77. [#1288] Joomla CMS [#28411] Site breaks when deleting alternate style which is in use (chdemko)


  78. [#1287] Fix docblock style and wording (elinw)
  79. [#1297] Fix an issue in bind() when load() is directly from database meaning articletext is "".(elinw)
  80. [#1299] Stop default handling of href in toolbar buttons (rvsjoen)

    I refer to and

    It has been suggested that this pull is done against the platform.

  81. [#1300] Reduce the use of JBrowser. (realityking)

    Note that JHtml still depends on JBrowser, we'll need to fix that before we can move JBrowser to legacy.

    Legacy unit tests run fine on my local machine.

  82. [#1301] Rename the old MVC classes so their names don't conflict with the new ones. (realityking)

    This also among other things mixing the two MVCs in the same application.

    Legacy unit tests run fine locally.

  83. [#1302] Use native session handlers whenever possible. (realityking)

    I couldn't test these because I have neither memcache nor a windows server but I see no reason why the PHP handlers shouldn't work.

  84. [#1304] Check if $client->id is set before trying to use it. (elinw)
  85. [#1305] Import plugins on authorise instead of loading (ShMaunder)

    *Apologies if this has been done incorrectly - this is my first ever pull request.

    I think the authorise method is suppose to importPlugin() - I can't see any point in using getPlugin() as this will return plug-in data (which isn't captured anyway) and doesn't import them for the dispatcher.

    Also, when calling the authorise method, you have to import both plug-in groups manually which seems pointless: JPluginHelper::importPlugin('user'); JPluginHelper::importPlugin('authentication'); $authorisations = JAuthentication::authorise($response, $options);

  86. [#1306] Fix a PHP notice and a checkstyle error. (realityking)
  87. [#1308] Use JFactory::getXML() and JXMLElement less. (realityking)
  88. [#1310] Code Style in Jhtmltest plus fix places where files are created twice causing errors (elinw)

    There were a bunch of tests that had corrupted unit test results because JHtmlTest was having problems in testStylesheet when it was attempting to create a file with the same name as a file created earlier.

  89. [#1311] Unify the checking of the platform. (realityking)

    The standardizes everything on the IS_WIN/IS_MAC/IS_UNIX constants. JApplication::isWinOS() is only deprecated for legacy purposes.

  90. [#1312] Deal with exceptions in a couple of places. (realityking)
  91. [#1313] Joomla CMS [#28741] E_STRICT: JArrayHelper::pivot should be declared as static(chdemko)


  92. [#1315] Update documentation (elinw)
  93. [#1317] Move JGrid to its own package and allow JHtml to use the autoloader again. (realityking)

    This is required for the CMS, since it relies on the autoloader for JHtml classes.

  94. [#1319] Fix issue #1309 (dianaprajescu)

    Replace $this->input with $this->_input.

  95. [#1320] Check that $wpoption['modulemode'] == 1, not just that it is set. (okonomiyaki3000)

    This is a fix for this bug:

  96. [#1322] Support applications without JMenu. (realityking)

    Deprecate some code not needed with the autoloader.

  97. [#1324] Remove getter for non-existing "class" property (sybrek)

    Remove getter for non-existing "class" property (we're using class as part of the element).

  98. [#1325] Don't use deprecated APIs. (realityking)
  99. [#1326] Remove somes traces of PHP 5.2. (realityking)
  100. [#1327] Fix two parse errors (elkuku)

    Yes i know that php lint takes a lot of time but...

  101. [#1328] Fix a couple of issues with cache. (realityking)
  102. [#1329] JSession: Removed duplicated code, code style (piotr-cz)

    Minor fixes not affecting functionality

  103. [#1330] Joomla! throws error with valid xml string (bembelimen)


    $xml = JFactory::getXML('<foo />');

    expected result:

    No JError warning

    actual result:

    Joomla! calls a "JLIB_UTIL_ERROR_XML_LOAD" JError Warning


    Don't check for "empty()", use === false instead.

  104. [#1332] Replace JRequest uses (mbabker)
  105. [#1333] PDO does not support serialization (stefanneculai)

    PDO does not support serialization, so I think it should not be serialized. Adding the __sleep method would prevent serializing properties that are instances of PDO.

    The connection is established again on __wakeup.

  106. [#1334] Fix a PHP notice in JControllerLegacy. (realityking)
  107. [#1336] Import code changes from Joomla 2.5.5. (realityking)
  108. [#1338] Correct use of setLocation (mbabker)

    Since the API for JTableNested::setLocation changed to not return a boolean value, its use in the component install adapter needs to be corrected. As is, component menu items are not created because of the use of the old API.

  109. [#1339] Remove JHtmlBatch and JHtmlCategory since they were moved to the CMS. (realityking)
  110. [#1340] Don't have JFactory depend on SimplePie and move the code related to it to legacy.(realityking)

    SimplePie ist outdated and throws way too many E_STRICT errors. These changes allow us to eventually remove it. The different versions for the @deprecated tags are for backwards compatibility for the CMS. The CMS can take JSimplepieFactory but we need the method in JFactory for the next cycle.

  111. [#1341] Joomla CMS [#28633] JUserHelper getProfile method should be static (ShMaunder)

    In no way a major issue; noticed while using JUserHelper::getProfile that it is not declared as static:

    public static function getProfile($userId = 0)

    I don't believe there are backward compatibility issues.

  112. [#1343] Handling msg object in adapter uninstall (mbabker)

    1) Presently, a PHP Notice "ob_end_clean(): failed to delete buffer. No buffer to delete in /libraries/joomla/installer/adapters/plugin.php on line 638" is thrown during plugin uninstall because a$msg object is created before the ob_start() command is issued. This instance is not necessary since the object is set at the correct time after the custom uninstall method.

    2) In the file, module, and package adapters, the $msg object wasn't registered to extension_message, contradictory in behavior to the component and plugin adapters. This is corrected.

  113. [#1344] Errors during a save redirect incorrectly to page resulting in creation of new record.(Octobit)

    See Joomla tracker issue #28770

  114. [#1345] Handle scriptfile for file extensions (mbabker)

    At present, the scriptfile for file extension types isn't copied over during install, leaving it unavailable for uninstall routines. This change sets it up so that it is installed in a manner similar to packages.

  115. [#1346] Update staging (infograf768)


    This solves the display of the Modified date

  116. [#1347] Move JXMLElement to legacy. (realityking)
  117. [#1348] Fix a fatal error in JInstaller and some clean up. (realityking)
  118. [#1351] Clean up the legacy MVC a bit more. (realityking)

    Mostly deprecating some stuff or adding the log messages for deprecated stuff. Also adds a $input member to hold a JInput object to JControllerLegacy. This makes the old JController a bit more like the new one.

  119. [#1352] Remove/deprecate more code in legacy. (realityking)
  120. [#1357] Update Oracle driver to set timestamp format as well as date format (pasamio)

    This pull request updates the Oracle driver to set the timestamp format to match the date format which is the Joomla! standard. This means that instead of getting Oracle's default timestamp formatting, timestamp fields are returned with Joomla!'s preferred date formatting.

  121. [#1509] fix JViewLegacy::getName model name discovery (dongilbert)

    The current regex implementation for model name auto-discovery in the JViewLegacy prevents a developer from the use of the substr of "view" in the classname without consequences. Hence the reason for the custom error created just for that case. (see line 466 of the diff: This pull request fixes that.

    Note: This fix breaks Backwards Compatibility (potentially) as the previous regex implementation used the /i modifier and searched for case insensitive strings. Here we use strpos (case-sensitive). Be sure your classnames are properly CamelCased (

    This is how I tested -

  122. [#1363] [CMS #28823] Re-add isError into the JError legacy class (ShMaunder)

    Not sure the reason for the removal of isError() from the JError legacy class in J3.0 Alpha 1 - ?

    I understand its old and "instanceof Exception" is the better way... but it just seems like this removal might break any extensions that use it (including my old code).

    If we have a legacy class, we may as well keep it all in tact.

  123. [#1362] JUpdate load form XML - fixed empty response data (juliopontes)


    the joomla update are getting a empty response from Http because use $response->data instead of $response->body.

  124. [#1364] Have the session fire an event after it is started and use this to populate the session with some default objects. (realityking)

    This is an alternative approach to #1349 that doesn't cause JSession to depend on JUser and JRegistry.

  125. [#1365] Move aliases for the old class names to the legacy folder. (realityking)

    Also fix the unit tests to not rely on these legacy name.

  126. [#1366] There is no reason no to allow blank article bodies. (elinw)

    As discussed on the CMS list there is no reason for this annoying requirement though there may have been in the past.!topic/joomla-dev-cms/994z5Pnzvms

  127. [#1368] Update unit tests in JTableContent (elinw)
  128. [#1370] Remove workarounds in JProfiler::getMemory() for when memory_get_usage() is not available. (realityking)

    According to the PHP documentation memory_get_usage() is always available since 5.2.1.

  129. [#1371] Let mysqli be the base class for mysql instead of the other way around. (realityking)

    This this is a necessary first step to eventually get rid of mysql.

  130. [#1372] Fixes for extension update adapter (mbabker)

    The update adapter is failing in the CMS master repo currently. These changes get it working again.

  131. [#1373] Required and validate elements errors messages are not translatable (Regression).(infograf768)

    Required and validate elements error messages are not translatable (Regression). + errors in front-end wrong display. See

  132. [#1374] [IMP] JImage->toFile() returns boolean (phproberto)

    Add a return value to the method toFile in the JImage library.

  133. [#1375] [IMP] add crop automatic offsets calculation (phproberto)

    Modify crop function to autogenerate left & top centered offsets if received null values.

  134. [#1376] Fix a doc block (elinw)
  135. [#1377] Fix issue where existing article can't be saved blank. (elinw)
  136. [#1378] Remove unreachable code (dead code) (pborreli)
  137. [#1379] Remove more form fields that belong to the CMS. (realityking)

    Removed are the following classes: JFormFieldContentLanguage JFormFieldEditor JFormFieldMedia JFormFieldMenuitem

  138. [#1380] Remove our custom session ID generating code if favor of session_regenerate_id().(realityking)

    Note there's one non-optional use of session_id() left on line 624. I'm not really sure what it does so I didn't touch it for now.

    I confirmed the CMS works fine with this change (tested admin login/logout). The session id changes on logout. (It doesn't on login because apparently we don't fork the session on login)

  139. [#1383] Remove use of intval() and floatval() in favor of casting. (realityking)

    We mainly use the cast syntax but sometime we use intval() and floatval(), the pull makes things more consistent.

  140. [#1385] Make JImageFilter child classes autoloadable (mbabker)

    This should fix #1384

  141. [#1386] Improvements to install adapters (mbabker)
    • Restored preflight method to plugin uninstall per @pasamio comments at
    • Added check to package adapter install method to determine whether to use install or update route; subsequently changed later JInstaller::install trigger to use the route information
    • Document class vars in template adapter
    • Remove check for install root tag in JInstallerHelper::detectType()
    • Deprecate JInstallerHelper::splitSql() in favor of JDatabaseDriver::splitSql() (which the deprecated method already proxies to)
    • Remove obsolete code per @infograf768 as suggested at
  142. [#1387] Fix unit test failures from #1352. (realityking)
  143. [#1388] Improve mysql database handling. (realityking)

    Two changes are in this pull request: -JDatabaseQueryMysql now extends JDatabaseQueryMysqli instead of the other way around, making it easier to eventually remove the mysql version. -The eating of the charset was changed to follow PHP best practices

  144. [#1389] JFactory::createDocument always creates HTML documents. (Bakual)

    Fixing the "format" URL parameter. Bug was introduced when the depreceated "no_html" was removed. Now it is no longer possible to create other document types using "&format=raw". This PR brings back this function but doesn't reintroduce the "no_html" parameter.

  145. [#1391] [IMP] function to create thumbnails from the current image (phproberto)

    Finally after the previous JImage required modifications I submit the optimized createThumbs function to quickly create thumbnails from the current image.

    Example. Create 2 thumbnails with cropping: jimport('joomla.image.image'); $imagen = new JImage(JPATH_SITE . DIRECTORY_SEPARATOR . 'images' . DIRECTORY_SEPARATOR . 'powered_by.png'); $thumbSizes = array('50x50', '250x100'); $imagen->createThumbs($thumbSizes, 4);

  146. [#1392] Remove dependency on JObject from JRouter, JMenu and JPathway. (realityking)
  147. [#1393] Speed improvement to JRoute::_() (realityking)

    JRoute::_() may be executed several hundred times on a complex site so even a small optimization can be measureable.

  148. [#1398] Optimize images to reduce their filesize. (realityking)
  149. [#1399] Avoid using deprecated APIs and remove more deprecated code in JModuleHelper.(realityking)
  150. [#1402] Remove dependency on JObject from JPagination. (realityking)

    For backwards compatibility we'll keep the get() and set() methods around.

  151. [#1404] Correct confusion between required and validate messages (infograf768)

    When a field contains both a required and a validate element, we get a confusion for the error messages. This patch takes element['message'] out of the required conditional as, in this case, the label or the name can be used for the error. (Patch also ready for the CMS with fields and strings changes)

  152. [#1405] Add basic PHARchive support. (LouisLandry)

    Add basic package definition files for using to package either a platform PHAR or a platform + test libraries PHAR. Additionally there are a few small fixes here and there to allow the platform to work as a PHAR.

  153. [#1406] Fix problem with JLoader prefixes (rvsjoen)

    When registering a custom prefix that has more than a single uppercase character, JLoader searches the wrong path. For example, registering

    php JLoader::registerPrefix('Jcms', JPATH_PLATFORM . '/cms');

    will cause it to look for, say, JcmsViewHtml in libraries/cms/cms/view/html.php because the "cms" part of the prefix is mistakenly interpreted as a path segment.

    This patch will make sure the whole first segment of a CamelCasedWord is used as the loader prefix.

  154. [#1411] Autoloader cleanup (ianmacl)

    Moving JHtml files so that they can be autoloaded. This allows for more readable code because you can now use, f.e., JHtmlSelect::radiolist($params) instead of using _.

  155. [#1416] Corrections to JAccess when there is an invalid or missing asset or parenting is to root.(elinw)

    Although there is some confusion in the wording examination of the comments and docblocks of JAccess indicates that if there is parenting to the root asset or there is an invalid asset that the rules from the root asset should be used. For various reasons this was not actually working in the current class. This has been causing problems for developers who wish to parent assets from the root asset. In addition this corrects a situation where as a result of the asset_id being privately manage a corrupted asset_id could never be corrected using the class.

    The approach to solving this involved several steps. First, change the code so that the id of the root asset is always obtained using the API rather than assuming either that the parent_id is 0 or that the id is 1. This solves problems when the asset table data has been created outside of Joomla and imported, possibly with the root not as the first record.

    Second, when there are no rules available, for example when the asset is not found, the root asset rules are used regardless of whether the rules are being treated as recursive or not. This is important for a number of reasons not least of which is it provides super user permissions if available. Previously in this situation the super user did not have special super user permissions.

    Third, there are some complications when getActions/getActionsFromFile/getActionsFromData do not include a section that matches an asset (that is that final assets are parented to the root asset with nothing akin to a component in between). In this case, such assets will now fall back to the root asset for their rules unless something else is provided.

    Fourth, a number of the tests for JRules and JAccess had incorrect expected results. These have been corrected.

  156. [#1417] Allowing override of the xx-XX.localise.php (infograf768)

    This patch let's override the settings in the localise.php file without touching at the original file in the core language folders by letting add an xx-XX.localise.php file in the language/overrides/ folders. For example the maximum number of characters allowed to search.

  157. [#1419] Add active flag to JPaginationObject, add coverage-legacy to build/.gitignore (mbabker)

    This adds a flag to JPaginationObject so that items can be reported as the active page in the pagination.

    Also, I added the legacy unit report coverage to the .gitignore since it wasn't there.

  158. [#1420] Allow template to override system message (vietvh)

    Previous pull:

    This pull will allow template developer to override the system message by putting a file name 'message.php' in template's html folder. If no message template file found, the default (current) markup will be used.

  159. [#1421] Add patch() method to JHttp. (dianaprajescu)
  160. [#1426] Fix improper detection of UTF-8 encoding in strcasecmp and strcmp. (elinw)

    The test of whether locale is UTF-8 is incorrect because it is missing the 'utf8' string which is commonly what is in the string returned when locale0 is obtained.

  161. [#1428] [#28817] Cache not being cleared automatically when changes are made in (dextercowley)
  162. [#1429] Add more unit tests from the CMS. (realityking)
  163. [#1430] Missing parentheses in grid sort (dextercowley)

    This causes sort columns to not work correctly in CMS manager screens. For example, the desc icon always shows.

  164. [#1433] Import additional tests from the CMS. (realityking)

    Also fixes two small bugs in JLanguage revealed by the tests.

  165. [#1435] Fix code style for JsonSerializable. (realityking)

    For some strange reason this was picked up the CMS style checker but not by ours.

  166. [#1439] Make mysqli the default driver everywhere and use exception chaining in JDatabaseDriverPdo (realityking)
  167. [#1438] Fixing warnings triggered by cURL when no response is received. (pasamio)

    This pull request resolves a situation where when no response from a server is received a PHP warning is thrown by the cURL transport. Instead the code triggering the warning is mitigated and additionally a check to see if there was any response data is added to validate a response was actually received or throw an exception.

  168. [#1440] Further reduce dependency on JObject and the filesystem package (realityking)

    The change to JLanguage saved 0.2 MB RAM with language debug on in my testing.

  169. [#1443] Regex filter fits (Radek-Suski)

    Modified the regular expression in language debugger to include dot sign as a valid KEY character and allow including an escaped double quotes inside the value (right-hand)

  170. [#1444] Fix cache error due to incorrect commit 83eb8fae (dextercowley)

    I goofed with the prior pull request. This should fix it. Thanks.

  171. [#1446] Remove JToolbar and JHelp. (realityking)

    They have been moved to the CMS.

  172. [#1447] Add stripIframe method (elinw)

    In doing some work with feeds I noticed that we have stripImage available, but we don't have a way to strip iFrames which pose similar or more serious issues than images. A separate method makes sense because sometimes it is very reasonable to take the images from a feed but not to want the risks associated with iFrames.

  173. [#1448] [#28912] Browser doesn't respond when debug language is enabled (pjwiseman)

    Simplified regex to prevent stack overflow on long strings.

  174. [#1449] Implement Countable in JInput. (realityking)

    We need this in the CMS to remove some uses of JRequest.

  175. [#1450] Remove pointless comments. (realityking)

    I got bored on the train today and thought I clean this up ;)

    This removed all occurrences of the "Initialise variables" comment which is pretty pointless since the code is absolutely self explanatory.

  176. [#1451] Add missing return in the "extract()" (jms2win)

    This apply the fix reported in the issue

  177. [#1452] Fix issue with Oracle timestamp (pasamio)

    This pull request fixes up an issue with the Oracle NLS_DATE_FORMAT not being set properly after the change to add the NLS_TIMESTAMP_FORMAT to the set. The code should have duplicated theexecute() clause however this was not done so this meant that the NLS_TIMESTAMP_FORMAT was updated triggering timestamp fields to follow with the right format however the NLS_DATE_FORMAT wasn't set properly triggering the existing date fields to utilise the wrong format.

  178. [#1453] Allow database queries to always be counted (eddieajau)

    This change moves the query count out of the debug conditional, so that the number of queries the driver executes is always counted (meaning JDatabaseDriver::getCount is always available). The additional overhead would be negligible but allows permanent access to a useful statistic regardless of the debug setting but without the overhead of storing all the queries.

  179. [#1455] Add .gitignore for the unit tests' tmp folder. (aaronschmitz)

    Ignores: /tests/tmp/cache/.php /tests/tmp/cache/_testing /tests/tmp/media /tests/tmp/themes /tests/tmp/error.

  180. [#1457] Fix JInput loading in JApplicationCli (elkuku)

    The autoloader is quite case sensitive ;)

  181. [#1458] Fix bug in JString::parse_url that causes urlencoded strings to be decoded (aaronschmitz)

    Switch JString::parse_url to return false on failure as specified in it's doc block. JString::parse_url is now identical to parse_url for ascii strings.

  182. [#1461] Remove follow redirects. (dianaprajescu)

    I have removed the option to automatically follow redirects for reasons specified in pull request #1432

  183. [#1462] Reduce dependency on JFile. Deprecate JFile::read() and JFile::getName(). (realityking)
  184. [#1464] If the locale isn't available, skip the unit tests so they don't fail. (aaronschmitz)
  185. [#1466] Add additional unit tests. (realityking)

    Also fix a bug with JStream revealed by the tests.

  186. [#1471] Add name.min.ext file format to debug check (mbabker)

    Improving on JHtml::includeRelativeFiles() debug mode checks, I've added the possibility for files supplied in the format name.min.ext (jQuery files use this format for example) to be loaded in an uncompressed format in debug mode by stripping the .min portion of the filename out instead of appending -uncompressed.

    Sample use case: In some code (, I currently manually check for JDEBUG and change the filename as appropriate. With this patch, the conditional around JDEBUG is no longer necessary in my code.

  187. [#1472] Add password hashing interface and basic implementation. (ianmacl)

    This will provide basic password hashing capabilities using a straightforward and easy to use interface.

    Use is easy: $hasher = new JCryptPasswordSimple();

    $hash = $hasher->create('MyPasswordHere', JCryptPassword::BLOWFISH);

    $isPasswordCorrect = $hasher->verify('MyPasswordHere', $hash);

    The basic implementation supports BLOWFISH, MD5 and the legacy Joomla password format. For more complex requirements an alternative implementation of the interface can be supplied and used.

  188. [#1473] Fix a grammar mistake in a comment (elinw)
  189. [#1474] Set guest properly after load in JUser (stefanneculai)

    This is a fix for issue #1427

  190. [#1475] Move JHtmlBehavior::_getJSObject() to JHtml::getJSObject(). (realityking)

    Reduces code duplication a fair bit.

  191. [#1476] More preparations for removing the mysql driver. (realityking)

    I hope the is the final step, at least I didn't find anymore dependencies on mysql.

  192. [#1477] Deal with the PDO class not being available. (realityking)

    Database drivers that use PDO throw fatal erros when isSupported() is called and the PDO class doesn't exist.

  193. [#1478] Fixed a fatal error in JHttpTransportStream. (robschley)
  194. [#1482] Update version history (elinw)
  195. [#1483] Making the Joomla platform loadable as a dependency from Composer (2) (eirslett)

    See this discussion:

  196. [#1484] Make sure JFolder is imported in files that use it. (realityking)

    Due to using JFolder less and less classes that just relied on it to be already loaded now error out. This pull adds all the missing jimports so this doesn't happen.

  197. [#1485] Todos should not be included in the repository in most cases (elinw)
  198. [#1486] Validate that the key parameter is a string (pasamio)

    This pull request validates that the $key parameter provided to the function is actually a string before trying to use this. I came across this as I was working to modify JTable to be able to support multiple primary keys in a somewhat transparent way. By default JTable passes through it's keys onto the databaseinsertObject and updateObject function which works well for single keys but not properly forinsertObject when the $key is an array.

  199. [#1487] Fix issues with Oracle DB Unit (pasamio)

    This commit provides some extra functionality and fixes to the Oracle DB Unit base case. It fixes an issue with the URI parsing where the preceding slash was included with the database name which triggered errors and it also supports passing in a custom Oracle database schema and table prefix as well. A bug with the charset is also fixes to use the right field instead of the host field it was previously using.

  200. [#1493] Removing doc references to JController in JViewBase and JViewHtml (dongilbert)

    When the new MVC was proposed, the original JViewBase and JViewHtml classes took a required second parameter of a JController object. This is not the case now. This pull request updates the docs to reflect the code.

  201. [#1495] Fix some small holes in the test coverage. (realityking)
  202. [#1496] Reduce dependency on JFolder and JFile. (realityking)
  203. [#1498] Deprecating IS_MAC in favor of IS_UNIX (dongilbert)
  204. [#1501] Improve test coverage some more. (realityking)
  205. [#1503] Bring some sanity to JComponentHelper::isEnabled (realityking)

    JComponentHelper::isEnabled is a rather confusing piece of API, this should let it behave as expected.

    Please don't pull this until we have buy-in from the CMS since this a B/C break and a CMS specific piece of API!

  206. [#1505] Remove JEditor since it has been moved to the CMS. (realityking)
  207. [#1506] Fix errors introduced in #1504. (realityking)
  208. [#1504] Reduce phpmd warnings. Cover all out folders with phpmd. (realityking)
  209. [#1513] Add a lint target to build.xml and fix an error found by it. (realityking)
  210. [#1397] Some additional changes since memory_get_usage() is now always available. (realityking)

    No addition to the deprecated log because I felt JProfiler should remain without dependencies on other classes.

  211. [#1360] Route Query String Fix and Raw Route (pasamio)

    This pull request fixes an issue where if a query string contained a colon in it (e.g. ?filters=content_id:20) that PHP's parse_url function would get confused. This meant that it would fail to properly process the path resulting in the first path segment being truncated erroneously and no match found for the route. This pull request preprocesses the route to remove the query string before parse_url function so that it will work reliably.

    The second change is pushing into the input the raw route for the request. This is to permit direct access to the route segments in the controller should it wish to make further decisions based on the route segments. A use case is multiple hard coded mappings where the last segment is not variable however may have meaning to the individual controller (e.g. there are limited options available that can be reasonably elaborated).

  212. [#1395] We have to prefer the main libraries over the legacy libraries. (realityking)

    Otherwise we're in autoloader hell.

    This breaks the current platform on the CMS.

  213. [#1394] Various little cleanups. (realityking)

    -Fix package tags. -Remove an useless file. -Add a unit test for JFactory::getXML() -Prefer not to use aliases for functions. -Prevent a deprecation warning in a supported case.

  214. [#1358] Move JURI to its own package. Stop using JFactory::getUri(). (realityking)
  215. [#1361] Build multi-key update support for JDatabaseDriver::updateObject. (pasamio)

    This pull request provides support for providing an array as the key to the JDatabaseDriver::updateObject method. This permits updating objects where there is more than a single key for the given table. JDatabaseDriver::insertObject does not require this because it can directly insert without worrying about providing a where clause which is required for the update statement to work properly. This change is backwards compatible and will map the $key from a string to array if a string is provided. Support is also provided for re-mapping an object into an array for using objects as well for the key.

  216. [#1353] Fix a bug where the session could be started twice and additional improvements to JSession. (realityking)
  217. [#1321] Three Bug Fixes (robschley)

    Fixed fatal error in JCacheStorageMemcached. Fixed JHttpTransportCurl not following redirects. Fixed an undefined offset notice in JInput.

  218. [#1314] Fix issue with cURL confusing itself with 100 Continue headers. (pasamio)

    cURL has an issue handling 100 Continue headers. It sends an Expect for 100 Continue however when it was given a 100 Continue header, it uses that and populates it with no header information and then puts the expected headers in with the rest of the body. This obviously makes life rather difficult to process the headers or make any assumptions about the contents of the body.

  219. [#1291] Add in robot detection (stefanneculai)

    Fix for issue #1254.

    Code and tests included.

  220. [#1290] Method in POST requests - router for RESTful web application (stefanneculai)

    Most of the RESTful web applications allow to pass method as a parameter in the POST request, because not all clients support advanced methods such as PUT or DELETE.

    I have added in a variable called methodInPostRequest in the JApplicationWebRouterRestwhich allows or not such requests.

    There are tests for the new code too.

  221. [#1276] Remove dependency on JObject from JApplicationBase. (realityking)

    Causes some small backwards compatibility problems in the CMS but overall still a good idea.

    Special pull request for @LouisLandry

  222. [#1281] Create a legacy package. (realityking)

    This has advantages for documentation and JDepend.

  223. [#1259] New (and generic) web application routers. (LouisLandry)

    I still need to write some documentation, but hopefully the code is simple and clean enough to understand clearly. There are three new classes: JApplicationWebRouterJApplicationWebRouterBaseand JApplicationWebRouterRest. These are not meant to be one size fits all. They are meant to provide a solid foundation for what is hopefully the majority of use cases in URL routing.


    The foundational web router class is abstract. The premise of the class is that some sort of route string would be passed into the execute method, that string would be parsed within the parseRoute() method to determine the name of the appropriate controller to execute, then fetchController() would be called to actually instantiate the controller object and return it. Once that is done then the controller is simply executed.

    I've purposefully not provided an implementation of parseRoute() in the base class because there are infinite different ways a route can be examined to determine how to proceed. Other features of the class include the ability to set a default controller name if an empty route was given, and also the ability to set a controller class prefix that would be prepended to any controller name returned from parseRoute().


    The basic concrete implementation of JApplicationWebRouter provides a very simple algorithm to parse routes based on a pattern => controller mapping. The premise is that if an incoming route matches the given pattern than the associated controller will be returned and ultimately executed. It is important to note that for this implementation the pattern is not a regular expression. The route and patterns are broken down into segments split over / and evaluated segment by segment. There must be an exact match for all segments to constitute the route matching the pattern.

    For example if we have pattern continents/europe:

    • The route continents/europe is a match. [Every segment matches]
    • The route continents/asia is NOT a match. [The second segment asia does not match europe]
    • The route continents/europe/germany is also NOT a match. [The final segment germany is not in the pattern]


    Along with standard string comparison for route segments, patterns can include variables by prefixing the segment with a :. To continue with our previous example let's make the actual continent a variable.

    The new pattern is continents/:continent:

    • The route continents/europe is a match. [Every segment matches because europe is in a variable segment]
    • The route continents/asia is ALSO a match. [Again, asia is in a variable segment]
    • The route continents/europe/germany does NOT a match. [The final segment germany is still not in the pattern even though the europe segment works since it is in a variable segment]

    A side effect of using variables is that the variable name (everything in the segment except the opening:) is added to the application input object with the value found in a successful route match. Using the same example as above; pattern continents/:continent:

    • The route continents/europe matches and the application input object will have europe set for input variable continent.
    • The route continents/asia matches and the application input object will have asia set for input variable continent.

    Note: If you need to start a segment of your pattern with a : and do not want the segment to be considered a variable simply escape the colon like \:.


    In addition to the standard per-segment variables you can use the asterisk * symbol to indicate a match across segments. For example the pattern continents/*/berlin would match a routecontinents/europe/germany/berlin. It would not match the routecontinents/europe/germany/frankfurt since it is looking for the last segments to be berlin.

    If you want to capture the part of the route that matches the splat then you simply need to name the segment. For example the pattern continents/*cont_nation/berlin would still match the routecontinents/europe/germany/berlin however this time the input object will haveeurope/germany set for the input variable cont_nation.

    You can also mix and match the splats and variables such as the pattern continents/*/:city. That will match the route continents/europe/germany/berlin and berlin will be the value for the input variable city.

    Note: Similar to variables if you need to start a segment of your pattern with a * and do not want the segment to be considered a splat simply escape the asterisk like \*.


    The generic RESTful router extends JApplicationWebRouterBase and inherits the same pattern matching with variables as discussed above. The only addition is that JApplicationWebRouterRestalso maintains a map of HTTP Methods [GET, POST, PUT, etc.] to controller class suffixes. This is used so that you can namespace your controllers based on the type of action being performed on the resource. As an example if we have an application that manages resources called "articles" we would only need two pattern rules: one for with an article ID and one for without.

    • articles => articles - If no ID is present.
    • articles/:article_id => articles - If an article ID is present.

    Let's also set the controller prefix to MyController since that happens to be my application's prefix for finding controllers.

    Now all we need are the following classes since the JApplicationWebRouterRest router is going to take care of the HTTP Method mapping for us.

    • MyControllerArticlesCreate - POST /articles - Create a new article.
    • MyControllerArticlesDelete - DELETE /articles/42 - Delete article 42.
    • MyControllerArticlesGet -GET /articles/7` - Get article 7.
    • MyControllerArticlesUpdate - PUT /articles/7 - Save an update to article 7.
  224. [#1278] Add support for changing the default schema when connecting to Oracle. (pasamio)

    This pull request adds support for changing the default schema when connecting to an Oracle database. This is useful for when the user connecting isn't the same user as the desired schema where the Oracle tables are being stored. This adds a new schema option to the supported options for Oracle. Schema is similar to database name in other systems however as Oracle treats database names differently when connecting this is a distinct option.

  225. [#1269] Reduce dependency on JObject. (realityking)
  226. [#1275] Remove references to zend.ze1_compatibility_mode. (realityking)

    It has been removed in PHP 5.3.

  227. [#1212] Fix typos in JInstaller. (realityking)
  228. [#1211] Fix the subpackage tag for the controller package. (realityking)

    Makes the dependency graph a bit more helpful.

228 Pull Requests:

  1. realityking: 91
  2. elinw: 22
  3. mbabker: 14
  4. pasamio: 12
  5. chdemko: 7
  6. aaronschmitz: 6
  7. infograf768: 5
  8. dianaprajescu: 5
  9. stefanneculai: 4
  10. elkuku: 4
  11. LouisLandry: 4
  12. florianv: 4
  13. phproberto: 3
  14. robschley: 3
  15. piotr-cz: 3
  16. dextercowley: 3
  17. ShMaunder: 3
  18. eddieajau: 3
  19. dongilbert: 3
  20. rvsjoen: 2
  21. benjaminpick: 2
  22. ianmacl: 2
  23. okonomiyaki3000: 2
  24. eirslett: 2
  25. ramalama: 2
  26. vietvh: 2
  27. gpongelli: 2
  28. pborreli: 1
  29. jms2win: 1
  30. Bakual: 1
  31. pjwiseman: 1
  32. Radek-Suski: 1
  33. jamesmoey: 1
  34. garyamort: 1
  35. Denitz: 1
  36. rdeutz: 1
  37. sybrek: 1
  38. Octobit: 1
  39. bembelimen: 1
  40. juliopontes: 1

Merged By:

  1. LouisLandry: 95
  2. chdemko: 46
  3. realityking: 41
  4. ianmacl: 22
  5. pasamio: 17
  6. eddieajau: 4
  7. robschley: 2
  8. eirslett: 1