function wproSendCacheHeaders() { static $beenHere = 0; if (empty($beenHere) && !headers_sent()) { @wproCore::sendCacheHeaders(); } $beenHere++; }
function getEditorURL() { require_once WPRO_DIR . 'config.inc.php'; $EDITOR_URL = WPRO_EDITOR_URL; /* Routine for auto setting WPRO_EDITOR_URL, if this routine fails you will need to set it manually in the config file */ if (empty($EDITOR_URL)) { $wp_script_filename = isset($_SERVER["SCRIPT_FILENAME"]) ? str_replace(array('\\', '\\\\', '//'), '/', $_SERVER["SCRIPT_FILENAME"]) : str_replace(array('\\', '\\\\', '//'), '/', $_SERVER["PATH_TRANSLATED"]); $wp_script_name = $_SERVER["SCRIPT_NAME"]; $wp_dir_name = str_replace(array('\\', '\\\\', '//'), '/', WPRO_DIR); $EDITOR_URL = preg_replace('/^(.*?)' . str_replace('/', '\\/', quotemeta(preg_replace('/' . str_replace('/', '\\/', quotemeta($wp_script_name)) . '/i', '', $wp_script_filename))) . '/i', '', $wp_dir_name); //if (strtolower($EDITOR_URL) == strtolower($wp_dir_name)) {die('<div><b>WysiwygPro config error</b>: Could not auto-detect URL or wysiwygPro folder. You need to set the WPRO_EDITOR_URL constant in config.inc.php, or set the editorURL property when constructing the editor.</div>');} } $EDITOR_URL = wproCore::addTrailingSlash($EDITOR_URL); // web URL (strip out domain etc) if (preg_match('/^http(|s):\\/\\/.*?\\//si', $EDITOR_URL)) { $EDITOR_URL = preg_replace('/^http(|s):\\/\\/[^\\/]+/si', '', $EDITOR_URL); } return $EDITOR_URL; }