Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions 6 phpBB/.htaccess
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,13 @@ RewriteEngine on

#
# The following 3 lines will rewrite URLs passed through the front controller
# to not require app.php in the actual URL. In other words, a controller is
# by default accessed at /app.php/my/controller, but can also be accessed at
# to not require index.php in the actual URL. In other words, a controller is
# by default accessed at /index.php/my/controller, but can also be accessed at
# /my/controller
#
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ app.php [QSA,L]
RewriteRule ^(.*)$ index.php [QSA,L]

#
# If symbolic links are not already being followed,
Expand Down
17 changes: 17 additions & 0 deletions 17 phpBB/app.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,28 @@
/**
* @ignore
*/

use Symfony\Component\HttpFoundation\RedirectResponse;

define('IN_PHPBB', true);
$phpbb_root_path = (defined('PHPBB_ROOT_PATH')) ? PHPBB_ROOT_PATH : './';
$phpEx = substr(strrchr(__FILE__, '.'), 1);
include($phpbb_root_path . 'common.' . $phpEx);

if (basename($symfony_request->getScriptName()) === 'app.php')
{
$base_path = $symfony_request->getBasePath();
$path_info = $symfony_request->getPathInfo();
$query_string = $symfony_request->getQueryString();

$url = $base_path . '/index.php' . $path_info . ($query_string ? '?' . $query_string : '');

$response = new RedirectResponse($url, 301);
$response->send();
rubencm marked this conversation as resolved.
Show resolved Hide resolved

exit;
}

// Start session management
$user->session_begin();
$auth->acl($user->data);
Expand Down
2 changes: 1 addition & 1 deletion 2 phpBB/assets/javascript/installer.js
Original file line number Diff line number Diff line change
Expand Up @@ -375,7 +375,7 @@
*/
function queryInstallerStatus() {
var url = $(location).attr('pathname');
var lookUp = 'install/app.php';
var lookUp = 'install/index.php';
var position = url.indexOf(lookUp);

if (position === -1) {
Expand Down
2 changes: 1 addition & 1 deletion 2 phpBB/config/default/routing/routing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
# path: /foo
# defaults: { _controller: foo_sevice:method }
#
# The above will be accessed via app.php?controller=foo and it will
# The above will be accessed via index.php?controller=foo and it will
# instantiate the 'foo_service' service and call the 'method' method.
#

Expand Down
14 changes: 7 additions & 7 deletions 14 phpBB/docs/INSTALL.html
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ <h1>Install</h1>
<li>Change the permissions on config.php to be writable by all (666 or -rw-rw-rw- within your FTP Client)</li>
<li>Change the permissions on the following directories to be writable by all (777 or -rwxrwxrwx within your FTP Client):<br />
<code>store/</code>, <code>cache/</code>, <code>files/</code> and <code>images/avatars/upload/</code>.</li>
<li>Point your web browser to the location where you uploaded the phpBB files with the addition of <code>install/app.php</code> or simply <code>install/</code>, e.g. <code>http://www.example.com/phpBB/install/app.php</code>, <code>http://www.example.com/forum/install/</code>.</li>
<li>Point your web browser to the location where you uploaded the phpBB files with the addition of <code>install/index.php</code> or simply <code>install/</code>, e.g. <code>http://www.example.com/phpBB/install/index.php</code>, <code>http://www.example.com/forum/install/</code>.</li>
<li>Click the <strong><em>INSTALL</em></strong> tab, follow the steps and fill out all the requested information.</li>
<li>Change the permissions on config.php to be writable only by yourself (644 or -rw-r--r-- within your FTP Client)</li>
<li>phpBB should now be available, please <strong>MAKE SURE</strong> you read at least <a href="#postinstall">Section 6</a> below for important, security related post-installation instructions, and also take note of <a href="#anti_spam">Section 7</a> regarding anti-spam measures.</li>
Expand Down Expand Up @@ -190,7 +190,7 @@ <h1>Install</h1>

<p>phpBB comes supplied with British English as its standard language. However, a number of separate packs for different languages are available. If you are not a native English speaker you may wish to install one or more of these packages before continuing. The installation process below will allow you to select a default language from those available (you can, of course, change this default at a later stage). For more details on language packs, where to obtain them and how to install them please see the <a href="README.html#i18n">README</a>.</p>

<p>Once all the files have been uploaded to your site, you should point your browser at this location with the addition of <code>/install/</code>. For example, if your domain name is <code>www.example.com</code> and you placed the phpBB files in the directory <code>/phpBB</code> off your web root you would enter <code>http://www.example.com/phpBB/install/</code> or (alternatively) <code>http://www.example.com/phpBB/install/app.php</code> into your browser. When you have done this, you should see the <strong><em>phpBB Introduction</em></strong> screen appear.</p>
<p>Once all the files have been uploaded to your site, you should point your browser at this location with the addition of <code>/install/</code>. For example, if your domain name is <code>www.example.com</code> and you placed the phpBB files in the directory <code>/phpBB</code> off your web root you would enter <code>http://www.example.com/phpBB/install/</code> or (alternatively) <code>http://www.example.com/phpBB/install/index.php</code> into your browser. When you have done this, you should see the <strong><em>phpBB Introduction</em></strong> screen appear.</p>

<h4>Introduction:</h4>

Expand Down Expand Up @@ -272,9 +272,9 @@ <h4>Advanced settings</h4>

<p>First, you should make a copy of your existing <code>config.php</code> file; keep it in a safe place! Next, delete all the existing phpBB files, you should leave your <code>files/</code>, <code>images/</code> and <code>ext/</code> directories in place, otherwise you will lose your file attachments, uploaded images and get errors due to missing extension files. You can leave alternative styles in place too. With this complete, you can upload the new phpBB files (see <a href="#install">New installation</a> for details if necessary). Once complete, copy back your saved <code>config.php</code>, replacing the new one. Another method is to just <strong>replace</strong> the existing files with the files from the full package - though make sure you do <strong>not</strong> overwrite your config.php file.</p>

<p>You should now got to <code>/install/app.php/update</code> which will display a warning: <strong>No valid update directory was found, please make sure you uploaded the relevant files</strong>. Beneath that warning you will see a radio button <em>Update database only</em>, just click <strong>Submit</strong>. Depending on your previous version this will make a number of database changes. You may receive <em>FAILURES</em> during this procedure. They should not be a cause for concern unless you see an actual <em>ERROR</em>, in which case the script will stop (in this case you should seek help via our forums or bug tracker). If you have shell access to your server, you may wish to update via the command line interface. From your board's root, execute the following command: <code>php bin/phpbbcli.php --safe-mode db:migrate</code>.</p>
<p>You should now got to <code>/install/index.php/update</code> which will display a warning: <strong>No valid update directory was found, please make sure you uploaded the relevant files</strong>. Beneath that warning you will see a radio button <em>Update database only</em>, just click <strong>Submit</strong>. Depending on your previous version this will make a number of database changes. You may receive <em>FAILURES</em> during this procedure. They should not be a cause for concern unless you see an actual <em>ERROR</em>, in which case the script will stop (in this case you should seek help via our forums or bug tracker). If you have shell access to your server, you may wish to update via the command line interface. From your board's root, execute the following command: <code>php bin/phpbbcli.php --safe-mode db:migrate</code>.</p>

<p>Once <code>/install/app.php/update</code> has completed, it displays the success message: <strong>The database update was successful</strong>. You may proceed to the Administration Control Panel and then remove the install directory as advised.</p>
<p>Once <code>/install/index.php/update</code> has completed, it displays the success message: <strong>The database update was successful</strong>. You may proceed to the Administration Control Panel and then remove the install directory as advised.</p>

<a name="update_files"></a><h3>4.ii. Changed files</h3>

Expand All @@ -284,7 +284,7 @@ <h4>Advanced settings</h4>

<p>The directory structure has been preserved, enabling you (if you wish) to simply upload the uncompressed contents of the archive to the appropriate location on your server, i.e. simply overwrite the existing files with the new versions. Do not forget that if you have installed any modifications (MODs) these files will overwrite the originals, possibly destroying them in the process. You will need to re-add MODs to any affected file before uploading.</p>

<p>As for the other update procedures, you should go to <code>/install/app.php/update</code>, select "Update database only" and submit the page after you have finished updating the files. This will update your database schema and increment the version number. If you have shell access to your server, you may wish to update via the command line interface. From your board's root, execute the following command: <code>php bin/phpbbcli.php --safe-mode db:migrate</code>.</p>
<p>As for the other update procedures, you should go to <code>/install/index.php/update</code>, select "Update database only" and submit the page after you have finished updating the files. This will update your database schema and increment the version number. If you have shell access to your server, you may wish to update via the command line interface. From your board's root, execute the following command: <code>php bin/phpbbcli.php --safe-mode db:migrate</code>.</p>

<a name="update_patch"></a><h3>4.iii. Patch file</h3>

Expand All @@ -296,7 +296,7 @@ <h4>Advanced settings</h4>

<p>If you do get failures, you should look at using the <a href="#update_files">Changed Files</a> package to replace the files which failed to patch. Please note that you will need to manually re-add any MODs to these particular files. Alternatively, if you know how, you can examine the .rej files to determine what failed where and make manual adjustments to the relevant source.</p>

<p>You should, of course, delete the patch file (or files) after use. As for the other update procedures, you should navigate to <code>/install/app.php/update</code>, select "Update database only" and submit the page after you have finished updating the files. This will update your database schema and data (if appropriate) and increment the version number. If you have shell access to your server, you may wish to update via the command line interface. From your board's root, execute the following command: <code>php bin/phpbbcli.php --safe-mode db:migrate</code>.</p>
<p>You should, of course, delete the patch file (or files) after use. As for the other update procedures, you should navigate to <code>/install/index.php/update</code>, select "Update database only" and submit the page after you have finished updating the files. This will update your database schema and data (if appropriate) and increment the version number. If you have shell access to your server, you may wish to update via the command line interface. From your board's root, execute the following command: <code>php bin/phpbbcli.php --safe-mode db:migrate</code>.</p>

<a name="update_advanced"></a><h3>4.iv. Advanced update package (Expert users)</h3>

Expand Down Expand Up @@ -356,7 +356,7 @@ <h4>Advanced settings</h4>
</ul></li>

<li>Upload the contents of the 3.3.x Full Package (<strong>except</strong> for config.php) into your forum's directory. Make sure the root level .htaccess file is included in the upload.</li>
<li>Browse to <code>/install/app.php/update</code></li>
<li>Browse to <code>/install/index.php/update</code></li>
<li>Read the notice <em>Update database only</em> and press <strong>Submit</strong></li>
<li>Delete the <code>install/</code> directory</li>
</ol>
Expand Down
8 changes: 4 additions & 4 deletions 8 phpBB/docs/lighttpd.sample.conf
Original file line number Diff line number Diff line change
Expand Up @@ -48,12 +48,12 @@ $HTTP["host"] == "www.myforums.com" {
}

# The following 3 lines will rewrite URLs passed through the front controller
# to not require app.php in the actual URL. In other words, a controller is
# by default accessed at /app.php/my/controller, but can also be accessed at
# to not require index.php in the actual URL. In other words, a controller is
# by default accessed at /index.php/my/controller, but can also be accessed at
# /my/controller
url.rewrite-if-not-file = (
"^/install/(.*)$" => "/install/app.php/$1",
"^/(.*)$" => "/app.php/$1"
"^/install/(.*)$" => "/install/index.php/$1",
"^/(.*)$" => "/index.php/$1"
)

fastcgi.server = ( ".php" =>
Expand Down
8 changes: 4 additions & 4 deletions 8 phpBB/docs/nginx.sample.conf
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ server {
fastcgi_param PATH_INFO $fastcgi_path_info;
fastcgi_param SCRIPT_FILENAME $realpath_root$fastcgi_script_name;
fastcgi_param DOCUMENT_ROOT $realpath_root;
try_files $uri $uri/ /app.php$is_args$args;
try_files $uri $uri/ /index.php$is_args$args;
fastcgi_pass php;
}

Expand All @@ -64,7 +64,7 @@ server {
}

location @rewriteapp {
rewrite ^(.*)$ /app.php/$1 last;
rewrite ^(.*)$ /index.php/$1 last;
}

# Correctly pass scripts for installer
Expand All @@ -78,13 +78,13 @@ server {
fastcgi_param PATH_INFO $fastcgi_path_info;
fastcgi_param SCRIPT_FILENAME $realpath_root$fastcgi_script_name;
fastcgi_param DOCUMENT_ROOT $realpath_root;
try_files $uri $uri/ /install/app.php$is_args$args =404;
try_files $uri $uri/ /install/index.php$is_args$args =404;
fastcgi_pass php;
}
}

location @rewrite_installapp {
rewrite ^(.*)$ /install/app.php/$1 last;
rewrite ^(.*)$ /install/index.php/$1 last;
}

# Deny access to version control system directories.
Expand Down
6 changes: 3 additions & 3 deletions 6 phpBB/includes/acp/acp_board.php
Original file line number Diff line number Diff line change
Expand Up @@ -1385,11 +1385,11 @@ function store_feed_forums($option, $key)
}

/**
* Option to enable/disable removal of 'app.php' from URLs
* Option to enable/disable removal of 'index.php' from URLs
*
* Note that if mod_rewrite is on, URLs without app.php will still work,
* Note that if mod_rewrite is on, URLs without index.php will still work,
* but any paths generated by the controller helper url() method will not
* contain app.php.
* contain index.php.
*
* @param int $value The current config value
* @param string $key The config key
Expand Down
4 changes: 2 additions & 2 deletions 4 phpBB/includes/acp/acp_update.php
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ function main($id, $mode)
$template->assign_block_vars('updates_available', $updates_available);
}

$update_link = $phpbb_root_path . 'install/app.' . $phpEx;
$update_link = $phpbb_root_path . 'install/index.' . $phpEx;

$template_ary = [
'S_UP_TO_DATE' => empty($updates_available),
Expand All @@ -96,7 +96,7 @@ function main($id, $mode)
// Incomplete update?
if (phpbb_version_compare($config['version'], PHPBB_VERSION, '<'))
{
$database_update_link = $phpbb_root_path . 'install/app.php/update';
$database_update_link = $phpbb_root_path . 'install/index.php/update';

$template->assign_vars(array(
'S_UPDATE_INCOMPLETE' => true,
Expand Down
2 changes: 1 addition & 1 deletion 2 phpBB/includes/functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -1825,7 +1825,7 @@ function phpbb_get_install_redirect(string $phpbb_root_path, string $phpEx): str
$script_name = substr($script_name, -1) === '/' ? $script_name . '.' : $script_name;

// $phpbb_root_path accounts for redirects from e.g. /adm
$script_path = trim(dirname($script_name)) . '/' . $phpbb_root_path . 'install/app.' . $phpEx;
$script_path = trim(dirname($script_name)) . '/' . $phpbb_root_path . 'install/index.' . $phpEx;
// Replace any number of consecutive backslashes and/or slashes with a single slash
// (could happen on some proxy setups and/or Windows servers)
return preg_replace('#[\\\\/]{2,}#', '/', $script_path);
Expand Down
11 changes: 0 additions & 11 deletions 11 phpBB/install/index.html

This file was deleted.

File renamed without changes.
2 changes: 1 addition & 1 deletion 2 phpBB/install/startup.php
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ function installer_shutdown_function($display_errors)
@ini_set('display_errors', $display_errors);

// Manually define phpBB root path and phpEx. These will not be passed
// on from app.php
// on from index.php
$phpbb_root_path = __DIR__ . '/../';
$phpEx = 'php';

Expand Down
2 changes: 1 addition & 1 deletion 2 phpBB/language/en/acp/board.php
Original file line number Diff line number Diff line change
Expand Up @@ -451,7 +451,7 @@
'ICONS_PATH' => 'Post icons storage path',
'ICONS_PATH_EXPLAIN' => 'Path under your phpBB root directory, e.g. <samp>images/icons</samp>.',
'MOD_REWRITE_ENABLE' => 'Enable URL Rewriting',
'MOD_REWRITE_ENABLE_EXPLAIN' => 'When enabled, URLs containing ’app.php’ will be rewritten to remove the filename (i.e. app.php/foo will become /foo). <strong>Apache server’s mod_rewrite module is required for this functionality to work; if this option is enabled without mod_rewrite support, URLs on your board may be broken.</strong>',
'MOD_REWRITE_ENABLE_EXPLAIN' => 'When enabled, URLs containing ’index.php’ will be rewritten to remove the filename (i.e. index.php/foo will become /foo). <strong>Apache server’s mod_rewrite module is required for this functionality to work; if this option is enabled without mod_rewrite support, URLs on your board may be broken.</strong>',
'MOD_REWRITE_DISABLED' => 'The <strong>mod_rewrite</strong> module on your Apache web server is disabled. Enable the module or contact your web hosting provider if you wish to enable this feature.',
'MOD_REWRITE_INFORMATION_UNAVAILABLE' => 'We are unable to determine whether or not this server supports URL rewriting. This setting may be enabled but if URL rewriting is not available, paths generated by this board (such as for use in links) may be broken. Contact your web hosting provider if you are unsure whether or not you can safely enable this feature.',
'PATH_SETTINGS' => 'Path settings',
Expand Down
2 changes: 1 addition & 1 deletion 2 phpBB/phpbb/feed/helper.php
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ public function generate_content($content, $uid, $bitfield, $options, $forum_id,
$content .= implode('<br />', $post_attachments);

// Convert attachments' relative path to absolute path
$pattern = '#(/app.php)?/download/attachment/#';
$pattern = '#(/index.php)?/download/attachment/#';
$replacement = $this->get_board_url() . '\1/download/attachment/';
$content = preg_replace($pattern, $replacement, $content);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ public function run()
}

$script_path = str_replace(array('\\', '//'), '/', $script_path);
$script_path = trim(dirname(dirname(dirname($script_path)))); // Because we are in install/app.php/route_name
$script_path = trim(dirname(dirname(dirname($script_path)))); // Because we are in install/index.php/route_name

// Server data
$cookie_secure = $this->io_handler->get_input('cookie_secure', $cookie_secure);
Expand Down
2 changes: 1 addition & 1 deletion 2 phpBB/phpbb/members/controller/online.php
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@ public function handle(): Response
list($location, $location_url) = $this->viewonline_helper->get_location($row['session_page'], $row['session_forum_id']);

$session_page = parse_url($row['session_page'], PHP_URL_PATH);
$session_page = preg_replace('/^\/app\.php\//', '/', $session_page);
$session_page = preg_replace('/^\/index\.php\//', '/', $session_page);
$on_page = $this->viewonline_helper->get_user_page($session_page);

$forum_data = $this->viewonline_helper->get_forum_data();
Expand Down
Loading
Morty Proxy This is a proxified and sanitized view of the page, visit original site.