laravel-3

How can I allow WYSIWYG editors and disable XSS attacks using Laravel?

邮差的信 提交于 2019-12-03 03:07:38
I have a enterprise level application where logged in users are authorized to post articles to page using a WYSIWYG editor. (You can consider this application as a website builder.) Everything works fine, but the problems are; WYSIWYG editor posts a HTML containing article, also some localised string characters which Laravel doesn't like, so Laravel's alpha_num check can't pass. (Therefore we don't use it on validation checks.) We need to allow characters like < , " , > because they may want to do some basic styling using WYSIWYG editor, so htmlspecialchars() is not an option while echoing

Username as subdomain on laravel

自古美人都是妖i 提交于 2019-12-03 01:23:32
问题 I've set up a wildcard subdomain *.domain.com & i'm using the following .htaccess: Options +FollowSymLinks RewriteEngine On RewriteBase / RewriteCond %{HTTP_HOST} !www\. RewriteCond %{HTTP_HOST} (.*)\.domain\.com RewriteRule .* index.php?username=%1 [L] Everything works perfectly. I want to implement this method in laravel. Mainly I want to have my user's profile displayed when you go to username.domain.com. Any ideas on achieving this? 回答1: This is easy. Firstly - do NOT change the .htaccess

Breakpoints not hit with xdebug, PhpStorm and Laravel 3 / mod_rewrite

女生的网名这么多〃 提交于 2019-12-02 20:54:41
I'm pretty desperate and running out of ideas: I've configured xdebug and PhpStorm for a Laravel 3 project. Running the project locally on Mac OS X Apache, so PhpStorm and the web application run on the same machine. Configured a virtual host so that localhost.lt points to Laravel's public directory. Relevant xdebug entries in php.ini: zend_extension = /usr/lib/php/extensions/no-debug-non-zts-20090626/xdebug.so [xdebug] xdebug.idekey="PHPSTORM" xdebug.remote_enable=1 xdebug.profiler_enable=1 xdebug.remote_log=/var/log/xdebug_remote.log xdebug.remote_connect_back=1 Confirmed that extension gets

Username as subdomain on laravel

强颜欢笑 提交于 2019-12-02 14:45:47
I've set up a wildcard subdomain *.domain.com & i'm using the following .htaccess: Options +FollowSymLinks RewriteEngine On RewriteBase / RewriteCond %{HTTP_HOST} !www\. RewriteCond %{HTTP_HOST} (.*)\.domain\.com RewriteRule .* index.php?username=%1 [L] Everything works perfectly. I want to implement this method in laravel. Mainly I want to have my user's profile displayed when you go to username.domain.com. Any ideas on achieving this? This is easy. Firstly - do NOT change the .htaccess file from the default provided by Laravel. By default all requests to your domain will be routed to your

Using CKEditor inside blade template [Laravel 3.x]

扶醉桌前 提交于 2019-12-02 09:32:59
I'd like to use this bundle: laravel-ckeditor but I have troubles in nesting it in my view (all previous installation steps I've done successfully). How can i connect Form::text() with this bundle? When I add <?php $ckeditor = new CKEditor(); $config = array(); $config['toolbar'] = array( array( 'Source', '-', 'Bold', 'Italic', 'Underline', 'Strike' ), array( 'Image', 'Link', 'Unlink', 'Anchor' ) ); $events['instanceReady'] = 'function (ev) { alert("Loaded: " + ev.editor.name); }'; $ckeditor->editor("field1", " Initial value. ", $config, $events); ?> it simply creates new text area but

Why would Laravel Sessions fail in just Safari and IE after switching server?

杀马特。学长 韩版系。学妹 提交于 2019-11-30 14:35:15
New VPS server with Webmin, Apache Centos 6, Laravel application and old database schema. All working fine on old shared host, but on VPS for some reason Laravel's Session storage (Laravel 3.0) is no longer working on Safari or Internet Explorer. It seems that the Session ID is just not saving on the client. Is a good way to force the Laravel Session ID to save on the clients browser? What are the differences between the way Safari/IE store cookies that might be creating this problem, when Chrome/Firefox appear to be working perfectly fine? Cookies can get knickers in a twist if the time

Getting selected values from a multiple select form in Laravel

血红的双手。 提交于 2019-11-30 12:35:37
For generating a drop-down list with an item selected by default, the following is done: echo Form::select('size', array('L' => 'Large', 'M' => 'Medium', 'S' => 'Small'), 'S'); So I generated a drop-down list that has more than one item selected by default, in the following way: echo Form::select('size', array('L' => 'Large', 'M' => 'Medium', 'S' => 'Small'), array('S', 'M'), array('multiple')); But how do I get the more than one selected values? Input::get('size') returns only the last selected string. First, if you want to have multiple item selected by default, you have to give an array of

Convert laravel object to array

独自空忆成欢 提交于 2019-11-30 12:02:12
问题 Laravel output: Array ( [0] = stdClass Object ( [ID] = 5 ) [1] = stdClass Object ( [ID] = 4 ) ) I want to convert this into normal array. Just want to remove that stdClass Object . I also tried using ->toArray(); but I get an error: Call to a member function toArray() on a non-object. How can I fix this? Functionalities have been Implemented on http://www.srihost.com 回答1: UPDATE since version 5.4 of Laravel it is no longer possible. You can change your db config, like @Varun suggested, or if

Where can I get a complete list of Laravel events (fired by the core libraries)?

≯℡__Kan透↙ 提交于 2019-11-30 11:53:10
问题 I want to know what events are fired by Laravel core libraries. I want to get the complete list, such as laravel.query and laravel.done . There are four events listed at the official docs, but I think Laravel has more events than these four! 回答1: Laravel doesn't actually fire as many events as you'd think. While it does make use of the Event system it's there for developers to use within there applications. Anyway, here's a list I compiled. laravel.done laravel.log laravel.query laravel

Convert laravel object to array

强颜欢笑 提交于 2019-11-30 02:25:26
Laravel output: Array ( [0] = stdClass Object ( [ID] = 5 ) [1] = stdClass Object ( [ID] = 4 ) ) I want to convert this into normal array. Just want to remove that stdClass Object . I also tried using ->toArray(); but I get an error: Call to a member function toArray() on a non-object. How can I fix this? Functionalities have been Implemented on http://www.srihost.com UPDATE since version 5.4 of Laravel it is no longer possible. You can change your db config, like @Varun suggested, or if you want to do it just in this very case, then: DB::setFetchMode(PDO::FETCH_ASSOC); // then DB::table(..)-