Warning: The author of this contribution does not provide support for it anymore.

User Blog Mod

Error when changing css - User Blog Mod

Error when changing css

by pilsner » Sun Jun 21, 2015 9:32 pm

I was trying to change the css of the blog and was getting this error:

[phpBB Debug] PHP Warning: in file [ROOT]/blog/includes/functions.php on line 388: preg_replace() [function.preg-replace]: Compilation failed: invalid range in character class at offset 32

SQL ERROR [ mysqli ]

Column 'blog_css' cannot be null [1048]


UPDATE phpbb_blogs_users SET instant_redirect = 0, blog_subscription_default = 0, blog_style = '1', blog_css = NULL WHERE user_id = 2


FILE: (not given by php)
LINE: (not given by php)
CALL: msg_handler()

FILE: [ROOT]/includes/db/dbal.php
LINE: 757
CALL: trigger_error()

FILE: [ROOT]/includes/db/mysqli.php
LINE: 189
CALL: dbal->sql_error()

FILE: [ROOT]/blog/includes/functions.php
LINE: 422
CALL: dbal_mysqli->sql_query()

FILE: [ROOT]/includes/ucp/ucp_blog.php
LINE: 65
CALL: update_user_blog_settings()

FILE: [ROOT]/includes/functions_module.php
LINE: 507
CALL: ucp_blog->main()

FILE: [ROOT]/ucp.php
LINE: 340
CALL: p_master->load_active()

Does anyone knows whats wrong?
Registered User
Posts: 79
Joined: Wed Oct 16, 2013 7:07 pm

Re: Error when changing css

by nlcaldwell » Tue Jul 28, 2015 2:08 pm

For anyone else with this error, change this line in blog/includes/functions.php:

Code: Select all

$matches = array('#/\*.+\*/#', '#<!--.+-->#', '$&#?([a-zA-Z0-9]+);?$', '$([^a-zA-Z0-9",\*+%!_\.#{}()/:;-\s])$');


Code: Select all

$matches = array('#/\*.+\*/#', '#<!--.+-->#', '$&#?([a-zA-Z0-9]+);?$', '$([^a-zA-Z0-9",\*+%!_\.#{}()/:;\-\s])$');

The problem is that the hyphen toward the end of the line is being interpreted as a character range rather than just a hyphen. Escaping it solves the issue.
Code is poetry.

Also, poetry is poetry.
User avatar
Registered User
Posts: 72
Joined: Fri Dec 24, 2004 2:35 pm
Location: Washington, DC