Popraw walidację zewnętrznych linków aplikacyjnych oraz dodaj .serena do .gitignore

Dodaj automatyczne uzupełnianie https:// dla linków bez protokołu w aplication_link,
aby adresy typu www.example.pl były traktowane jako zewnętrzne.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-02-26 23:05:55 +01:00
parent f7dcc61c83
commit ae0681a016
3 changed files with 16 additions and 5 deletions

1
.gitignore vendored
View File

@@ -1 +1,2 @@
.vscode/ftp-kr.sync.cache.json .vscode/ftp-kr.sync.cache.json
.serena/

5
.vscode/ftp-kr.json vendored
View File

@@ -12,6 +12,9 @@
"ignoreRemoteModification": true, "ignoreRemoteModification": true,
"ignore": [ "ignore": [
".git", ".git",
"/.vscode" "/.vscode",
"/.serena",
"/.claude",
"CLAUDE.md"
] ]
} }

View File

@@ -1,4 +1,11 @@
<? global $lang; ?> <? global $lang;
$fixUrl = function($url) {
if ($url !== '' && !preg_match('#^https?://#i', $url)) {
return 'https://' . $url;
}
return $url;
};
?>
<div class="row"> <div class="row">
<div class="col-12 col-lg-9" style="padding: 0 5px;"> <div class="col-12 col-lg-9" style="padding: 0 5px;">
<div class="advert-details"> <div class="advert-details">
@@ -224,11 +231,11 @@
<? endif;?> <? endif;?>
</div> </div>
<? endif; ?> <? endif; ?>
<a href="<?= $this->advert['aplication_link'] != '' ? $this->advert['aplication_link'] : '/aplikuj/' . $this -> advert['id'];?>" class="aplication-link btn btn-red mt15 btn_aplikuj">Aplikuj teraz</a> <a href="<?= $this->advert['aplication_link'] != '' ? $fixUrl($this->advert['aplication_link']) : '/aplikuj/' . $this -> advert['id'];?>" class="aplication-link btn btn-red mt15 btn_aplikuj" <?= $this->advert['aplication_link'] ? 'target="_blank"' : '';?>>Aplikuj teraz</a>
</div> </div>
</div> </div>
<div class="col-12 col-lg-3" style="padding: 0 5px;"> <div class="col-12 col-lg-3" style="padding: 0 5px;">
<a href="<?= $this->advert['aplication_link'] != '' ? $this->advert['aplication_link'] : '/aplikuj/' . $this -> advert['id'];?>" class="btn btn-red btn_aplikuj" <?= $this -> advert['aplication_link'] ? 'target="_blank"' : '';?>>Aplikuj</a> <a href="<?= $this->advert['aplication_link'] != '' ? $fixUrl($this->advert['aplication_link']) : '/aplikuj/' . $this -> advert['id'];?>" class="btn btn-red btn_aplikuj" <?= $this->advert['aplication_link'] ? 'target="_blank"' : '';?>>Aplikuj</a>
<div class="row advert_details_boxes"> <div class="row advert_details_boxes">
<div class="col-12"> <div class="col-12">
<div class="mini-box mt10 text-center"> <div class="mini-box mt10 text-center">
@@ -301,7 +308,7 @@
</div> </div>
<div class="_bottom"> <div class="_bottom">
<!-- button aplikuj --> <!-- button aplikuj -->
<a href="<?= $advert['aplication_link'] != '' ? $advert['aplication_link'] : '/aplikuj/' . $advert['id'];?>">Aplikuj szybko</a> <a href="<?= $advert['aplication_link'] != '' ? $fixUrl($advert['aplication_link']) : '/aplikuj/' . $advert['id'];?>">Aplikuj szybko</a>
</div> </div>
</li> </li>
<? endforeach; ?> <? endforeach; ?>