[ticket/14077] Fall back to 1 as focusOffset if length is unsupported
* marc1706/ticket/14077:
[ticket/14077] Fall back to 1 as focusOffset if length is unsupported
The setBaseAndExtent() in Microsoft's Edge browser is incompatible with
the one Webkit browsers use. As a result of that, we have to fall back to
setting the focusOffset to 1 instead of the text length.
PHPBB3-14077
[ticket/14049] Use headers from config when sending Plupload delete request.
* prototech/ticket/14049:
[ticket/14049] Use headers from config when sending Plupload delete request.
An event to capture new avatar moving in place (and maybe overwriting
existing avatar), and another to capture deletion. Includes better error
processing. Rename event.
PHPBB3-13981
An event to capture overwriting, and another to capture deletion.
Includes better error processing. Replaced global by dependency injection.
Fix Travis tests.
PHPBB3-13981
Events added in events.md
Add in template posting_editor.html for link to custom panel
Add in template posting_layout.html for include of custom panel template body
PHPBB3-13843
Event added for the function delete_forum_content() in
includes/acp/acp_forums.php, so that you can insert any extension's table(s)
to be updated when forum content is deleted
Incude parameters forum_id, topic_ids and post_counts
PHPBB3-13311
An event to capture overwriting, and another to capture deletion.
Includes better error processing. Replaced global by dependency injection.
Fix typo.
PHPBB3-13981
An event to capture overwriting, and another to capture deletion.
Includes better error processing. Replaced global by dependency injection.
PHPBB3-13981
Add events to present information around ranks in the memberlist,
user profile, viewtopic profile and private message profile.
Slight repositioning of events in the memberlist.
PHPBB3-13982
Adds core events to includes/acp/acp_profile.php and template events
to adm/style/acp_profile.html to support adding configuration options
to profile fields. Fixed version number again.
PHPBB3-13911
Added draft_id to the core.posting_modify_template_vars event in posting.php,
to provide the ability to use the 'checked' draft_id in extensions,
in addition to the 'raw' draft_id provided in earlier events in posting.php
PHPBB3-13971
As requested events are named *_after
core.session_start_after is moved after
USERS_TABLE update to prevent returning
session data from extensions
PHPBB3-13817
Ticket was changed to add few more session related events
core.session_kill - send user_id and session_id
core.session_gc - just triger event
PHPBB3-13817
[ticket/13903] Replacing regexp path naming for container by md5.
* bantu/ticket/13903:
[ticket/13903] Replacing regexp path naming for container by md5.
[ticket/12952] Check obvious errors before status in functional tests
* marc1706/ticket/12952:
[ticket/12952] Check obvious errors before status in functional tests
This will change the output from just saying that the status did not match
the expected one to actually showing any errors before complaining about a
possible difference in the status code.
PHPBB3-12952
[ticket/13941] Workaround to fix the bug on php 5.5 with sqlite3
* Nicofuma/ticket/13941:
[ticket/13941] Workaround to fix the bug on php 5.5 with sqlite3
In certain situations, an SQL error DUPLICATE ERROR for KEY 'PRIMARY'
in the forums_track table is produced when marking forums read
(viewforum.php?f=xx&mark=forums).
The problem happens when there are duplicates in the forum_id array.
The solution is to remove those duplicates.
PHPBB3-10711
Removed:
-w, --ignore-all-space Ignore white space when comparing lines.
Added:
-Z, --ignore-trailing-space Ignore white space at line end.
-b, --ignore-space-change Ignore changes in the amount of white space.
PHPBB3-13823
[ticket/13930] Check for correct spacing between keyword & parenthesis
* marc1706/ticket/13930:
[ticket/13930] Add missing spaces to code
[ticket/13930] Use OpeningParenthesisSniff in legacy ruleset
[ticket/13930] Remove not needed return statements
[ticket/13930] Add missing spaces to code
[ticket/13930] Check for correct spacing between keyword & parenthesis
This changes the line with non-whitespace changes, so the packaging script
should correctly detect them as changed and put the file into the update.
PHPBB3-13823
While suppressing the output from the 'set_magic_quotes_runtime(0)'
is sufficient with normal phpBB installs, using this file in association
with the oauth plugin will cause an error on some versions of PHP.
This fixes a potential bug where set_magic_quotes_runtime is depreciated
in newer versions of PHP.
PHPBB3-13923
Adds core events to includes/acp/acp_profile.php and template events
to adm/style/acp_profile.html to support adding configuration options
to profile fields. Fixed version number and event name.
PHPBB3-13911
Adds core events to includes/acp/acp_profile.php and template events
to adm/style/acp_profile.html to support adding configuration options
to profile fields. Fix bamboo formatting errors.
PHPBB3-13911
Adds core events to includes/acp/acp_profile.php and template events
to adm/style/acp_profile.html to support adding configuration options
to profile fields.
PHPBB3-13911
Event added for the function move_topics() in
includes/functions_admin.php, so that you can insert any extension's table(s)
to be updated when topics are moved between forums
Added parameters topic_ids, forum_id, forum_ids and auto_sync
PHPBB3-13841
[ticket/13875] Ignore cache, ext, and store folder in lint test
* marc1706/ticket/13875:
[ticket/13875] Ignore cache, ext, and store folder in lint test
This PR adds typekit and Google's webfontloader and calls it
asyncronously, removing the SPOF in the header. Now, if google
goes down, some buttons display with a different font.
https://github.com/typekit/webfontloader
PHPBB3-13876
Modified the core.posting_modify_template_vars event in posting.php
to extend the content of the page_data array to include poll data.
That required moving the event and merging the new set of template vars.
Also include the poll variable in the parameter list for event
core.posting_modify_submission_errors, as it was missing, and any
modification here on post_data for poll related data is silently
ignored. Added correct @change tags to both events.
PHPBB3-13795
Three new events are included:
1) Core event to perform new moderator action in includes/mcp/mcp_post.php
2) Core event to add/modify template data in includes/mcp/mcp_post.php
3) Template event to present new options in template/mcp_post.html
Remove extra template variable around the new event.
PHPBB3-13786
* marc1706/ticket/12542:
[ticket/12542] Use more specific CSS for drag-n-drop
[ticket/12542] Do not use browser specific css for outline
[ticket/12542] Properly check if textarea is undefined or null
[ticket/12542] Use extended CSS for all browsers
[ticket/12542] Rename javascript method and add doc block
[ticket/12542] Add different outline colors for body & textarea
[ticket/12542] Add initial drag-n-drop animation
[ticket/13672] Allow changing the data from the user-submitted report
* brunoais/ticket/13672:
[ticket/13672] Removed bogus sting concatenation
[ticket/13672] BUMP version to 3.1.5-dev
[ticket/13672] Allow changing the data from the user-submitted report
[ticket/13668] Allow changing the query to obtain the user-submitted report
* brunoais/ticket/13668:
[ticket/13668] Removed bogus sting concatenation
[ticket/13668] BUMP version to 3.1.5-dev
[ticket/13668] Allow changing the query to obtain the user-submitted report.
[ticket/13668] Convert the mcp report_details query to a built query
[ticket/13661] Add event to allow editing the queries used to get the logs
* brunoais/ticket/13661:
[ticket/13661] BUMP version to 3.1.5-dev
[ticket/13661] Brackets in their own line
[ticket/13661] Re-Fixed $log_type -> $log_time
[ticket/13661] Wrong event @since version
[ticket/13661] Removed superfluous whitespace
[ticket/13661] bugfix: The conditional is the log_time, not log_type
[ticket/13661] Fixed the "FROM" in the built query.
[ticket/13661] Add event to allow editing the queries used to get the logs
[ticket/13661] Transform queries to get logs and log count into built queries
Extensions may be designed to add secondary search options,
such as Google search in the search_body.html.
There are no events in the searchbody, so this should be merged.
PHPBB3-13808
Add generate_forum_nav() core event in includes/functions_display.php
to allow modifying navlinks text. Use case example: extension(s) implementing
multilanguage boards including translated forum names and so on.
PHPBB3-13750
[ticket/13819] Add missing sql_freeresult() to files in includes/
* marc1706/ticket/13819:
[ticket/13819] Add missing sql_freeresult() to files in includes/
Modified the core.posting_modify_template_vars event in posting.php
to extend the content of the page_data array to include poll data.
That required moving the event and merging the new set of template vars.
Also include the poll variable in the parameter list for event
core.posting_modify_submission_errors, as it was missing, and any
modification here on post_data for poll related data is silently
ignored.
PHPBB3-13795
The purpose is to allow adding custom post buttons outside of original post
buttons conditionals/list in prosilver (for subsilver2 it's not the issue).
PHPBB3-13791
Modified the core.posting_modify_template_vars event in posting.php
to extend the content of the page_data array to include poll data.
That required moving the event and merging the new set of template vars.
PHPBB3-13795
* prep-release-3.1.4:
[ticket/security-180] Use language variable for redirect error in 3.1+
[ticket/security-180] Merge if statement with previous one in 3.1.x
[ticket/security-180] Add tests for redirecting to main URL
[ticket/security-180] Always fail when redirecting to an insecure URL
[ticket/security-180] Make sure that redirect goes to full URL plus slash
[ticket/security-180] Check if redirect URL contains board URL
* phpbb-security/ticket/security-180-asc:
[ticket/security-180] Use language variable for redirect error in 3.1+
[ticket/security-180] Merge if statement with previous one in 3.1.x
[ticket/security-180] Add tests for redirecting to main URL
[ticket/security-180] Always fail when redirecting to an insecure URL
[ticket/security-180] Make sure that redirect goes to full URL plus slash
[ticket/security-180] Check if redirect URL contains board URL
* prep-release-3.0.14:
[ticket/security-180] Add tests for redirecting to main URL
[ticket/security-180] Always fail when redirecting to an insecure URL
[ticket/security-180] Make sure that redirect goes to full URL plus slash
[ticket/security-180] Check if redirect URL contains board URL
* phpbb-security/ticket/security-180:
[ticket/security-180] Add tests for redirecting to main URL
[ticket/security-180] Always fail when redirecting to an insecure URL
[ticket/security-180] Make sure that redirect goes to full URL plus slash
[ticket/security-180] Check if redirect URL contains board URL
* 3.0.x:
[3.0.x] Increment version number to 3.0.15-dev.
Conflicts:
build/build.xml
phpBB/includes/constants.php
phpBB/install/database_update.php
phpBB/install/schemas/schema_data.sql
* prep-release-3.1.4:
[3.0.x] Add changelog for 3.0.14 release.
[3.0.x] Bump version numbers for 3.0.14-RC1 release.
[3.0.x] Bumping version numbers to final for 3.0.14 releases.
[ticket/12101] Remove HTML redirect workaround for Microsoft/IIS webserver
* akoeplinger/ticket/12101:
[ticket/12101] Remove HTML redirect workaround for Microsoft/IIS webserver
Three new events are included:
1) Core event to perform new moderator action in includes/mcp/mcp_post.php
2) Core event to add/modify template data in includes/mcp/mcp_post.php
3) Template event to present new options in template/mcp_post.html
Fix another typo.
PHPBB3-13786
Three new events are included:
1) Core event to perform new moderator action in includes/mcp/mcp_post.php
2) Core event to add/modify template data in includes/mcp/mcp_post.php
3) Template event to present new options in template/mcp_post.html
Fix typo.
PHPBB3-13786
Three new events are included:
1) Core event to perform new moderator action in includes/mcp/mcp_post.php
2) Core event to add/modify template data in includes/mcp/mcp_post.php
3) Template event to present new options in template/mcp_post.html
PHPBB3-13786
When options are shown and poll delete is allowed, the option to
delete
polls is shown twice. This is fixed here by moving the if poll
delete
check out of the outer if, wich makes it also more consistent
with the
new event.
PHPBB3-13787
The code was added as a workaround for bugs in very old versions of IIS,
dating back to 2002: see commit 849d766974.
Newer IIS versions handle the 'Location' header just fine, so we can avoid
the unnecessary HTML page for redirects. Given that it seems to work fine
since IIS 6.0 (on WinServer 2003), I don't think it's worth adding a special
check for earlier versions as they are no longer supported by MS as well.
PHPBB3-12101
Migrations' permission tool allows setting permissions to the role which
doesn't match the role type, e.g. m_ permissions for u_ role types and so on.
As one of side effects, this may lead to granting users moderative/admin
permissions silently.
With this patch the only new permissions matching the role type will be set.
PHPBB3-13779
[ticket/13765] Verify SERVER_PROTOCOL has the expected format before using it.
* bantu/ticket/13765-3.1.4:
[ticket/13765] Verify SERVER_PROTOCOL has the expected format before using it.
[ticket/13765] Verify SERVER_PROTOCOL has the expected format before using it.
* bantu/ticket/13765-3.1.4:
[ticket/13765] Verify SERVER_PROTOCOL has the expected format before using it.
[ticket/13765] Verify SERVER_PROTOCOL has the expected format before using it.
* bantu/ticket/13765:
[ticket/13765] Verify SERVER_PROTOCOL has the expected format before using it.
* ticket/13765:
[ticket/13765] Verify SERVER_PROTOCOL has the expected format before using it.
Conflicts:
phpBB/includes/functions.php
phpBB/includes/startup.php
message_parser.php performs include of bbcode.php at the very start using
$phpbb_root_path and $phpEx vars, so there's a possibility those can be
undefined at that point, especially when message_parser.php is being included
in event listener or another extension file where $phpbb_root_path and $phpEx
don't exist. This can be fixed by adding the appropriate vars definitions.
PHPBB3-13743
This change makes the uploaded avatars use the PHPBB_USE_BOARD_URL_PATH
constant, which is needed when trying to use the get_user_avatar()
function in a listener for index changes.
PHPBB3-13703
This changes how the native FULLTEXT search calculates the total
match number for MySQL.
This should improve performance as there is one less query being made
and it is being searched using the technique mentioned in the manual
PHPBB3-13674
[ticket/13670] Modify variable-variable syntax in common avatar test for PHP/
* marc1706/ticket/13670:
[ticket/13670] Modify variable-variable syntax in common avatar test for PHP7
The event now has nearly all variables and it is in the place where it can
most influence this method's outcome without requiring the extension
to re-process phpBB's code.
PHPBB3-13142
[ticket/13643] Change the priority of kernel_terminate_subscriber to -10000
* Nicofuma/ticket/13643:
[ticket/13643] Change the priority of kernel_terminate_subscriber to PHP_INT_MIN
The rule is a left over from development. it should be removed from colours.css
.icon-search-advanced { background-image: url("./images/icon_search_adv.gif");}
Area21 ticket: https://area51.phpbb.com/phpBB/viewtopic.php?f=81&p=275166
PHPBB3-13639
Currently email addresses are parsed incorrectly due to the regex structure.
Namely, if localpart consists of several dot separated parts, only the last
part with the trailing dot will be captured.
The patch change this behavior to capture the whole localpart.
PHPBB3-13433
Added topics_count, sort_days, sort_key and sort_dir to
core.viewforum_get_topic_data and adjusted the event's comment explaining
it's possible extended purpose now that it has more variables.
PHPBB3-13625
Avatar Gallery shows categories but no images in subsilver2.
The ID was not specified in the template. Also, the correct parent template
loop is called avatar_local_row and not avatar_local_col.
PHPBB3-13615
[ticket/13597] Modify variable-variable syntax to be compatible with PHP7
* marc1706/ticket/13597:
[ticket/13597] Modify variable-variable syntax to be compatible with PHP7
Add display_forums() core event in includes/functions_display.php to allow
modifying forums list data before the list is being generated and dumped
to the template.
PHPBB3-13596
[ticket/13348] Use close method to free feed query result handle
* marc1706/ticket/13348:
[ticket/13348] Remove unnecessary global $cache
[ticket/13348] Use close method to free query result handle
[ticket/13348] Use close method to free query result handle
* marc1706/ticket/13348-olympus:
[ticket/13348] Remove unnecessary global $cache
[ticket/13348] Use close method to free query result handle
[ticket/13538] Add tests for pagination in nested loops
* marc1706/ticket/13538:
[ticket/13538] Add tests for double nested pagination loop
[ticket/13538] Fix tests for pagination in nested loop
[ticket/13538] Add test for pagination in nested loop
* prep-release-3.0.13:
[prep-release-3.0.13] Correct changelog link to 3.0.13 changes.
[prep-release-3.0.13] Also update version in references to files.
[prep-release-3.0.13] Add changelog for 3.0.13-PL1 release.
[prep-release-3.0.13] Get rid of roman numbers in CHANGELOG.html.
[prep-release-3.0.13] Bump version numbers for 3.0.13-PL1 release.
Conflicts:
build/build.xml
phpBB/includes/constants.php
phpBB/install/database_update.php
phpBB/install/schemas/schema_data.sql
* prep-release-3.1.3:
[prep-release-3.0.13] Correct changelog link to 3.0.13 changes.
[prep-release-3.0.13] Also update version in references to files.
[prep-release-3.0.13] Add changelog for 3.0.13-PL1 release.
[prep-release-3.0.13] Get rid of roman numbers in CHANGELOG.html.
[prep-release-3.0.13] Bump version numbers for 3.0.13-PL1 release.
* prep-release-3.0.13:
[prep-release-3.0.13] Correct changelog link to 3.0.13 changes.
[prep-release-3.0.13] Also update version in references to files.
[prep-release-3.0.13] Add changelog for 3.0.13-PL1 release.
[prep-release-3.0.13] Get rid of roman numbers in CHANGELOG.html.
[prep-release-3.0.13] Bump version numbers for 3.0.13-PL1 release.
[ticket/13549] Do not exit when ORIG_PATH_INFO just contains SCRIPT_NAME.
[ticket/12933] Handle case when * is last character of word
[ticket/13554] Show feature release upgrades in blue rather than red.
Conflicts:
build/build.xml
phpBB/adm/style/acp_update.html
phpBB/docs/CHANGELOG.html
phpBB/docs/INSTALL.html
phpBB/includes/constants.php
phpBB/includes/startup.php
phpBB/install/database_update.php
phpBB/install/schemas/schema_data.sql
tests/security/trailing_path_test.php
* develop-olympus:
[ticket/13549] Do not exit when ORIG_PATH_INFO just contains SCRIPT_NAME.
Conflicts:
phpBB/includes/startup.php
tests/security/trailing_path_test.php
[ticket/13549] Do not exit when ORIG_PATH_INFO just contains SCRIPT_NAME...
* bantu/ticket/13549:
[ticket/13549] Do not exit when ORIG_PATH_INFO just contains SCRIPT_NAME.
[ticket/12933] Handle *wildcard character in native search
* dhruvgoel92/ticket/12933:
[ticket/12933] Add test cases for * wildcard searches
[ticket/12933] Handle case when * is last character of word
The ORIG_PATH_INFO on IIS also contains the script name. Only use that
for killing the script after removing the script name from ORIG_PATH_INFO.
PHPBB3-13549
[ticket/13414] Set Content-Length header only if status is not 304
* marc1706/ticket/13414:
[ticket/13414] Set Content-Length header only if status is not 304
Added event core.topic_review_modify_row in function topic_review() in
functions_posting for modifying template data blocks for topic reviews.
PHPBB3-13540
Events added for the functions approve_posts(), approve_topics()
and disapprove_posts() in mcp_queue.php, so that you can send notifications
during approval and disapproval.
PHPBB3-13537
Adding core event core.markread_before to to funtion markread()
in functions.php, so that you now are able to add additional
stuff inside the markread process, for example notifications designed
in extensions.
PHPBB3-13518
Adding core event core.get_unread_topics_modify_sql to to funtion
get_unread_topics() in functions.php, so that you now are able to modify
the sql query that retrieves the unread topics.
PHPBB3-13532
Add core events to the function user_active_flip() in
includes/functions_user.php to allow checking/modifying data while
activating/deactivating users.
PHPBB3-13336
[ticket/13534] Set imagick path to empty string to prevent failing path ...
* marc1706/ticket/13534:
[ticket/13534] Set imagick path to empty string to prevent failing path check
* develop-olympus:
[develop-olympus] Increment version number to 3.0.14-dev.
[develop-olympus] Add changelog for 3.0.13 release.
[develop-olympus] Bump version numbers for 3.0.13-RC1 release.
[develop-olympus] Bumping version numbers to final for 3.0.13 releases.
Conflicts:
build/build.xml
phpBB/docs/CHANGELOG.html
phpBB/docs/INSTALL.html
phpBB/includes/constants.php
phpBB/install/convertors/convert_phpbb20.php
phpBB/install/database_update.php
phpBB/install/schemas/schema_data.sql
phpBB/styles/prosilver/imageset/imageset.cfg
phpBB/styles/prosilver/style.cfg
phpBB/styles/prosilver/template/template.cfg
phpBB/styles/prosilver/theme/theme.cfg
phpBB/styles/subsilver2/imageset/imageset.cfg
phpBB/styles/subsilver2/style.cfg
phpBB/styles/subsilver2/template/template.cfg
phpBB/styles/subsilver2/theme/theme.cfg
The imagick path defaults to /usr/bin. If it doesn't exist for some reason,
for example on travis, the form won't be submitted and the settings won't be
changed.
PHPBB3-13534
* develop-olympus:
[ticket/13527] Apply htmlspecialchars() to data from version server.
[ticket/13527] Remove two unused variables.
Conflicts:
phpBB/includes/acp/acp_update.php
[ticket/13527] Escape information received from version server
* bantu/ticket/13527:
[ticket/13527] Apply htmlspecialchars() to data from version server.
[ticket/13527] Remove two unused variables.
[ticket/13519] Correctly validate imagick path as path and not string
* marc1706/ticket/13519:
[ticket/13519] Correctly validate imagick path as path and not string
[ticket/13192] Add method for generating valid user page links based on mod_rewrite
* marc1706/ticket/13192:
[ticket/13192] Add test for app.php in external subfolder
[ticket/13192] Use ltrim() instead of preg_replace()
[ticket/13192] Order test cases consistently
[ticket/13192] Remove app.php on mod rewrite even if app.php is outside root
[ticket/13192] Pass correct parameters and rename method to get_valid_page
[ticket/13192] Use get_valid_user_page in confirm_box() and cleanup globals
[ticket/13192] Use get_valid_user_page method in build_url function
[ticket/13192] Add method for generating valid user page links
[ticket/13511] Call the check() method with the phpcsFile object
* Nicofuma/ticket/13511:
[ticket/13511] Call the check() method with the phpcsFile object
Adds a couple of variables to the event that allows extension authors to
bypass the f_read and forum password checks as if the user had those permissions
whether or not he actually has them.
PHPBB3-13160
Renamed content_replaced to get_global_visibility_sql_overwrite in order to
follow the convention in other events' variables that have the same basic
function
PHPBB3-13147
This change allows the usage of array($class, 'method')) directly instead of
having to use the functionX syntax as follows:
array('function1' => array($class, 'method')))
PHPBB3-13370
[ticket/13405] Fix a typo in phpbb/migration/data/v310/style_update_p1.php
* rxu/ticket/13405:
[ticket/13405] Fix a typo in phpbb/migration/data/v310/style_update_p1.php
Currently there's no space between the index name and columns list
when generating ADD INDEX sql query for MySQL DBMSes. This may cause errors
on earlier MySQL versions like 3.23.
PHPBB3-13406
posting.php core event to allow modifying the message before parsing
would be needed for some extensions, like for adding topic title to the
topic URL etc.
Also removed 'delete' var from core.posting_modify_template_vars and
core.modify_posting_parameters as it does not exist.
PHPBB3-13182
Add core event to the function parse() in includes/message_parser.php to allow
additional handling message before parsing (i.e. perform custom message
checks, cleanup etc.).
PHPBB3-13294
[ticket/13342] Fix invalid resetting of CAPTCHA plugin when using Recaptcha
* prototech/ticket/13342:
[ticket/13342] Fix invalid resetting of CAPTCHA plugin when using Recaptcha.
[ticket/13315] Fix loss of CAPTCHA plugin config value.
* prototech/ticket/13315:
[ticket/13315] Check for the includes/captcha/plugins/ directory instead.
[ticket/13315] Fix loss of CAPTCHA plugin config value.
The plugins were moved to phpbb/captcha/plugins/ after this migration was
created, thus the check is no longer valid and ends up resetting the value
prematurely.
PHPBB3-13315
The Recaptcha plugin class name does not follow the phpbb_captcha_ prefix
convention as all others. Instead it simply uses phpbb_, hence the check
for its existence under phpbb/captcha/plugins/ fails.
PHPBB3-13342
* github-nicofuma/ticket/13280:
[ticket/13280] Output escaping for the symfony request object
[ticket/13280] Add new tests
[ticket/13280] Make the tests failing
[ticket/13280] Revert "Merge pull request #3107 from marc1706/ticket/13280"
[ticket/13341] Change coverage to whitelist to prevent errors with temp ...
* bantu/ticket/13341:
[ticket/13341] Change coverage to whitelist to prevent errors with temp files.
Conflicts:
phpunit.xml.dist
b4f95deefc suggests that this can lead to issues
with classes having the same name. However, this does not seem to be a problem
with the current version of PHPUnit we are using.
Despite https://phpunit.de/manual/4.1/en/code-coverage-analysis.html saying
that addUncoveredFilesFromWhitelist="true" is optional, this seems to be on by
default in PHPUnit 4.1.0. As a result, all files are considered for code
coverage; which is what we want.
processUncoveredFilesFromWhitelist is however false (by default) and as such
even files that are considered for code coverage are not processed through PHP
when not used in actual tests. Since it is already impossible to test multiple
classes with the same name in the same test run (without process isolation),
because that would already lead to "cannot redeclare class" errors, it is also
impossible for "cannot redeclare class" errors to happen in test coverage.
PHPBB3-13341
is_array() will evaluate to true even if the array is just an empty array.
Make sure we also expect an empty array passed to sql_in_set().
PHPBB3-13337
[ticket/13331] Use docs target for this branch, add docs-all for all branches
* bantu/ticket/13331:
[ticket/13331] Use docs target for this branch, add docs-all for dev branches.
Conflicts:
build/build.xml
build/sami-checkout.conf.php
Make phpbb_ui_test_case available unconditionally. Nothing depends on 5.3.19
here. Remove __init__ include. Composer classmap autoloading ensures classes
can be loaded.
PHPBB3-13325
prepare_hidden_fields is expected to return null if the option is not sent
in the request. The boolean method returns false instead, which results in
the options being set as false in hidden fields when accessing the first edit
step.
When checking the "Default value" option, there is also a failure to check
whether the "Field type" option is set to checkbox, thus resulting in this
option getting lost as well.
PHPBB3-12642
[ticket/13324] Update sami/sami and fabpot/goutte for new zipball location
* bantu/ticket/13324:
[ticket/13324] Update sami/sami and fabpot/goutte for new zipball location.
[ticket/13270] Make m_softdelete perm global for boards updated from 3.0.12.
* prototech/ticket/13270:
[ticket/13270] Make m_softdelete perm global for boards updated from 3.0.12.
[ticket/13280] Properly format the current page and add sanitizer to tests
* marc1706/ticket/13280:
[ticket/13280] Remove unneeded str_replace in build_url()
[ticket/13280] Only run sanitizer for server superglobal and modify tests
[ticket/13280] Seperate server sanitizer call and add comment
[ticket/13280] Add additional sanitizer for ampersands in server superglobal
[ticket/13280] Correctly format user page for build_url()
[ticket/13280] Properly format the current page and add sanitizer to tests
At the end of the login method, the captcha was entered correctly and only
the password was incorrect. Therefore, just tell the user that the password
was incorrect. He will see that he still needs to enter a captcha.
PHPBB3-13204
* prep-release-3.1.1:
[ticket/13271] Disable CC sender feature for anonymous users
[prep-release-3.1.1] Add 3.1.1 CHANGELOG
[prep-release-3.1.1] Add 3.1.1 migration file
[ticket/13263] Make sure default style exists and clean up code
[ticket/13263] Only install/set prosilver if no style available
[ticket/13263] Use prosilver as default style if user's style doesn't exist
[ticket/security-164] Correctly format page_name
[ticket/security-164] Sanitize all global variables in symfony_request class
[ticket/13248] Use functional framework login method in tests
[ticket/13248] Correctly pass provider name
[ticket/13248] Always use provider collection for getting provider
[ticket/13248] Allow specifying different auth provider in provider collection
[ticket/13248] Use auth provider collection for getting provider
[ticket/13262] Mention htaccess file when updating from 3.0 to 3.1
[ticket/13267] Update Automatic Update instructions to include vendor directory
[ticket/13268] Properly append ternary result in get_existing_indexes()
[prep-release-3.1.1] Update version number to 3.1.1
Conflicts:
build/build.xml
phpBB/includes/constants.php
phpBB/install/schemas/schema_data.sql
* github-security/ticket/security-164-alt:
[ticket/security-164] Correctly format page_name
[ticket/security-164] Sanitize all global variables in symfony_request class
* github-marc1706/ticket/13263:
[ticket/13263] Make sure default style exists and clean up code
[ticket/13263] Only install/set prosilver if no style available
[ticket/13263] Use prosilver as default style if user's style doesn't exist
[ticket/13241] Fix pagination of viewforum with global announcements
* nickvergessen/ticket/13241:
[ticket/13241] Remove sleep() and change flood interval instead
[ticket/13241] Remove sleep() since the method takes care of this now
[ticket/13241] Sleep for 1 second when posting twice in the same second
[ticket/13241] Fix pagination with global announcements
[ticket/13241] Correctly ignore announcements from topics list
[ticket/13241] Add a functional test for viewforum with global announcement
[feature/phantom]
* dhruvgoel92/feature/phantom:
[ticket/12962] Rename setup-phpbb-test
[ticket/12962] Use phpVersion in phpunit.xml
[ticket/12962] Functional tests run for php <5.3.19
[ticket/12962] Clean up composer.json
[ticket/12962] Fix Line Endings in bootstrap
[ticket/12962] Load composer test dependencies for php >= 5.3.19
[ticket/12962] bootstrap functional and ui test when php >5.3.19
[ticket/12962] Install test dependencies on travis
[ticket/12962] Add facebook/webdriver dependency
[ticket/12962] Fix whitespace characters
[ticket/12962] Run tests for all databases on Travis
[ticket/12962] Force language=en for UI tests installation
[ticket/12962] Dump server output to /dev/null
[ticket/12962] Start phantomjs on travis in background
[ticket/12962] Mark test skipped when phantom server not running
[ticket/12962] Add setup-phantomjs-server.sh
[ticket/12962] Run UI tests on Travis-mysql
[ticket/12962] Add UI tests to phpunit.xml.dist
[ticket/12962] Add quick-links JS test
[ticket/12962] Add initial class for ui_testing
* prep-release-3.1.0:
[ticket/13227] Properly handle curlwrapper headers in remote avatars
[ticket/13231] Update the dependencies of the migration contact_admin_form
The cron scheduler might pick a different task but we don't want to go
through them all to find the one we need. So we just make sure cron is
run at all and then manually run the one we want.
PHPBB3-13232
* prep-release-3.1.0:
[ticket/13230] Add missing globals and missing request object for path helper
[ticket/13226] Add functional test for group ranks
[ticket/13226] Fix the usage of $rank_img
admin_activate_user.php notification type is assigning usernames to email
template variables using user_loader->get_username() in 'no_profile' mode,
which in its turn calls get_username_string() function in 'no_profile' mode.
This causes HTML markup in emails for username colour.
PHPBB3-13223
[ticket/13193] Post count in PMs not a link
* Senky/ticket/13193:
[ticket/13193] Swap ternary condition members
[ticket/13193] Make template more readable
[ticket/13193] Add load_search config check
[ticket/13193] Add link to post count in PMs
* commit '078e0c1e440f7f906b670348e8da00141e245876':
[ticket/13211] Move console migrator output handler back to console folder
[ticket/13211] Also use log wrapper output handler for console migrations
[ticket/13211] Move console migrator output handler to db folder
[ticket/13211] Add log wrapper for writing database updater to log file
[ticket/13126] Add missing use statement
[ticket/13126] Fix tests
[ticket/13126] Change messages verbosity levels
[ticket/13126] Move migrator_output_handler to an interface
[ticket/13126] Extends migrator_output_handler instead of using a closure
[ticket/13126] Improve the feedback when running the migrations
* prep-release-3.1.0:
[ticket/13208] Add security issues to the final changelog
[prep-release-3.1.0] Prepare Changelog
[prep-release-3.1.0] Update version to 3.1.0
1. [Create an account on phpBB.com](http://www.phpbb.com/community/ucp.php?mode=register)
2. [Create a ticket (unless there already is one)](http://tracker.phpbb.com/secure/CreateIssue!default.jspa)
3. Read our [Coding guidelines](https://wiki.phpbb.com/Coding_guidelines) and [Git Contribution Guidelines](http://wiki.phpbb.com/Git); if you're new to git, also read [the introduction guide](http://wiki.phpbb.com/display/DEV/Working+with+Git)
@@ -27,9 +27,9 @@ To be able to run an installation from the repo (and not from a pre-built packag
We have unit and functional tests in order to prevent regressions. You can view the bamboo continuous integration [here](http://bamboo.phpbb.com) or check our travis build below:
* [](http://travis-ci.org/phpbb/phpbb)**master** - Latest development version
* [](http://travis-ci.org/phpbb/phpbb)**3.1.x** - Development of version 3.1.x
* [](http://travis-ci.org/phpbb/phpbb)**3.0.x** - Development of version 3.0.x
$scheme=($inline)?'[a-z][a-z\d+]*':'[a-z][a-z\d+\-.]*';// avoid automatic parsing of "word" in "last word.http://..."
$pchar="(?:[^$remove_chars]*[$unreserved$sub_delims:@|]+|$pct_encoded)";// rfc: no "|"
$reg_name="(?:[^$remove_chars]*[$unreserved$sub_delims:@|]+|$pct_encoded)+";// rfc: * instead of + and no "|" and no "@" and no ":" (included instead of userinfo)
<p>This is a very basic Frequently Asked Questions (FAQ) page which attempts to answer some of the more commonly asked questions. It is by no means exhaustive and should be used in combination with the 'built-in' User FAQ within phpBB, the community forums and our IRC channel (see <ahref="README.html">README</a> for details).</p>
<pclass="paragraph main-description">
This is a very basic Frequently Asked Questions (FAQ) page which attempts to answer some of the
more commonly asked questions. It is by no means exhaustive and should be used in combination with
the 'built-in' User FAQ within phpBB3, the community forums and our IRC channel
(see <ahref="README.html">README</a> for details).
<p>Please read the paragraph about permissions in our extensive <ahref="https://www.phpbb.com/support/documentation/3.0/">online documentation</a>.</p>
<p>Please read the paragraph about permissions in our extensive <ahref="https://www.phpbb.com/support/docs/en/3.1/ug/">online documentation</a>.</p>
</div>
<divclass="back2top"><ahref="#wrap"class="top">Back to Top</a></div>
<p>Please read our <ahref="https://www.phpbb.com/support/documentation/3.0/">extensive user documentation</a> first, it may just explain what you want to know.</p>
<p>Please read our <ahref="https://www.phpbb.com/support/docs/en/3.1/ug/">extensive user documentation</a> first, it may just explain what you want to know.</p>
<p>Feel free to search our community forum for the information you require. <strong>PLEASE DO NOT</strong> post your question without having first used search, chances are someone has already asked and answered your question. You can find our board here:</p>
@@ -309,7 +314,7 @@ I want to sue you because i think you host an illegal board!</h2>
<divclass="back2top"><ahref="#wrap"class="top">Back to Top</a></div>
<p><strong>Please read this document completely before proceeding with installation, updating or converting.</strong></p>
<divclass="paragraph">
<p><strong>Please read this document completely before proceeding with installation, updating or converting.</strong></p>
<p>This document will walk you through the basics on installing, updating and converting the forum software.</p>
<p>A basic overview of running phpBB can be found in the accompanying <ahref="README.html">README</a> file. Please ensure you read that document in addition to this! For more detailed information on using, installing, updating and converting phpBB you should read <ahref="https://www.phpbb.com/support/documentation/3.0/">the documentation</a> available online.</p>
<p>This document will walk you through the basics on installing, updating and converting the forum software.</p>
<p>
A basic overview of running phpBB can be found in the accompanying <ahref="README.html">README</a> file.
Please ensure you read that document in addition to this! For more detailed information on using, installing,
updating and converting phpBB you should read <ahref="https://www.phpbb.com/support/docs/en/3.1/ug/">the documentation</a>
<p>This update method is the recommended method for updating. This package detects changed files automatically and merges in changes if needed.</p>
<p>The automatic update package will update the board from a given version to the latest version. A number of automatic update files are available, and you should choose the one that corresponds to the version of the board that you are currently running. For example, if your current version is <strong>3.0.10</strong>, you need the <code>phpBB-3.0.10_to_3.0.11.zip/tar.bz2</code> file.</p>
<p>The automatic update package will update the board from a given version to the latest version. A number of automatic update files are available, and you should choose the one that corresponds to the version of the board that you are currently running. For example, if your current version is <strong>3.0.13</strong>, you need the <code>phpBB-3.0.13_to_3.0.14.zip/tar.bz2</code> file.</p>
<p>To perform the update, either follow the instructions from the <strong>Administration Control Panel->System</strong> Tab - this should point out that you are running an outdated version and will guide you through the update - or follow the instructions listed below.</p>
<ul>
<li>Go to the <ahref="https://www.phpbb.com/downloads/">downloads page</a> and download the latest update package listed there, matching your current version.</li>
<li>Upload the uncompressed archive contents to your phpBB installation - only the install folder is required. Upload the whole install folder, retaining the file structure.</li>
<li>Upload the uncompressed archive contents to your phpBB installation - only the <code>install/</code> and <code>vendor/</code> folders are required. Upload these folders in their entirety, retaining the file structure.</li>
<li>After the install folder is present, phpBB will go offline automatically.</li>
<li>Point your browser to the install directory, for example <code>http://www.example.com/phpBB3/install/</code></li>
<li>Choose the "Update" Tab and follow the instructions</li>
@@ -321,7 +327,7 @@
<divclass="back2top"><ahref="#wrap"class="top">Back to Top</a></div>
<p>Like any online site that allows user input, your board could be subject to unwanted posts; often referred to as <ahref="http://en.wikipedia.org/wiki/Forum_spam">forum spam</a>. The vast majority of these attacks will be from automated computer programs known as <ahref="http://en.wikipedia.org/wiki/Spambot">spambots</a>. The attacks, generally, are not personal as the spammers are just trying to find accessible targets. phpBB has a number of anti-spam measures built in, including a range of CAPTCHAs. However, administrators are strongly urged to read and follow the advice for <ahref="https://www.phpbb.com/support/spam/">Preventing Spam in phpBB</a> as soon as possible after completing the installation of your board.</p>
@@ -472,7 +478,7 @@
<divclass="back2top"><ahref="#wrap"class="top">Back to Top</a></div>
<p>Thank you for downloading phpBB. This README will guide you through the basics of installation and operation of phpBB. Please ensure you read this and the accompanying documentation fully <strong>before</strong> proceeding with the installation.</p>
<pclass="paragraph main-description">
Thank you for downloading phpBB. This README will guide you through the basics of installation
and operation of phpBB. Please ensure you read this and the accompanying documentation fully
<strong>before</strong> proceeding with the installation.
<p>Installation, update and conversion instructions can be found in the <ahref="INSTALL.html">INSTALL</a> document in this directory. If you are intending on converting from a phpBB 2.0.x or 3.0.x installation we highly recommend that you backup any existing data before proceeding!</p>
@@ -110,7 +114,7 @@
<divclass="back2top"><ahref="#wrap"class="top">Back to Top</a></div>
<p>Installation of these packages is straightforward: simply download the required language pack, uncompress (unzip) it and via FTP transfer the included <code>language</code> and <code>styles</code> folders to the root of your board installation. The language can then be installed via the Administration Control Panel of your board: <code>Customise tab -> Language management -> Language packs</code>. A more detailed description of the process is in the Knowledge Base article, <ahref="https://www.phpbb.com/kb/article/how-to-install-a-language-pack/">How to Install a Language Pack</a>.</p>
<p>If your language is not available, please visit our <ahref="https://www.phpbb.com/community/viewforum.php?f=66">[3.0.x] Translations</a> forum where you will find topics on translations in progress. Should you wish to volunteer to translate a language not currently available or assist in maintaining an existing language pack, you can <ahref="https://www.phpbb.com/languages/apply.php">Apply to become a translator</a>.</p>
<p>If your language is not available, please visit our <ahref="https://www.phpbb.com/community/viewforum.php?f=491">[3.1.x] Translations</a> forum where you will find topics on translations in progress. Should you wish to volunteer to translate a language not currently available or assist in maintaining an existing language pack, you can <ahref="https://www.phpbb.com/languages/apply.php">Apply to become a translator</a>.</p>
<p>We are proud to have a thriving extensions community. These third party extensions to the standard phpBB software, extend its capabilities still further. You can browse through many of the extensions in the <ahref="https://www.phpbb.com/customise/db/extensions-27/">Extensions</a> section of our <ahref="https://www.phpbb.com/customise/db/">Customisation Database</a>.</p>
<p>We are proud to have a thriving extensions community. These third party extensions to the standard phpBB software, extend its capabilities still further. You can browse through many of the extensions in the <ahref="https://www.phpbb.com/customise/db/extensions-36">Extensions</a> section of our <ahref="https://www.phpbb.com/customise/db/">Customisation Database</a>.</p>
<p>For more information about extensions, please see: <ahref="https://www.phpbb.com/extensions">https://www.phpbb.com/extensions</a></p>
@@ -162,7 +166,7 @@
<divclass="back2top"><ahref="#wrap"class="top">Back to Top</a></div>
<p>To use any methods contained with the <code>auth</code> class it first needs to be instantiated. This is best achieved early in the execution of the script in the following manner:</p>
<divclass="codebox"><pre>
$auth = new phpbb\auth\auth();
</pre></div>
$auth = new phpbb\auth\auth();</pre>
</div>
<p>Once an instance of the class has been created you are free to call the various methods it contains. Please note that should you wish to use the <code>auth_admin</code> methods you will need to instantiate this separately but in the same way.</p>
@@ -95,7 +95,7 @@ $auth = new phpbb\auth\auth();
<divclass="back2top"><ahref="#wrap"class="top">Back to Top</a></div>
@@ -114,8 +114,8 @@ $auth = new phpbb\auth\auth();
<p>The <code>acl</code> method is the initialisation routine for all the acl functions. If you intend calling any acl method you must first call this. The method takes as its one and only required parameter an associative array containing user information as stored in the database. This array must contain at least the following information; user_id, user_permissions and user_type. It is called in the following way:</p>
<divclass="codebox"><pre>
$auth->acl(<code>userdata</code>);
</pre></div>
$auth->acl(<code>userdata</code>);</pre>
</div>
<p>Where userdata is the array containing the aforementioned data.</p>
<p>This method is the primary way of determining what a user can and cannot do for a given option globally or in a given forum. The method should be called in the following way:</p>
<p>Where option is a string representing the required option, e.g. 'f_list', 'm_edit', 'a_adduser', etc. By adding a ! in front of the option, e.g. '!f_list' the result of this method will be negated. The optional forum term is the integer forum_id.</p>
<p>As with the <code>acl_get</code> method the options are strings representing the required permissions to check. The forum again is an integer representing a given forum_id.</p>
<p>This method is used to find out in which forums a user is allowed to carry out an operation or to find out in which forums he is not allowed to carry out an operation. The method should be called in the following way:</p>
<p>Just like in the <code>acl_get</code> method the option is a string specifying the permission which has to be checked (negation using ! is allowed). The second parameter is a boolean. If it is set to false this method returns all forums with either zero or a positive integer. If it is set to true only those forums with a positive integer as the result will be returned.</p>
<p>The method returns an associative array of the form:</p>
<p>Where option is the option passed to the method and integer is either zero or a positive integer and the same <code>acl_get(option, forum_id)</code> would return.</p>
<p>This method is used to find out whether a user has a permission in at least one forum or globally. This method is similar to checking whether <code>acl_getf(option, true)</code> returned one or more forums but it's faster. It should be called in the following way:</p>
<p>To use any methods this class contains it first needs to be instantiated separately from <code>auth</code>. This is achieved in the same way as <code>auth</code>:</p>
<divclass="codebox"><pre>
$auth_admin = new auth_admin();
</pre></div>
$auth_admin = new auth_admin();</pre>
</div>
<p>This instance gives you access to both the methods of this specific class and that of <code>auth</code>.</p>
@@ -256,7 +256,7 @@ $auth_admin = new auth_admin();
<divclass="back2top"><ahref="#wrap"class="top">Back to Top</a></div>
<p>Functions should also be named descriptively. We're not programming in C here, we don't want to write functions called things like "stristr()". Again, all lower-case names with words separated by a single underscore character in PHP, and camel caps in JavaScript. Function names should be prefixed with "phpbb_" and preferably have a verb in them somewhere. Good function names are <code>phpbb_print_login_status()</code>, <code>phpbb_get_user_data()</code>, etc. Constructor functions in JavaScript should begin with a capital letter.</p>
<p>In PHP code, braces always go on their own line. The closing brace should also always be at the same column as the corresponding opening brace, examples:</p>
@@ -427,8 +429,8 @@ while (condition)
function do_stuff()
{
...
}
</pre></div>
}</pre>
</div>
<p>In JavaScript code, braces always go on the same line:</p>
@@ -451,8 +453,8 @@ while (condition) {
function do_stuff() {
...
}
</pre></div>
}</pre>
</div>
<h4>Use spaces between tokens:</h4>
<p>This is another simple, easy step that helps keep code readable without much effort. Whenever you write an assignment, expression, etc.. Always leave <em>one</em> space between the tokens. Basically, write code as if it was English. Put spaces between variable names and operators. Don't put spaces just after an opening bracket or before a closing bracket. Don't put spaces just before a comma or a semicolon. This is best shown with a few examples, examples:</p>
<p>Do you know the exact precedence of all the operators in PHP? Neither do I. Don't guess. Always make it obvious by using brackets to force the precedence of an equation so you know what it does. Remember to not over-use this, as it may harden the readability. Basically, do not enclose single expressions. Examples:</p>
<pclass="bad">// what's the result? who knows. </p>
<p>There are two different ways to quote strings in PHP - either with single quotes or with double quotes. The main difference is that the parser does variable interpolation in double-quoted strings, but not in single quoted strings. Because of this, you should <em>always</em> use single quotes <em>unless</em> you specifically need variable interpolation to be done on that string. This way, we can save the parser the trouble of parsing a bunch of strings where no interpolation needs to be done.</p>
<p>In SQL statements mixing single and double quotes is partly allowed (following the guidelines listed here about SQL formatting), else one should try to only use one method - mostly single quotes.</p>
<p>In PHP, it's legal to use a literal string as a key to an associative array without quoting that string. We don't want to do this -- the string should always be quoted to avoid confusion. Note that this is only when we're using a literal, not when we're using a variable, examples:</p>
<pclass="bad">// wrong</p>
<divclass="codebox"><pre>
$foo = $assoc_array[blah];
</pre></div>
<divclass="codebox">
<pre>$foo = $assoc_array[blah];</pre>
</div>
<pclass="good">// right </p>
<divclass="codebox"><pre>
$foo = $assoc_array['blah'];
</pre></div>
<divclass="codebox">
<pre>$foo = $assoc_array['blah'];</pre>
</div>
<pclass="bad">// wrong</p>
<divclass="codebox"><pre>
$foo = $assoc_array["$var"];
</pre></div>
<divclass="codebox">
<pre>$foo = $assoc_array["$var"];</pre>
</div>
<pclass="good">// right </p>
<divclass="codebox"><pre>
$foo = $assoc_array[$var];
</pre></div>
<divclass="codebox">
<pre>$foo = $assoc_array[$var];</pre>
</div>
<h4>Comments:</h4>
<p>Each complex function should be preceded by a comment that tells a programmer everything they need to know to use that function. The meaning of every parameter, the expected input, and the output are required as a minimal comment. The function's behaviour in error conditions (and what those error conditions are) should also be present - but mostly included within the comment about the output.<br/><br/>Especially important to document are any assumptions the code makes, or preconditions for its proper operation. Any one of the developers should be able to look at any part of the application and figure out what's going on in a reasonable amount of time.<br/><br/>Avoid using <code>/* */</code> comment blocks for one-line comments, <code>//</code> should be used for one/two-liners.</p>
@@ -582,8 +584,8 @@ $foo = $assoc_array[$var];
<pclass="bad">// wrong </p>
<divclass="codebox"><pre>
$array[++$i] = $j;
$array[$i++] = $k;
</pre></div>
$array[$i++] = $k;</pre>
</div>
<pclass="good">// right </p>
<divclass="codebox"><pre>
@@ -591,39 +593,38 @@ $i++;
$array[$i] = $j;
$array[$i] = $k;
$i++;
</pre></div>
$i++;</pre>
</div>
<h4>Inline conditionals:</h4>
<p>Inline conditionals should only be used to do very simple things. Preferably, they will only be used to do assignments, and not for function calls or anything complex at all. They can be harmful to readability if used incorrectly, so don't fall in love with saving typing by using them, examples:</p>
<p>For phpBB3, we intend to use a higher level of run-time error reporting. This will mean that the use of an uninitialized variable will be reported as a warning. These warnings can be avoided by using the built-in isset() function to check whether a variable has been set - but preferably the variable is always existing. For checking if an array has a key set this can come in handy though, examples:</p>
<p>The <code>empty()</code> function is useful if you want to check if a variable is not set or being empty (an empty string, 0 as an integer or string, NULL, false, an empty array or a variable declared, but without a value in a class). Therefore empty should be used in favor of <code>isset($array) && sizeof($array) > 0</code> - this can be written in a shorter way as <code>!empty($array)</code>.</p>
@@ -640,8 +641,8 @@ switch ($mode)
case 'mode2':
// I am doing something completely different here
break;
}
</pre></div>
}</pre>
</div>
<pclass="good">// Good </p>
<divclass="codebox"><pre>
@@ -658,8 +659,8 @@ switch ($mode)
default:
// Always assume that a case was not caught
break;
}
</pre></div>
}</pre>
</div>
<pclass="good">// Also good, if you have more code between the case and the break </p>
<divclass="codebox"><pre>
@@ -682,8 +683,8 @@ switch ($mode)
// Always assume that a case was not caught
break;
}
</pre></div>
}</pre>
</div>
<p>Even if the break for the default case is not needed, it is sometimes better to include it just for readability and completeness.</p>
@@ -710,8 +711,8 @@ switch ($mode)
// Always assume that a case was not caught
break;
}
</pre></div>
}</pre>
</div>
<h4>Class Members</h4>
<p>Use the explicit visibility qualifiers <code>public</code>, <code>private</code> and <code>protected</code> for all properties instead of <code>var</code>.
@@ -721,14 +722,14 @@ switch ($mode)
<pclass="bad">//Wrong </p>
<divclass="codebox"><pre>
var $x;
private static function f()
</pre></div>
private static function f()</pre>
</div>
<pclass="good">// Right </p>
<divclass="codebox"><pre>
public $x;
static private function f()
</pre></div>
static private function f()</pre>
</div>
<h4>Constants</h4>
<p>Prefer class constants over global constants created with <code>define()</code>.</p>
@@ -748,8 +749,8 @@ $sql = 'SELECT *
<-one tab->WHERE a = 1
<-two tabs->AND (b = 2
<-three tabs->OR b = 3)
<-one tab->ORDER BY b';
</pre></div>
<-one tab->ORDER BY b';</pre>
</div>
<p>Here the example with the tabs applied:</p>
@@ -759,8 +760,8 @@ $sql = 'SELECT *
WHERE a = 1
AND (b = 2
OR b = 3)
ORDER BY b';
</pre></div>
ORDER BY b';</pre>
</div>
<h4>SQL Quotes: </h4>
<p>Use double quotes where applicable. (The variables in these examples are typecasted to integers beforehand.) Examples: </p>
@@ -769,16 +770,16 @@ $sql = 'SELECT *
<divclass="codebox"><pre>
"UPDATE " . SOME_TABLE . " SET something = something_else WHERE a = $b";
'UPDATE ' . SOME_TABLE . ' SET something = ' . $user_id . ' WHERE a = ' . $something;
</pre></div>
'UPDATE ' . SOME_TABLE . ' SET something = ' . $user_id . ' WHERE a = ' . $something;</pre>
</div>
<pclass="good">// These are right. </p>
<divclass="codebox"><pre>
'UPDATE ' . SOME_TABLE . " SET something = something_else WHERE a = $b";
'UPDATE ' . SOME_TABLE . " SET something = $user_id WHERE a = $something";
</pre></div>
'UPDATE ' . SOME_TABLE . " SET something = $user_id WHERE a = $something";</pre>
</div>
<p>In other words use single quotes where no variable substitution is required or where the variable involved shouldn't appear within double quotes. Otherwise use double quotes.</p>
@@ -789,15 +790,15 @@ $sql = 'SELECT *
<divclass="codebox"><pre>
$sql = 'SELECT *
FROM ' . SOME_TABLE . '
WHERE a != 2';
</pre></div>
WHERE a != 2';</pre>
</div>
<pclass="good">// This is right. </p>
<divclass="codebox"><pre>
$sql = 'SELECT *
FROM ' . SOME_TABLE . '
WHERE a <> 2';
</pre></div>
WHERE a <> 2';</pre>
</div>
<h4>Common DBAL methods: </h4>
@@ -808,8 +809,8 @@ $sql = 'SELECT *
<divclass="codebox"><pre>
$sql = 'SELECT *
FROM ' . SOME_TABLE . "
WHERE username = '" . $db->sql_escape($username) . "'";
</pre></div>
WHERE username = '" . $db->sql_escape($username) . "'";</pre>
<p>To complete the example, this is how an update statement would look like:</p>
@@ -845,8 +846,8 @@ $sql_ary = array(
$sql = 'UPDATE ' . SOME_TABLE . '
SET ' . $db->sql_build_array('UPDATE', $sql_ary) . '
WHERE user_id = ' . (int) $user_id;
$db->sql_query($sql);
</pre></div>
$db->sql_query($sql);</pre>
</div>
<p>The <code>$db->sql_build_array()</code> function supports the following modes: <code>INSERT</code> (example above), <code>INSERT_SELECT</code> (building query for <code>INSERT INTO table (...) SELECT value, column ...</code> statements), <code>UPDATE</code> (example above) and <code>SELECT</code> (for building WHERE statement [AND logic]).</p>
<p>The possible first parameter for sql_build_query() is SELECT or SELECT_DISTINCT. As you can see, the logic is pretty self-explaining. For the LEFT_JOIN key, just add another array if you want to join on to tables for example. The added benefit of using this construct is that you are able to easily build the query statement based on conditions - for example the above LEFT_JOIN is only necessary if server side topic tracking is enabled; a slight adjustement would be:</p>
<p>Try to avoid using in_array() on huge arrays, and try to not place them into loops if the array to check consist of more than 20 entries. in_array() can be very time consuming and uses a lot of cpu processing time. For little checks it is not noticeable, but if checked against a huge array within a loop those checks alone can take several seconds. If you need this functionality, try using isset() on the arrays keys instead, actually shifting the values into keys and vice versa. A call to <code>isset($array[$var])</code> is a lot faster than <code>in_array($var, array_keys($array))</code> for example.</p>
<p>The string passed to <code>add_form_key()</code> needs to match the string passed to <code>check_form_key()</code>. Another requirement for this to work correctly is that all forms include the <code>{S_FORM_TOKEN}</code> template variable.</p>
<p>The <code>$user->setup()</code> call can be used to pass on additional language definition and a custom style (used in viewforum).</p>
@@ -1094,16 +1095,16 @@ $user->setup();
<p>All messages/errors should be outputted by calling <code>trigger_error()</code> using the appropriate message type and language string. Example:</p>
<p>The <code>append_sid()</code> function from 2.0.x is available too, though it does not handle url alterations automatically. Please have a look at the code documentation if you want to get more details on how to use append_sid(). A sample call to append_sid() can look like this:</p>
# Set value to empty or to this style's name if this style does not have a parent style
parent = prosilver
</pre></div>
parent = prosilver</pre>
</div>
<aname="genstyling"></a><h3>3.2. General Styling Rules</h3>
<p>Templates should be produced in a consistent manner. Where appropriate they should be based off an existing copy, e.g. index, viewforum or viewtopic (the combination of which implement a range of conditional and variable forms). Please also note that the indentation and coding guidelines also apply to templates where possible.</p>
@@ -1252,14 +1253,14 @@ parent = prosilver
<divclass="back2top"><ahref="#wrap"class="top">Back to Top</a></div>
@@ -2443,8 +2444,8 @@ if (utf8_case_fold_nfc($string1) == utf8_case_fold_nfc($string2))
...
'CONV_ERROR_NO_AVATAR_PATH'
=> 'Note to developer: you must specify $convertor['avatar_path'] to use %s.',
...
</pre></div>
...</pre>
</div>
<pclass="good">// Good - Literal straight quotes should be escaped with a backslash, ie: \</p>
@@ -2452,8 +2453,8 @@ if (utf8_case_fold_nfc($string1) == utf8_case_fold_nfc($string2))
...
'CONV_ERROR_NO_AVATAR_PATH'
=> 'Note to developer: you must specify $convertor[\'avatar_path\'] to use %s.',
...
</pre></div>
...</pre>
</div>
<p>However, because phpBB3 now uses UTF-8 as its sole encoding, we can actually use this to our advantage and not have to remember to escape a straight quote when we don't have to:</p>
@@ -2462,24 +2463,24 @@ if (utf8_case_fold_nfc($string1) == utf8_case_fold_nfc($string2))
<divclass="codebox"><pre>
...
'USE_PERMISSIONS' => 'Test out user's permissions',
...
</pre></div>
...</pre>
</div>
<pclass="good">// Okay - However, non-programmers wouldn't type "user\'s" automatically</p>
<divclass="codebox"><pre>
...
'USE_PERMISSIONS' => 'Test out user\'s permissions',
...
</pre></div>
...</pre>
</div>
<pclass="good">// Best - Use the Unicode Right-Single-Quotation-Mark character</p>
<divclass="codebox"><pre>
...
'USE_PERMISSIONS' => 'Test out user’s permissions',
...
</pre></div>
...</pre>
</div>
<p>The <code>"</code> (straight double quote), <code><</code> (less-than sign) and <code>></code> (greater-than sign) characters can all be used as displayed glyphs or as part of HTML markup, for example:</p>
@@ -2489,8 +2490,8 @@ if (utf8_case_fold_nfc($string1) == utf8_case_fold_nfc($string2))
...
'FOO_BAR' => 'PHP version < 5.3.3.<br />
Visit "Downloads" at <a href="http://www.php.net/">www.php.net</a>.',
...
</pre></div>
...</pre>
</div>
<pclass="good">// Okay - No more invalid HTML, but "&quot;" is rather clumsy</p>
@@ -2498,8 +2499,8 @@ if (utf8_case_fold_nfc($string1) == utf8_case_fold_nfc($string2))
...
'FOO_BAR' => 'PHP version &lt; 5.3.3.<br />
Visit &quot;Downloads&quot; at <a href="http://www.php.net/">www.php.net</a>.',
...
</pre></div>
...</pre>
</div>
<pclass="good">// Best - No more invalid HTML, and usage of correct typographical quotation marks</p>
@@ -2507,8 +2508,8 @@ if (utf8_case_fold_nfc($string1) == utf8_case_fold_nfc($string2))
...
'FOO_BAR' => 'PHP version &lt; 5.3.3.<br />
Visit “Downloads” at <a href="http://www.php.net/">www.php.net</a>.',
...
</pre></div>
...</pre>
</div>
<p>Lastly, the <code>&</code> (ampersand) must always be entitised regardless of where it is used:</p>
@@ -2517,16 +2518,16 @@ if (utf8_case_fold_nfc($string1) == utf8_case_fold_nfc($string2))
<divclass="codebox"><pre>
...
'FOO_BAR' => '<a href="http://somedomain.tld/?foo=1&bar=2">Foo & Bar</a>.',
...
</pre></div>
...</pre>
</div>
<pclass="good">// Good - Valid HTML, amperands are correctly entitised in all cases</p>
<p>As for how these charcters are entered depends very much on choice of Operating System, current language locale/keyboard configuration and native abilities of the text editor used to edit phpBB language files. Please see <ahref="http://en.wikipedia.org/wiki/Unicode#Input_methods">http://en.wikipedia.org/wiki/Unicode#Input_methods</a> for more information.</p>
@@ -2538,7 +2539,7 @@ if (utf8_case_fold_nfc($string1) == utf8_case_fold_nfc($string2))
<divclass="back2top"><ahref="#wrap"class="top">Back to Top</a></div>
Some files were not shown because too many files have changed in this diff
Show More
Reference in New Issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.