Title: Bug: ValueError: Unknown format specifier &#8220;C&#8221;
Last modified: January 9, 2022

---

# Bug: ValueError: Unknown format specifier “C”

 *  Resolved Anonymous User 18727274
 * (@anonymized-18727274)
 * [4 years, 5 months ago](https://wordpress.org/support/topic/t-valueerror-unknown-format-specifier-c/)
 * 2022-01-09T12:07:42+00:00 CRITICAL Uncaught ValueError: Unknown format specifier“
   C” in /home/xxx/public/wp-content/plugins/gutenslider/src/blocks/gutenslide/block-
   front.php:280
    Stack trace: #0 /home/xxx/public/wp-content/plugins/gutenslider/
   src/blocks/gutenslide/block-front.php(280): sprintf() #1 /home/xxx/public/wp-
   includes/class-wp-block.php(221): eedee_gutenslide_dynamic_render_callback() #
   2 /home/xxx/public/wp-includes/class-wp-block.php(211): WP_Block->render()
    -  This topic was modified 4 years, 5 months ago by Anonymous User 18727274.

Viewing 5 replies - 1 through 5 (of 5 total)

 *  Thread Starter Anonymous User 18727274
 * (@anonymized-18727274)
 * [4 years, 5 months ago](https://wordpress.org/support/topic/t-valueerror-unknown-format-specifier-c/#post-15232807)
 * the problem is that `$background_content` variable on line 276 is not escaped
   properly.
    -  This reply was modified 4 years, 5 months ago by Anonymous User 18727274.
 *  Plugin Contributor [Gutenberg Slider](https://wordpress.org/support/users/gutenbergslider/)
 * (@gutenbergslider)
 * [4 years, 5 months ago](https://wordpress.org/support/topic/t-valueerror-unknown-format-specifier-c/#post-15237401)
 * @dianfishekqi sorry for the issue. I assume you are trying to create a video 
   slide? Can you give more information, as we are not yet able to reproduce it,
   despite your help with the log. Also I assume you are using php8? We went over
   the lines 276, 280. Where do you see the not properly escaped variable? Maybe
   I am just blind?
 *  Thread Starter Anonymous User 18727274
 * (@anonymized-18727274)
 * [4 years, 5 months ago](https://wordpress.org/support/topic/t-valueerror-unknown-format-specifier-c/#post-15237441)
 * Hello there,
 * Yes I’m using php 8.0, I’ve encounter this issue when one of the colleagues edited
   a Gutenberg slider after that the edit page would throw a fatal error. He was
   working on some banners involving a sale therefore he might have used %.
 * I’ve noticed that `$background_content` is being concatenated here, after doing
   a naive escape with `str_replace('%','%%')` the page was restored which led me
   to believe that that was the problem.
 *     ```
       $background_div = sprintf(
                   '<div class="%2$s">'
                   .$background_content
                   . '<div class="eedee-background-div__overlay" style="%1$s"></div>'
                   . '</div>',
                   $background_overlay_style,
                   $background_classes
               );
       ```
   
 * WooCommerce log related with the incident:
    [https://pastebin.com/6gZ0YcxB](https://pastebin.com/6gZ0YcxB)
    -  This reply was modified 4 years, 5 months ago by Anonymous User 18727274.
 *  Thread Starter Anonymous User 18727274
 * (@anonymized-18727274)
 * [4 years, 4 months ago](https://wordpress.org/support/topic/t-valueerror-unknown-format-specifier-c/#post-15314672)
 * The same error happened again, I think $background_content is the culprit,
    changing
 *     ```
       $background_div = sprintf(
                   '<div class="%2$s">'
                   .$background_content
                   . '<div class="eedee-background-div__overlay" style="%1$s"></div>'
                   . '</div>',
                   $background_overlay_style,
                   $background_classes
               );
       ```
   
 * to
 *     ```
       $background_div = sprintf(
                   '<div class="%2$s">'
                   . '%3$s'
                   . '<div class="eedee-background-div__overlay" style="%1$s"></div>'
                   . '</div>',
                   $background_overlay_style,
                   $background_classes,
                   $background_content
               );
       ```
   
 * fixed the problem
 *  Plugin Contributor [Gutenberg Slider](https://wordpress.org/support/users/gutenbergslider/)
 * (@gutenbergslider)
 * [4 years, 4 months ago](https://wordpress.org/support/topic/t-valueerror-unknown-format-specifier-c/#post-15316411)
 * Oh sorry we did not get back to you again. We will fix it in the next release
   and thank you for the code fix.

Viewing 5 replies - 1 through 5 (of 5 total)

The topic ‘Bug: ValueError: Unknown format specifier “C”’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/gutenslider_814abc.svg)
 * [WordPress Slider Block Gutenslider](https://wordpress.org/plugins/gutenslider/)
 * [Support Threads](https://wordpress.org/support/plugin/gutenslider/)
 * [Active Topics](https://wordpress.org/support/plugin/gutenslider/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/gutenslider/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/gutenslider/reviews/)

 * 5 replies
 * 2 participants
 * Last reply from: [Gutenberg Slider](https://wordpress.org/support/users/gutenbergslider/)
 * Last activity: [4 years, 4 months ago](https://wordpress.org/support/topic/t-valueerror-unknown-format-specifier-c/#post-15316411)
 * Status: resolved