greenmeteor / codebox Goto Github PK
View Code? Open in Web Editor NEWAllows you to add and use HTML snippets on your sidebar
Allows you to add and use HTML snippets on your sidebar
Reproduce:
<script nonce={{nonce}}>alert(1)</script>
In the source I can see the nonce
variable is passed to the view here: https://github.com/GreenMeteor/codebox/blob/master/widgets/CodeboxFrame.php#L34
But on the view side it's not used:
https://github.com/GreenMeteor/codebox/blob/master/widgets/views/codeboxframe.php
Convenient module, but I want to be able to add multiple different codeboxes, so I can display multiple things.
After installing the Codebox with the new changes from #8 at commit d4d466f I'm getting this stacktrace when navigating to the dashboard. This may be a problem with my testing deployment, but I'm not sure at this point.
Unknown Property – [yii\base\UnknownPropertyException](https://www.yiiframework.com/doc-2.0/yii-base-unknownpropertyexception.html)
Getting unknown property: humhub\modules\codebox\Module::isEnabled
1. in /var/www/localhost/htdocs/protected/vendor/yiisoft/yii2/base/Component.php at line 154
145146147148149150151152153154155156157158159160161162163
if ($behavior->canGetProperty($name)) {
return $behavior->$name;
}
}
if (method_exists($this, 'set' . $name)) {
throw new InvalidCallException('Getting write-only property: ' . get_class($this) . '::' . $name);
}
throw new UnknownPropertyException('Getting unknown property: ' . get_class($this) . '::' . $name);
}
/**
* Sets the value of a component property.
*
* This method will check in the following order and act accordingly:
*
* - a property defined by a setter: set the property value
* - an event in the format of "on xyz": attach the handler to the event "xyz"
2. in /var/www/localhost/htdocs/protected/vendor/yiisoft/yii2/di/ServiceLocator.php at line 77 – [yii\base\Component::__get](https://www.yiiframework.com/doc-2.0/yii-base-component.html#__get()-detail)()
3. in /var/www/localhost/htdocs/protected/modules/codebox/Events.php at line 42 – [yii\di\ServiceLocator::__get](https://www.yiiframework.com/doc-2.0/yii-di-servicelocator.html#__get()-detail)()
36373839404142434445464748
public static function addCodeboxFrame($event)
{
// Retrieve the Codebox module
$module = Yii::$app->getModule('codebox');
// Check if the module is enabled
if ($module !== null && $module->isEnabled) {
// Retrieve the settings from the database
$entries = ConfigureForm::find()->asArray()->all();
// Add the CodeboxFrame widget with the entries
$event->sender->addWidget(
\humhub\modules\codebox\widgets\CodeboxFrame::class,
4. humhub\modules\codebox\Events::addCodeboxFrame()
5. in /var/www/localhost/htdocs/protected/vendor/yiisoft/yii2/base/Event.php at line 312 – call_user_func()
6. in /var/www/localhost/htdocs/protected/vendor/yiisoft/yii2/base/Component.php at line 642 – [yii\base\Event::trigger](https://www.yiiframework.com/doc-2.0/yii-base-event.html#trigger()-detail)()
7. in /var/www/localhost/htdocs/protected/vendor/yiisoft/yii2/base/Widget.php at line 72 – [yii\base\Component::trigger](https://www.yiiframework.com/doc-2.0/yii-base-component.html#trigger()-detail)()
8. in /var/www/localhost/htdocs/protected/humhub/widgets/BaseStack.php at line 72 – [yii\base\Widget::init](https://www.yiiframework.com/doc-2.0/yii-base-widget.html#init()-detail)()
66676869707172737475767778
{
// Yii 2.0.11 introduced own init event
if (version_compare(Yii::getVersion(), '2.0.11', '<')) {
$this->trigger(self::EVENT_INIT);
}
parent::init();
}
/**
* Runs the Navigation
*/
public function run()
9. in /var/www/localhost/htdocs/protected/humhub/modules/dashboard/widgets/Sidebar.php at line 27 – humhub\widgets\BaseStack::init()
21222324252627282930313233
/**
* @inheritDoc
*/
public function init()
{
parent::init();
/** @var Module $module */
$module = Yii::$app->getModule('dashboard');
if ($module->hideActivitySidebarWidget) {
foreach ($this->widgets as $k => $widget) {
10. in /var/www/localhost/htdocs/protected/vendor/yiisoft/yii2/base/BaseObject.php at line 109 – humhub\modules\dashboard\widgets\Sidebar::init()
11. [yii\base\BaseObject::__construct](https://www.yiiframework.com/doc-2.0/yii-base-baseobject.html#__construct()-detail)()
12. in /var/www/localhost/htdocs/protected/vendor/yiisoft/yii2/di/Container.php at line 419 – ReflectionClass::newInstanceArgs()
13. in /var/www/localhost/htdocs/protected/vendor/yiisoft/yii2/di/Container.php at line 170 – [yii\di\Container::build](https://www.yiiframework.com/doc-2.0/yii-di-container.html#build()-detail)()
14. in /var/www/localhost/htdocs/protected/vendor/yiisoft/yii2/BaseYii.php at line 365 – [yii\di\Container::get](https://www.yiiframework.com/doc-2.0/yii-di-container.html#get()-detail)()
15. in /var/www/localhost/htdocs/protected/humhub/components/Widget.php at line 60 – [yii\BaseYii::createObject](https://www.yiiframework.com/doc-2.0/yii-baseyii.html#createObject()-detail)()
54555657585960616263646566
\yii\base\Event::trigger(static::class, self::EVENT_CREATE, new WidgetCreateEvent($config));
ob_start();
ob_implicit_flush(false);
try {
/* @var $widget Widget */
$widget = Yii::createObject($config);
$out = '';
if ($widget->beforeRun()) {
$result = (empty($widget->widgetLayout)) ? $widget->run() : $widget->render($widget->widgetLayout, $widget->getLayoutViewParams());
$out = $widget->afterRun($result);
}
} catch (\Throwable $e) {
16. in /var/www/localhost/htdocs/protected/humhub/modules/dashboard/views/dashboard/index.php at line 28 – humhub\components\Widget::widget()
22232425262728293031323334
?>
</div>
<div class="col-md-4 layout-sidebar-container">
<?= Sidebar::widget([
'widgets' => [
[
ActivityStreamViewer::class,
['streamAction' => '/dashboard/dashboard/activity-stream'],
['sortOrder' => 150]
]
]
]);
?>
17. in /var/www/localhost/htdocs/protected/vendor/yiisoft/yii2/base/View.php at line 347 – require('/var/www/localhost/htdocs/protec...')
18. in /var/www/localhost/htdocs/protected/vendor/yiisoft/yii2/base/View.php at line 257 – [yii\base\View::renderPhpFile](https://www.yiiframework.com/doc-2.0/yii-base-view.html#renderPhpFile()-detail)()
19. in /var/www/localhost/htdocs/protected/vendor/yiisoft/yii2/base/View.php at line 156 – [yii\base\View::renderFile](https://www.yiiframework.com/doc-2.0/yii-base-view.html#renderFile()-detail)()
20. in /var/www/localhost/htdocs/protected/vendor/yiisoft/yii2/base/Controller.php at line 407 – [yii\base\View::render](https://www.yiiframework.com/doc-2.0/yii-base-view.html#render()-detail)()
21. in /var/www/localhost/htdocs/protected/humhub/modules/dashboard/controllers/DashboardController.php at line 81 – [yii\base\Controller::render](https://www.yiiframework.com/doc-2.0/yii-base-controller.html#render()-detail)()
757677787980818283848586
{
if (Yii::$app->user->isGuest) {
return $this->render('index_guest', []);
} else {
return $this->render('index', [
'showProfilePostForm' => Yii::$app->getModule('dashboard')->settings->get('showProfilePostForm'),
'contentContainer' => Yii::$app->user->getIdentity()
]);
}
}
}
22. humhub\modules\dashboard\controllers\DashboardController::actionIndex()
23. in /var/www/localhost/htdocs/protected/vendor/yiisoft/yii2/base/InlineAction.php at line 57 – call_user_func_array()
24. in /var/www/localhost/htdocs/protected/vendor/yiisoft/yii2/base/Controller.php at line 178 – [yii\base\InlineAction::runWithParams](https://www.yiiframework.com/doc-2.0/yii-base-inlineaction.html#runWithParams()-detail)()
25. in /var/www/localhost/htdocs/protected/vendor/yiisoft/yii2/base/Module.php at line 552 – [yii\base\Controller::runAction](https://www.yiiframework.com/doc-2.0/yii-base-controller.html#runAction()-detail)()
26. in /var/www/localhost/htdocs/protected/vendor/yiisoft/yii2/web/Application.php at line 103 – [yii\base\Module::runAction](https://www.yiiframework.com/doc-2.0/yii-base-module.html#runAction()-detail)()
27. in /var/www/localhost/htdocs/protected/vendor/yiisoft/yii2/base/Application.php at line 384 – [yii\web\Application::handleRequest](https://www.yiiframework.com/doc-2.0/yii-web-application.html#handleRequest()-detail)()
28. in /var/www/localhost/htdocs/index.php at line 25 – [yii\base\Application::run](https://www.yiiframework.com/doc-2.0/yii-base-application.html#run()-detail)()
19202122232425
require(__DIR__ . '/protected/humhub/config/web.php'),
(is_readable(__DIR__ . '/protected/config/dynamic.php')) ? require(__DIR__ . '/protected/config/dynamic.php') : [],
require(__DIR__ . '/protected/config/common.php'),
require(__DIR__ . '/protected/config/web.php')
);
(new humhub\components\Application($config))->run();
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.