Skip to content

Instantly share code, notes, and snippets.

--- Classes/Page/PageRenderer.php 2023-05-11 10:41:55.206722544 +0200
+++ Classes/Page/PageRenderer.php 2023-05-11 10:34:43.011841844 +0200
@@ -2145,7 +2145,7 @@
if ($this->getApplicationType() === 'BE') {
$this->javaScriptRenderer->addGlobalAssignment(['TYPO3' => $assignments]);
} else {
- // @todo apply nonce for CSP (means dropping static `inlineJavascriptWrap`)
+ $attributes = $this->nonce !== null ? ['nonce' => $this->nonce->consume()] : [];
$out .= $this->wrapInlineScript(
sprintf(

Keybase proof

I hereby claim:

  • I am astehlik on github.
  • I am astehlik (https://keybase.io/astehlik) on keybase.
  • I have a public key ASDr1yyYvZG157acQDxjFEeSdiHxA5Dt8ks99KAtqbeLqQo

To claim this, I am signing this object:

#!/usr/bin/env bash
THIS_SCRIPT_DIR="$( cd "$( dirname `readlink -f "${BASH_SOURCE[0]}"` )" >/dev/null && pwd )"
phpVersion=7.2
remainingArguments="$@"
if [[ "$1" =~ (5.6|7.0|7.1|7.2|7.3) ]]; then
phpVersion=$1
remainingArguments="${@:2}"
before_script:
- curl -sS https://getcomposer.org/installer | php
- if [ "$GITHUB_COMPOSER_AUTH" ]; then php composer.phar config -g github-oauth.github.com $GITHUB_COMPOSER_AUTH; fi
test:phpcs:
script:
- php composer.phar require typo3/cms="^7.6.0"
- .Build/bin/phpcs --config-set installed_paths Tests/CodeSniffer
- .Build/bin/phpcs --standard=PSRDefault Classes Tests/Unit ext_localconf.php ext_tables.php
@astehlik
astehlik / UrlDisplayFormElement.php
Created April 8, 2016 09:37
Custom TYPO3 form field
<?php
namespace Tx\Tinyurls\Hooks;
class UrlDisplayFormElement extends \TYPO3\CMS\Backend\Form\AbstractNode implements \TYPO3\CMS\Backend\Form\NodeInterface
{
/**
* Main render method
*
diff --git a/src/main/resources/META-INF/resources/jsp/application/app_form.jsp b/src/main/resources/META-INF/resources/jsp/application/app_form.jsp
index ba2fbff..d5730f7 100644
--- a/src/main/resources/META-INF/resources/jsp/application/app_form.jsp
+++ b/src/main/resources/META-INF/resources/jsp/application/app_form.jsp
@@ -14,6 +14,41 @@
<head>
<uv:head/>
+
+ <script type="text/javascript">
@astehlik
astehlik / typo3-git-subsplit-research.md
Last active January 30, 2016 18:47
TYPO3 git-subsplit research
@astehlik
astehlik / typo3_systemcheck.sh
Created January 15, 2016 17:30
Cronjob for checking TYPO3 Scheduler task disabled state and database triggers
#!/bin/bash
mysql_user="xxx"
mysql_pass="xxx"
mysql_db="xxx"
mysql="mysql --skip-column-names -u $mysql_user -p$mysql_pass -D $mysql_db"
messages=""
# Appends an error message to the output
@astehlik
astehlik / gist:3986cbae9d2a87055981
Created July 27, 2015 13:20
Regex for replacing unterscored class names with namespaces
# Moves Tx_Mynamespace_Subname_Classname classes to the Tx\Mynamespace\Subname namespace.
<\?php([\s\S]*class) Tx_Mynamespace_(.+?)_
<?php\nnamespace Tx\\\\Mynamespace\\\\$2;$1
# Moves Tx_Mynamespace_Classname classes to the Tx\Mynamespace namespace.
<\?php([\s\S]*class) Tx_Mynamespace_(.+?)
<?php\nnamespace Tx\\\\Mynamespace;$1 $2
@astehlik
astehlik / gist:ab9fdc00b17c964ec5d1
Created July 4, 2015 14:27
ReadOnlyDirectoryStorage example configuration
TYPO3:
Flow:
resource:
storages:
libraryStorage:
storage: 'De\SWebhosting\Bootstrap\Resource\ReadOnlyDirectoryStorage'
storageOptions:
paths:
bootstrap: '%FLOW_PATH_ROOT%Packages/Libraries/twbs/bootstrap'