Skip to content

Commit e5a6d4f

Browse files
committed
Merge branch '3.10-dev' into 4.0-dev
2 parents 950edba + 0d758f4 commit e5a6d4f

File tree

5 files changed

+146
-116
lines changed

5 files changed

+146
-116
lines changed

administrator/components/com_privacy/src/Model/RequestModel.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -409,6 +409,9 @@ public function validate($form, $data, $group = null)
409409
return false;
410410
}
411411

412+
// Make sure the status is always 0
413+
$validatedData['status'] = 0;
414+
412415
// The user cannot create a request for their own account
413416
if (strtolower(Factory::getUser()->email) === strtolower($validatedData['email']))
414417
{

build/build.php

Lines changed: 89 additions & 66 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ function usage(string $command)
2828
{
2929
echo PHP_EOL;
3030
echo 'Usage: php ' . $command . ' [options]' . PHP_EOL;
31-
echo PHP_TAB . '[options]:'.PHP_EOL;
31+
echo PHP_TAB . '[options]:' . PHP_EOL;
3232
echo PHP_TAB . PHP_TAB . '--remote=<remote>:' . PHP_TAB . 'The git remote reference to build from (ex: `tags/3.8.6`, `4.0-dev`), defaults to the most recent tag for the repository' . PHP_EOL;
3333
echo PHP_TAB . PHP_TAB . '--exclude-zip:' . PHP_TAB . PHP_TAB . 'Exclude the generation of .zip packages' . PHP_EOL;
3434
echo PHP_TAB . PHP_TAB . '--exclude-gzip:' . PHP_TAB . PHP_TAB . 'Exclude the generation of .tar.gz packages' . PHP_EOL;
@@ -211,6 +211,9 @@ function clean_composer(string $dir)
211211
$excludeZstd = !isset($options['include-zstd']);
212212
$showHelp = isset($options['help']);
213213

214+
// Disable the generation of extra text files
215+
$includeExtraTextfiles = false;
216+
214217
if ($showHelp)
215218
{
216219
usage($argv[0]);
@@ -224,6 +227,9 @@ function clean_composer(string $dir)
224227
$tagVersion = system($systemGit . ' describe --tags `' . $systemGit . ' rev-list --tags --max-count=1`', $tagVersion);
225228
$remote = 'tags/' . $tagVersion;
226229
chdir($here);
230+
231+
// We are in release mode so we need the extra text files
232+
$includeExtraTextfiles = true;
227233
}
228234

229235
echo "Start build for remote $remote.\n";
@@ -427,18 +433,21 @@ function clean_composer(string $dir)
427433
// Loop through and add all files except: tests, installation, build, .git, .travis, travis, phpunit, .md, or images
428434
foreach ($files as $file)
429435
{
430-
if (substr($file, 0, 1) === 'R') {
431-
$fileName = substr($file, strrpos($file, "\t") + 1);
432-
} else {
433-
$fileName = substr($file, 2);
436+
if (substr($file, 0, 1) === 'R')
437+
{
438+
$fileName = substr($file, strrpos($file, "\t") + 1);
439+
}
440+
else
441+
{
442+
$fileName = substr($file, 2);
434443
}
435-
$folderPath = explode('/', $fileName);
436-
$baseFolderName = $folderPath[0];
437444

438-
$doNotPackageFile = in_array(trim($fileName), $doNotPackage);
439-
$doNotPatchFile = in_array(trim($fileName), $doNotPatch);
445+
$folderPath = explode('/', $fileName);
446+
$baseFolderName = $folderPath[0];
447+
$doNotPackageFile = in_array(trim($fileName), $doNotPackage);
448+
$doNotPatchFile = in_array(trim($fileName), $doNotPatch);
440449
$doNotPackageBaseFolder = in_array($baseFolderName, $doNotPackage);
441-
$doNotPatchBaseFolder = in_array($baseFolderName, $doNotPatch);
450+
$doNotPatchBaseFolder = in_array($baseFolderName, $doNotPatch);
442451

443452
if ($doNotPackageFile || $doNotPatchFile || $doNotPackageBaseFolder || $doNotPatchBaseFolder)
444453
{
@@ -619,84 +628,98 @@ function clean_composer(string $dir)
619628

620629
chdir('..');
621630

622-
foreach (array_keys($checksums) as $packageName)
631+
// Thats only needed when we release a version
632+
if ($includeExtraTextfiles)
623633
{
624-
echo "Generating checksums for $packageName\n";
625634

626-
foreach (array('md5', 'sha1', 'sha256', 'sha384', 'sha512') as $hash)
635+
foreach (array_keys($checksums) as $packageName)
627636
{
628-
if (file_exists('packages/' . $packageName))
629-
{
630-
$checksums[$packageName][$hash] = hash_file($hash, 'packages/' . $packageName);
631-
}
632-
else
637+
echo "Generating checksums for $packageName\n";
638+
639+
foreach (array('sha256', 'sha384', 'sha512') as $hash)
633640
{
634-
echo "Package $packageName not found in build directories\n";
641+
if (file_exists('packages/' . $packageName))
642+
{
643+
$checksums[$packageName][$hash] = hash_file($hash, 'packages/' . $packageName);
644+
}
645+
else
646+
{
647+
echo "Package $packageName not found in build directories\n";
648+
}
635649
}
636650
}
637-
}
638-
639-
echo "Generating checksums.txt file\n";
640651

641-
$checksumsContent = '';
652+
echo "Generating checksums.txt file\n";
642653

643-
foreach ($checksums as $packageName => $packageHashes)
644-
{
645-
$checksumsContent .= "Filename: $packageName\n";
654+
$checksumsContent = '';
646655

647-
foreach ($packageHashes as $hashType => $hash)
656+
foreach ($checksums as $packageName => $packageHashes)
648657
{
649-
$checksumsContent .= "$hashType: $hash\n";
650-
}
658+
$checksumsContent .= "Filename: $packageName\n";
651659

652-
$checksumsContent .= "\n";
653-
}
660+
foreach ($packageHashes as $hashType => $hash)
661+
{
662+
$checksumsContent .= "$hashType: $hash\n";
663+
}
654664

655-
file_put_contents('checksums.txt', $checksumsContent);
665+
$checksumsContent .= "\n";
666+
}
656667

657-
echo "Generating github_release.txt file\n";
668+
file_put_contents('checksums.txt', $checksumsContent);
658669

659-
$githubContent = array();
660-
$githubText = '';
661-
$releaseText = array(
662-
'FULL' => 'New Joomla! Installations ',
663-
'POINT' => 'Update from Joomla! ' . $version . '.' . $previousRelease . ' ',
664-
'MINOR' => 'Update from Joomla! ' . $version . '.x ',
665-
'UPGRADE' => 'Update from Joomla! 3.10 ',
666-
);
667-
$githubLink = 'https://github.com/joomla/joomla-cms/releases/download/' . $tagVersion . '/';
670+
echo "Generating github_release.txt file\n";
668671

669-
foreach ($checksums as $packageName => $packageHashes)
670-
{
671-
$type = '';
672-
if (strpos($packageName, 'Full_Package') !== false)
672+
$githubContent = array();
673+
$githubText = '';
674+
$releaseText = array(
675+
'FULL' => 'New Joomla! Installations ',
676+
'POINT' => 'Update from Joomla! ' . $version . '.' . $previousRelease . ' ',
677+
'MINOR' => 'Update from Joomla! ' . $version . '.x ',
678+
'UPGRADE' => 'Update from Joomla! 3.10 ',
679+
);
680+
$githubLink = 'https://github.com/joomla/joomla-cms/releases/download/' . $tagVersion . '/';
681+
682+
foreach ($checksums as $packageName => $packageHashes)
673683
{
674-
$type = 'FULL';
675-
} elseif (strpos($packageName, 'Patch_Package') !== false) {
676-
if (strpos($packageName, '.x_to') !== false) {
677-
$type = 'MINOR';
678-
} else {
679-
$type = 'POINT';
684+
$type = '';
685+
686+
if (strpos($packageName, 'Full_Package') !== false)
687+
{
688+
$type = 'FULL';
689+
}
690+
elseif (strpos($packageName, 'Patch_Package') !== false)
691+
{
692+
if (strpos($packageName, '.x_to') !== false)
693+
{
694+
$type = 'MINOR';
695+
}
696+
else
697+
{
698+
$type = 'POINT';
699+
}
700+
}
701+
elseif (strpos($packageName, 'Update_Package') !== false)
702+
{
703+
$type = 'UPGRADE';
680704
}
681-
} elseif (strpos($packageName, 'Update_Package') !== false) {
682-
$type = 'UPGRADE';
705+
706+
$githubContent[$type][] = '[' . substr($packageName, strpos($packageName, 'Package') + 7) . '](' . $githubLink . $packageName . ')';
683707
}
684708

685-
$githubContent[$type][] = '[' . substr($packageName, strpos($packageName, 'Package') + 7) . '](' . $githubLink . $packageName . ')';
686-
}
709+
foreach ($releaseText as $type => $text)
710+
{
711+
if (empty($githubContent[$type]))
712+
{
713+
continue;
714+
}
687715

688-
foreach($releaseText as $type => $text)
689-
{
690-
if (empty($githubContent[$type])) {
691-
continue;
692-
}
716+
$githubText .= $text;
717+
$githubText .= implode(" | ", $githubContent[$type]);
693718

694-
$githubText .= $text;
695-
$githubText .= implode(" | ", $githubContent[$type]);
719+
$githubText .= "\n";
720+
}
696721

697-
$githubText .= "\n";
722+
file_put_contents('github_release.txt', $githubText);
698723
}
699724

700-
file_put_contents('github_release.txt', $githubText);
701-
702725
echo "Build of version $fullVersion complete!\n";

build/bump.php

Lines changed: 49 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -36,47 +36,47 @@ function usage($command)
3636
const PHP_TAB = "\t";
3737

3838
// File paths.
39-
$versionFile = '/libraries/src/Version.php';
39+
$versionFile = '/libraries/src/Version.php';
4040

41-
$coreXmlFiles = array(
42-
'/administrator/manifests/files/joomla.xml',
43-
);
41+
$coreXmlFiles = array(
42+
'/administrator/manifests/files/joomla.xml',
43+
);
4444

4545
$languageXmlFiles = array(
46-
'/language/en-GB/langmetadata.xml',
47-
'/language/en-GB/install.xml',
48-
'/administrator/language/en-GB/langmetadata.xml',
49-
'/administrator/language/en-GB/install.xml',
50-
'/installation/language/en-GB/en-GB.xml',
51-
'/api/language/en-GB/langmetadata.xml'
52-
);
46+
'/language/en-GB/langmetadata.xml',
47+
'/language/en-GB/install.xml',
48+
'/administrator/language/en-GB/langmetadata.xml',
49+
'/administrator/language/en-GB/install.xml',
50+
'/installation/language/en-GB/en-GB.xml',
51+
'/api/language/en-GB/langmetadata.xml'
52+
);
5353

5454
$languagePackXmlFile = '/administrator/manifests/packages/pkg_en-GB.xml';
5555

5656
$antJobFile = '/build.xml';
5757

5858
$readMeFiles = array(
59-
'/README.md',
60-
'/README.txt',
61-
);
59+
'/README.md',
60+
'/README.txt',
61+
);
6262

6363
/*
6464
* Change copyright date exclusions.
6565
* Some systems may try to scan the .git directory, exclude it.
66-
* Also exclude build resources such as the packaging space or the API documentation build.
66+
* Also exclude build resources such as the packaging space or the API documentation build
67+
* as well as external libraries.
6768
*/
6869
$directoryLoopExcludeDirectories = array(
69-
'/.git',
70-
'/build/api/',
71-
'/build/coverage/',
72-
'/build/tmp/',
73-
'/libraries/vendor/',
74-
'/libraries/php-encryption/',
75-
'/libraries/phpass/',
76-
);
77-
78-
$directoryLoopExcludeFiles = array(
79-
);
70+
'/.git',
71+
'/build/api/',
72+
'/build/coverage/',
73+
'/build/tmp/',
74+
'/libraries/vendor/',
75+
'/libraries/php-encryption/',
76+
'/libraries/phpass/',
77+
);
78+
79+
$directoryLoopExcludeFiles = array();
8080

8181
// Check arguments (exit if incorrect cli arguments).
8282
$opts = getopt("v:c:");
@@ -155,20 +155,20 @@ function usage($command)
155155
$versionSubParts = explode('.', $versionParts[0]);
156156

157157
$version = array(
158-
'main' => $versionSubParts[0] . '.' . $versionSubParts[1],
159-
'major' => $versionSubParts[0],
160-
'minor' => $versionSubParts[1],
161-
'patch' => $versionSubParts[2],
162-
'extra' => (!empty($versionParts[1]) ? $versionParts[1] : '') . (!empty($versionParts[2]) ? (!empty($versionParts[1]) ? '-' : '') . $versionParts[2] : ''),
163-
'release' => $versionSubParts[0] . '.' . $versionSubParts[1] . '.' . $versionSubParts[2],
164-
'dev_devel' => $versionSubParts[2] . (!empty($versionParts[1]) ? '-' . $versionParts[1] : '') . (!empty($versionParts[2]) ? '-' . $versionParts[2] : ''),
165-
'dev_status' => $dev_status,
166-
'build' => '',
167-
'reldate' => date('j-F-Y'),
168-
'reltime' => date('H:i'),
169-
'reltz' => 'GMT',
170-
'credate' => date('F Y'),
171-
);
158+
'main' => $versionSubParts[0] . '.' . $versionSubParts[1],
159+
'major' => $versionSubParts[0],
160+
'minor' => $versionSubParts[1],
161+
'patch' => $versionSubParts[2],
162+
'extra' => (!empty($versionParts[1]) ? $versionParts[1] : '') . (!empty($versionParts[2]) ? (!empty($versionParts[1]) ? '-' : '') . $versionParts[2] : ''),
163+
'release' => $versionSubParts[0] . '.' . $versionSubParts[1] . '.' . $versionSubParts[2],
164+
'dev_devel' => $versionSubParts[2] . (!empty($versionParts[1]) ? '-' . $versionParts[1] : '') . (!empty($versionParts[2]) ? '-' . $versionParts[2] : ''),
165+
'dev_status' => $dev_status,
166+
'build' => '',
167+
'reldate' => date('j-F-Y'),
168+
'reltime' => date('H:i'),
169+
'reltz' => 'GMT',
170+
'credate' => date('F Y'),
171+
);
172172

173173
// Version Codename.
174174
if (!empty($opts['c']))
@@ -178,21 +178,23 @@ function usage($command)
178178

179179
// Prints version information.
180180
echo PHP_EOL;
181-
echo 'Version data:'. PHP_EOL;
181+
echo 'Version data:' . PHP_EOL;
182182
echo '- Main:' . PHP_TAB . PHP_TAB . PHP_TAB . $version['main'] . PHP_EOL;
183183
echo '- Release:' . PHP_TAB . PHP_TAB . $version['release'] . PHP_EOL;
184-
echo '- Full:' . PHP_TAB . PHP_TAB . PHP_TAB . $version['main'] . '.' . $version['dev_devel'] . PHP_EOL;
184+
echo '- Full:' . PHP_TAB . PHP_TAB . PHP_TAB . $version['main'] . '.' . $version['dev_devel'] . PHP_EOL;
185185
echo '- Build:' . PHP_TAB . PHP_TAB . $version['build'] . PHP_EOL;
186186
echo '- Dev Level:' . PHP_TAB . PHP_TAB . $version['dev_devel'] . PHP_EOL;
187187
echo '- Dev Status:' . PHP_TAB . PHP_TAB . $version['dev_status'] . PHP_EOL;
188188
echo '- Release date:' . PHP_TAB . PHP_TAB . $version['reldate'] . PHP_EOL;
189189
echo '- Release time:' . PHP_TAB . PHP_TAB . $version['reltime'] . PHP_EOL;
190-
echo '- Release timezone:' . PHP_TAB . $version['reltz'] . PHP_EOL;
190+
echo '- Release timezone:' . PHP_TAB . $version['reltz'] . PHP_EOL;
191191
echo '- Creation date:' . PHP_TAB . $version['credate'] . PHP_EOL;
192+
192193
if (!empty($version['codename']))
193194
{
194195
echo '- Codename:' . PHP_TAB . PHP_TAB . $version['codename'] . PHP_EOL;
195196
}
197+
196198
echo PHP_EOL;
197199

198200
$rootPath = dirname(__DIR__);
@@ -212,10 +214,12 @@ function usage($command)
212214
$fileContents = preg_replace("#RELDATE\s*=\s*'[^\']*'#", "RELDATE = '" . $version['reldate'] . "'", $fileContents);
213215
$fileContents = preg_replace("#RELTIME\s*=\s*'[^\']*'#", "RELTIME = '" . $version['reltime'] . "'", $fileContents);
214216
$fileContents = preg_replace("#RELTZ\s*=\s*'[^\']*'#", "RELTZ = '" . $version['reltz'] . "'", $fileContents);
217+
215218
if (!empty($version['codename']))
216219
{
217220
$fileContents = preg_replace("#CODENAME\s*=\s*'[^\']*'#", "CODENAME = '" . $version['codename'] . "'", $fileContents);
218221
}
222+
219223
file_put_contents($rootPath . $versionFile, $fileContents);
220224
}
221225

@@ -274,8 +278,8 @@ function usage($command)
274278

275279
$changedFilesSinceVersion = 0;
276280
$year = date('Y');
277-
$directory = new \RecursiveDirectoryIterator($rootPath);
278-
$iterator = new \RecursiveIteratorIterator($directory, RecursiveIteratorIterator::SELF_FIRST);
281+
$directory = new RecursiveDirectoryIterator($rootPath);
282+
$iterator = new RecursiveIteratorIterator($directory, RecursiveIteratorIterator::SELF_FIRST);
279283

280284
foreach ($iterator as $file)
281285
{

0 commit comments

Comments
 (0)