Plugin Directory

Changeset 3461042


Ignore:
Timestamp:
02/13/2026 08:21:31 PM (7 weeks ago)
Author:
seraphinitesoft
Message:

seraphinite-post-docx-source: 2.16.15.

Location:
seraphinite-post-docx-source
Files:
45 added
17 edited

Legend:

Unmodified
Added
Removed
  • seraphinite-post-docx-source/trunk/Cmn/Fs.php

    r3238125 r3461042  
    265265        'roff'    => 'application/x-troff',
    266266        'rpm'     => 'application/x-rpm',
     267        'rss'     => 'application/rss+xml',
    267268        'rtf'     => 'text/rtf',
    268269        'rtx'     => 'text/richtext',
  • seraphinite-post-docx-source/trunk/Cmn/Gen.js

    r3201981 r3461042  
    1010return d},DeepCopy:I,Extend:J,JsonParse:function(a){try{var b=JSON.parse(a)}catch(c){}return b},RegExpFromStr:function(a){var b=a.match(/^([\/~@;%#'])(.*?)\1([gimsuy]*)$/);return b?new RegExp(b[2],b[3].split("").filter(function(c,d,h){return h.indexOf(c)===d}).join("")):new RegExp(a)},GetObjField:D,SetObjField:function(a,b,c){var d=b.split(3<arguments.length&&void 0!==arguments[3]?arguments[3]:".");if(d.length){for(var h=0;h<d.length-1;h++){var n=d[h];a[n]||(a[n]=h+1<d.length&&"+"==d[h+1]||"string"!==
    1111typeof n?[]:{});a=a[n]}n=d[d.length-1];"+"==n?"function"===typeof a.push&&a.push(c):a[n]=c}},GetObjContId:function(a){return E(JSON.stringify(a),'true false { } " : ,'.split(" "),"1      ".split(" "))},AsyncChain:function(){return new Promise(function(a,b){a()})},RunModules:K,EvalInCtx:function(a,b){if(a)return function(){return eval(a)}.call(b)},hr:{SEVERITY_SUCCESS:0,SEVERITY_ERROR:1,FACILITY_INTERNET:12,FACILITY_HTTP:25,S_OK:0,S_FALSE:1,S_FAIL:16389,S_ABORTED:459975,E_NOTIMPL:2147500033,E_FAIL:2147500037,
    12 E_UNSUPPORTED:2147500065,E_INVALIDARG:2147942487,E_INVALID_STATE:2147947423,E_INTERNAL:2147943759,E_DATACORRUPTED:2147943792,E_NOT_FOUND:2147943568,E_ACCESS_DENIED:2147942405,E_ABORTED:2147943623,Make:function(a,b,c){return a<<31|b<<16|c&65535},Code:function(a){return a&65535},Facility:function(a){return a>>16&8191},Succ:function(a){return!(a&2147483648)},Fail:function(a){return!!(a&2147483648)}}};seraph_pds.Plugin={GetErrorDescr:function(a){var b=1<arguments.length&&void 0!==arguments[1]?arguments[1]:
    13 null,c=2<arguments.length&&void 0!==arguments[2]?arguments[2]:!1,d=seraph_pds.Wp.Loc.GetApi(),h=d._x;d=d.sprintf;var n=d("Err_%08X",a),q=c&&seraph_pds.Gen.hr.Succ(a)?d("Err_%08X",seraph_pds.Gen.hr.Make(seraph_pds.Gen.hr.SEVERITY_ERROR,seraph_pds.Gen.hr.Facility(a),a)):null;c=[];b&&(c.push({id:n,ctx:b}),q&&c.push({id:q,ctx:b}));c.push({id:n,ctx:"admin.ErrDescr_Common"});q&&c.push({id:q,ctx:"admin.ErrDescr_Common"});c.push({id:"Def_%08X",ctx:"admin.ErrDescr_Common"});for(var y in c)if(q=c[y],b=q.id,
    14 q=d(h(b,q.ctx,"seraphinite-post-docx-source"),a),q!=b)return q;return n},GetRootUrl:function(){return this._int.urlRoot},GetAdminApiUrl:function(){return this._int.urlAdminApi},GetApiUrl:function(){return this._int.urlApi},_int:{urlRoot:"",urlAdminApi:"",urlApi:""}};seraph_pds.Wp={Loc:{GetApi:function(){var a=null;a=window.wp&&window.wp.i18n?window.wp.i18n:{__:function(b,c){return seraph_pds.Wp.Loc._int.dcnpgettext(c,void 0,b)},_x:function(b,c,d){return seraph_pds.Wp.Loc._int.dcnpgettext(d,c,b)},
    15 _n:function(b,c,d,h){return seraph_pds.Wp.Loc._int.dcnpgettext(h,void 0,b,c,d)},_nx:function(b,c,d,h,n){return seraph_pds.Wp.Loc._int.dcnpgettext(n,h,b,c,d)},sprintf:seraph_pds.Wp.Loc._int.sprintf};a.vsprintf||(a.vsprintf=function(b,c){return a.sprintf.apply(null,[b].concat(c||[]))});return a},SetData:function(a,b){return window.wp&&window.wp.i18n?window.wp.i18n.setLocaleData(a,b):seraph_pds.Wp.Loc._int.setLocaleData(a,b)},GetLang:function(){return seraph_pds.Wp.Loc._int.lang}}};(function(){function a(f){for(var g=
     12E_UNSUPPORTED:2147500065,E_INVALIDARG:2147942487,E_INVALID_STATE:2147947423,E_INTERNAL:2147943759,E_DATACORRUPTED:2147943792,E_NOT_FOUND:2147943568,E_ACCESS_DENIED:2147942405,E_ABORTED:2147943623,E_CONTEXT_EXPIRED:2147944331,Make:function(a,b,c){return a<<31|b<<16|c&65535},Code:function(a){return a&65535},Facility:function(a){return a>>16&8191},Succ:function(a){return!(a&2147483648)},Fail:function(a){return!!(a&2147483648)}}};seraph_pds.Plugin={GetErrorDescr:function(a){var b=1<arguments.length&&
     13void 0!==arguments[1]?arguments[1]:null,c=2<arguments.length&&void 0!==arguments[2]?arguments[2]:!1,d=seraph_pds.Wp.Loc.GetApi(),h=d._x;d=d.sprintf;var n=d("Err_%08X",a),q=c&&seraph_pds.Gen.hr.Succ(a)?d("Err_%08X",seraph_pds.Gen.hr.Make(seraph_pds.Gen.hr.SEVERITY_ERROR,seraph_pds.Gen.hr.Facility(a),a)):null;c=[];b&&(c.push({id:n,ctx:b}),q&&c.push({id:q,ctx:b}));c.push({id:n,ctx:"admin.ErrDescr_Common"});q&&c.push({id:q,ctx:"admin.ErrDescr_Common"});c.push({id:"Def_%08X",ctx:"admin.ErrDescr_Common"});
     14for(var y in c)if(q=c[y],b=q.id,q=d(h(b,q.ctx,"seraphinite-post-docx-source"),a),q!=b)return q;return n},GetRootUrl:function(){return this._int.urlRoot},GetAdminApiUrl:function(){return this._int.urlAdminApi},GetApiUrl:function(){return this._int.urlApi},_int:{urlRoot:"",urlAdminApi:"",urlApi:""}};seraph_pds.Wp={Loc:{GetApi:function(){var a=null;a=window.wp&&window.wp.i18n?window.wp.i18n:{__:function(b,c){return seraph_pds.Wp.Loc._int.dcnpgettext(c,void 0,b)},_x:function(b,c,d){return seraph_pds.Wp.Loc._int.dcnpgettext(d,
     15c,b)},_n:function(b,c,d,h){return seraph_pds.Wp.Loc._int.dcnpgettext(h,void 0,b,c,d)},_nx:function(b,c,d,h,n){return seraph_pds.Wp.Loc._int.dcnpgettext(n,h,b,c,d)},sprintf:seraph_pds.Wp.Loc._int.sprintf};a.vsprintf||(a.vsprintf=function(b,c){return a.sprintf.apply(null,[b].concat(c||[]))});return a},SetData:function(a,b){return window.wp&&window.wp.i18n?window.wp.i18n.setLocaleData(a,b):seraph_pds.Wp.Loc._int.setLocaleData(a,b)},GetLang:function(){return seraph_pds.Wp.Loc._int.lang}}};(function(){function a(f){for(var g=
    1616[],k=[],m,p,e;m=f.match(v);){p=m[0];for((e=f.substr(0,m.index).trim())&&g.push(e);e=k.pop();){if(y[p]){if(y[p][0]===e){p=y[p][1]||p;break}}else if(0<=q.indexOf(e)||n[e]<n[p]){k.push(e);break}g.push(e)}y[p]||k.push(p);f=f.substr(m.index+p.length)}(f=f.trim())&&g.push(f);return g.concat(k.reverse())}function b(f){var g=a(f);return function(k){a:{var m=[],p,e;for(p=0;p<g.length;p++){var u=g[p];if(e=B[u])try{var t=e.apply(null,m.splice(-1*e.length))}catch(l){k=l;break a}else t=k.hasOwnProperty(u)?k[u]:
    1717+u;m.push(t)}k=m[0]}return k}}function c(f){var g=b(f);return function(k){return+g({n:k})}}function d(f){var g=f;if(z[g])g=z[g];else{for(var k=g,m,p=[],e=0;k;){if(null!==(m=r.text.exec(k)))p.push(m[0]);else if(null!==(m=r.modulo.exec(k)))p.push("%");else if(null!==(m=r.placeholder.exec(k))){if(m[2]){e|=1;var u=[],t=m[2],l;if(null!==(l=r.key.exec(t)))for(u.push(l[1]);""!==(t=t.substring(l[0].length));)if(null!==(l=r.key_access.exec(t)))u.push(l[1]);else if(null!==(l=r.index_access.exec(t)))u.push(l[1]);
  • seraphinite-post-docx-source/trunk/Cmn/Gen.php

    r3238125 r3461042  
    108108    }
    109109
     110    static function NullIfEmpty( $v )
     111    {
     112        return( empty( $v ) ? null : $v );
     113    }
     114
    110115    static function NormArrFieldKey( $key )
    111116    {
     
    183188            $fieldPath = explode( $sep, $fieldPath );
    184189        self::_SetArrField( $arr, $fieldPath, null, true );
     190    }
     191
     192    static function RenameArrField( &$arr, $fieldPath, $fieldPathNew, $sep = '.' )
     193    {
     194        if( !is_array( $fieldPath ) )
     195            $fieldPath = explode( $sep, $fieldPath );
     196        if( !is_array( $fieldPathNew ) )
     197            $fieldPathNew = explode( $sep, $fieldPathNew );
     198
     199        $v = self::_GetArrField( $arr, $fieldPath, null, false, true, $bFound );
     200        if( !$bFound )
     201            return;
     202
     203        self::_SetArrField( $arr, $fieldPath, null, true );
     204        self::_SetArrField( $arr, $fieldPathNew, $v );
    185205    }
    186206
     
    503523    }
    504524
     525    const HTACCESS_SOFT_NAME = 0;
     526    const HTACCESS_SOFT_VER = 1;
     527    const HTACCESS_SOFT_SUBNAME = 2;
     528
    505529    static function HtAccess_IsSupported()
    506530    {
    507531
    508         return( !!Gen::CallFunc( 'apache_get_version' ) || preg_match( '@apache@i', isset( $_SERVER[ 'SERVER_SOFTWARE' ] ) ? $_SERVER[ 'SERVER_SOFTWARE' ] : '' ) || preg_match( '@litespeed@i', isset( $_SERVER[ 'SERVER_SOFTWARE' ] ) ? $_SERVER[ 'SERVER_SOFTWARE' ] : '' ) );
     532        $sVer = Gen::CallFunc( 'apache_get_version' );
     533        if( !$sVer )
     534            $sVer = (isset($_SERVER[ 'SERVER_SOFTWARE' ])?$_SERVER[ 'SERVER_SOFTWARE' ]:null);
     535
     536        if( !is_string( $sVer ) )
     537            return( false );
     538
     539        if( !preg_match( '@(apache|litespeed)(?:/([\\d\\.]+))?@i', $sVer, $m ) )
     540            return( false );
     541
     542        $res = array( Gen::HTACCESS_SOFT_NAME => strtolower( $m[ 1 ] ), Gen::HTACCESS_SOFT_VER => (isset($m[ 2 ])?$m[ 2 ]:'0') );
     543        if( preg_match( '@IdeaWebServer@i', $sVer ) )
     544            $res[ Gen::HTACCESS_SOFT_SUBNAME ] = 'ideawebserver';
     545        return( $res );
    509546    }
    510547
     
    825862    static private function _FileOpen( $filename, $mode, $use_include_path = false )
    826863    {
     864
    827865        if( strpos( $mode, 'r' ) !== false && !@file_exists( $filename ) )
     866            return( false );
     867        if( strpos( $mode, 'x' ) !== false && @file_exists( $filename ) )
    828868            return( false );
    829869
     
    9831023    }
    9841024
     1025    static function FileGetContents( $file )
     1026    {
     1027        return( @file_exists( $file ) ? @file_get_contents( $file ) : false );
     1028    }
     1029
     1030    static function FilePutContents( $file, $data )
     1031    {
     1032        if( is_dir( $file ) )
     1033            Gen::DelDir( $file );
     1034        return( @file_put_contents( $file, $data ) );
     1035    }
     1036
    9851037    static function SetLastSlash( $filepath, $set = true, $slash = '/' )
    9861038    {
     
    10611113    }
    10621114
    1063     static function StrStartsWith( string $haystack, $needle )
     1115    static function StrStartsWith( string $haystack, $needle, &$needleKey = null )
    10641116    {
    10651117        if( is_string( $needle ) )
     
    10701122        }
    10711123
    1072         foreach( $needle as $needleEl )
     1124        foreach( $needle as $k => $needleEl )
    10731125            if( Gen::StrStartsWith( $haystack, $needleEl ) )
     1126            {
     1127                $needleKey = $k;
    10741128                return( true );
     1129            }
    10751130
    10761131        return( false );
    10771132    }
    10781133
    1079     static function StrEndsWith( string $haystack, $needle )
     1134    static function StrEndsWith( string $haystack, $needle, &$needleKey = null )
    10801135    {
    10811136        if( is_string( $needle ) )
     
    10861141        }
    10871142
    1088         foreach( $needle as $needleEl )
     1143        foreach( $needle as $k => $needleEl )
    10891144            if( Gen::StrEndsWith( $haystack, $needleEl ) )
     1145            {
     1146                $needleKey = $k;
    10901147                return( true );
     1148            }
    10911149
    10921150        return( false );
     
    12631321    }
    12641322
     1323    static function ArrMap( array $arr, $cbItem )
     1324    {
     1325        $a = array();
     1326        foreach( $arr as $k => $v )
     1327            $a[] = call_user_func_array( $cbItem, array( $k, $v ) );
     1328        return( $a );
     1329    }
     1330
    12651331    static function GetCurRequestTime( $serverArgs = null )
    12661332    {
     
    13761442        flush();
    13771443
    1378         error_reporting( E_ERROR | E_PARSE | E_CORE_ERROR | E_COMPILE_ERROR | E_USER_ERROR | E_RECOVERABLE_ERROR );
    1379 
    13801444        return( Gen::CloseCurRequestSessionForContinueBgWorkEx() );
    13811445    }
     
    14101474            $fileHtaccess = Gen::GetFileDir( $file ) . '/.htaccess';
    14111475            if( !@file_exists( $fileHtaccess ) )
     1476            {
     1477                Gen::MakeDir( Gen::GetFileDir( $file ), true );
    14121478                @file_put_contents( $fileHtaccess, 'Options -Indexes' );
     1479            }
    14131480        }
    14141481
     
    16071674    }
    16081675
    1609     static function GetCallStack( $options = DEBUG_BACKTRACE_PROVIDE_OBJECT, $limit = 0 )
    1610     {
    1611         $a = @debug_backtrace( ( int )$options, ( int )$limit );
     1676    const GETCALLSTACK_OPT_AS_ARRAY             = 0x80;
     1677    const GETCALLSTACK_OPT_ALL                  = Gen::GETCALLSTACK_OPT_AS_ARRAY;
     1678
     1679    static function GetCallStack( $options = DEBUG_BACKTRACE_PROVIDE_OBJECT , $limit = 0 )
     1680    {
     1681        $a = @debug_backtrace( ( ( int )$options & ~Gen::GETCALLSTACK_OPT_ALL ), ( int )$limit );
    16121682        array_splice( $a, 0, 1 );
    16131683
    1614         $res = '';
     1684        $res = ( $options & Gen::GETCALLSTACK_OPT_AS_ARRAY ) ? array() : '';
    16151685        foreach( $a as $i => $info )
    16161686        {
    1617             if( $res )
    1618                 $res .= "\n";
    1619 
    1620             $res .= '#' . $i . ' ';
     1687            $r = '';
     1688            if( !( $options & Gen::GETCALLSTACK_OPT_AS_ARRAY ) )
     1689                $r = '#' . $i . ' ';
     1690
    16211691            if( (isset($info[ 'file' ])?$info[ 'file' ]:null) )
    1622                 $res .= $info[ 'file' ];
     1692                $r .= $info[ 'file' ];
    16231693            else
    1624                 $res .= '{}';
     1694                $r .= '{}';
    16251695            if( (isset($info[ 'line' ])?$info[ 'line' ]:null) !== null )
    1626                 $res .= '(' . $info[ 'line' ] . ')';
    1627 
    1628             $res .= ': ';
     1696                $r .= '(' . $info[ 'line' ] . ')';
     1697
     1698            $r .= ': ';
    16291699
    16301700            if( (isset($info[ 'class' ])?$info[ 'class' ]:null) )
    1631                 $res .= $info[ 'class' ];
     1701                $r .= $info[ 'class' ];
    16321702            if( (isset($info[ 'type' ])?$info[ 'type' ]:null) )
    1633                 $res .= $info[ 'type' ];
    1634             $res .= Gen::GetArrField( $info, array( 'function' ), '' ) . '(';
     1703                $r .= $info[ 'type' ];
     1704            $r .= Gen::GetArrField( $info, array( 'function' ), '' ) . '(';
    16351705
    16361706            foreach( Gen::GetArrField( $info, array( 'args' ), array() ) as $iArg => $arg )
    16371707            {
    16381708                if( $iArg )
    1639                     $res .= ', ';
    1640                 $res .= str_replace( array( '\\\\', '\\/' ), array( '\\', '/' ), @json_encode( $arg ) );
    1641             }
    1642             $res .= ')';
     1709                    $r .= ', ';
     1710                $r .= str_replace( array( '\\\\', '\\/' ), array( '\\', '/' ), @json_encode( $arg ) );
     1711            }
     1712            $r .= ')';
     1713
     1714            if( $options & Gen::GETCALLSTACK_OPT_AS_ARRAY )
     1715                $res[] = $r;
     1716            else
     1717            {
     1718                if( $res )
     1719                    $res .= "\n";
     1720                $res .= $r;
     1721            }
    16431722        }
    16441723
     
    16581737                if( $sQuote === '' )
    16591738                    $sQuote = $c;
    1660                 else if( $sQuote === $c && $cPrev !== '\\' )
    1661                     $sQuote = '';
     1739                else if( $sQuote === $c )
     1740                {
     1741                    if( $cPrev !== '\\' )
     1742                        $sQuote = '';
     1743                    else if( $c === '\'' )
     1744                        $data[ $i ] = "\x02";
     1745                }
     1746                else
     1747                {
     1748                    if( $c === '\'' )
     1749                        $data[ $i ] = "\x02";
     1750                    else if( $c === '"' && $cPrev !== '\\' )
     1751                        $data[ $i ] = "\x03";
     1752                }
     1753
    16621754                continue;
    16631755            }
     
    16701762        $data = preg_replace( '@([\'"}])\\s*,\\s*}@', '$1}', $data );
    16711763        $data = str_replace( array( "\t", "\r", "\n" ), ' ', $data );
    1672         $data = str_replace( "\x01", ':', $data );
     1764        $data = str_replace( array( "\x01", "\x02", "\x03" ), array( ':', '\'', '\\"' ), $data );
    16731765        return( $data );
    16741766    }
    16751767
    1676     static function JsonGetEndPos( $posStart, $data )
    1677     {
     1768    static function JsonGetStartEndPos( $pos, $data, $dir = 1 )
     1769    {
     1770        $l = strlen( $data );
     1771        if( !$l )
     1772            return( null );
     1773
     1774        $aScp = null;
     1775        switch( $data[ $pos ] )
     1776        {
     1777            case '{':   $aScp = array( '{', '}' ); break;
     1778            case '[':   $aScp = array( '[', ']' ); break;
     1779            case '"':   $aScp = array( '"', '"' ); break;
     1780            case '\'':  $aScp = array( '\'', '\'' ); break;
     1781        }
     1782
     1783        if( !$aScp )
     1784            return( null );
     1785
    16781786        $n = 0;
    1679         for( $pos = $posStart; $pos < strlen( $data ); $pos++ )
    1680         {
    1681             if( $data[ $pos ] == '{' )
     1787        for( ; $pos < $l && $pos >= 0; $pos += $dir )
     1788        {
     1789            if( $pos > 0 && $data[ $pos - 1 ] == '\\' )
     1790                continue;
     1791
     1792            if( $data[ $pos ] == $aScp[ 0 ] && ( !$n || $aScp[ 0 ] != $aScp[ 1 ] ) )
    16821793                $n++;
    1683             else if( $data[ $pos ] == '}' )
     1794            else if( $data[ $pos ] == $aScp[ 1 ] )
    16841795            {
    16851796                $n--;
     
    16891800        }
    16901801
    1691         return( $n ? null : ( $pos + 1 ) );
     1802        return( $n ? null : ( $pos + ( $dir > 0 ? 1 : 0 ) ) );
     1803    }
     1804
     1805    static function JsonGetEndPos( $posStart, $data )
     1806    {
     1807        return( Gen::JsonGetStartEndPos( $posStart, $data, 1 ) );
     1808    }
     1809
     1810    static function JsonGetStartPos( $posEnd, $data )
     1811    {
     1812        return( Gen::JsonGetStartEndPos( $posEnd, $data, -1 ) );
    16921813    }
    16931814
    16941815    static function VarCmp( $v1, $v2 )
    16951816    {
    1696         if( $v1 < $v2 )
    1697             return( -1 );
    1698         if( $v1 > $v2 )
    1699             return( 1 );
    1700         return( 0 );
     1817        if( $v1 == $v2 )
     1818            return( 0 );
     1819        return( $v1 > $v2 ? 1 : -1 );
    17011820    }
    17021821
     
    17061825        $fmt[ 'indent' ] = Gen::GetArrField( $fmt, array( 'indent' ), "\t" );
    17071826        $fmt[ 'elemSpace' ] = Gen::GetArrField( $fmt, array( 'elemSpace' ), "\n" );
     1827        $fmt[ 'assignSpaceBefore' ] = Gen::GetArrField( $fmt, array( 'assignSpaceBefore' ), ' ' );
     1828        $fmt[ 'assignSpaceAfter' ] = Gen::GetArrField( $fmt, array( 'assignSpaceAfter' ), ' ' );
     1829        $fmt[ 'escValNl' ] = Gen::GetArrField( $fmt, array( 'escValNl' ), false );
    17081830        return( self::_VarExport( $v, $fmt, $level ) );
    17091831    }
     
    17171839        case 'integer':
    17181840            return( ( string )$v );
    1719         case 'string':
    1720             return( '\'' . str_replace( array( '\\', '\'' ), array( '\\\\', '\\\'' ), $v ) . '\'' );
    17211841        case 'double':
    17221842            return( preg_replace( '@([^\\.])0+$@', '${1}', sprintf( '%.' . ( string )$fmt[ 'floatPrec' ] . 'F', $v ) ) );
     1843
     1844        case 'string':
     1845            $v = json_encode( $v, JSON_UNESCAPED_SLASHES );
     1846            $v = str_replace( array( '${' ), array( '\\${' ), $v );
     1847            return( $v );
    17231848
    17241849        case 'array':
    17251850            $res = 'array(' . $fmt[ 'elemSpace' ];
    17261851            foreach( $v as $k => $vI )
    1727                 $res .= str_repeat( $fmt[ 'indent' ], $level + 1 ) . self::_VarExport( $k, $fmt ) . ' => ' . self::_VarExport( $vI, $fmt, $level + 1 ) . ',' . $fmt[ 'elemSpace' ];
     1852                $res .= str_repeat( $fmt[ 'indent' ], $level + 1 ) . self::_VarExport( $k, $fmt ) . $fmt[ 'assignSpaceBefore' ] . '=>' . $fmt[ 'assignSpaceAfter' ] . self::_VarExport( $vI, $fmt, $level + 1 ) . ',' . $fmt[ 'elemSpace' ];
    17281853            $res .= str_repeat( $fmt[ 'indent' ], $level ) . ')';
    17291854            return( $res );
    17301855
    17311856        case 'object':
    1732             return( ( string )$v );
     1857            return( self::_VarExport( ( array )$v, $fmt, $level ) );
    17331858        }
    17341859
     
    18601985    }
    18611986
     1987    static function Constant( string $name, $def = null )
     1988    {
     1989        return( defined( $name ) ? @constant( $name ) : $def );
     1990    }
     1991
    18621992    static private $_lastErrDsc = null;
    18631993    static private $_fnGetTmpDir = null;
     
    20342164    function GetErrDescr()
    20352165    {
     2166
    20362167        $dir = Gen::GetFileDir( $this -> file );
    20372168        return( @is_writable( $dir ) ? LocId::Pack( 'FileModifyErr_%1$s', 'Common', array( $this -> file ) ) : LocId::Pack( 'DirWriteErr_%1$s', 'Common', array( $dir ) ) );
     
    31713302    }
    31723303
     3304    static function GetHeaderFromWpRemoteRequestRes( $requestRes, $name )
     3305    {
     3306        $hdr = wp_remote_retrieve_header( $requestRes, $name );
     3307        if( is_array( $hdr ) )
     3308            $hdr = (isset($hdr[ 0 ])?$hdr[ 0 ]:null);
     3309        return( is_string( $hdr ) ? $hdr : '' );
     3310    }
     3311
    31733312    static function GetSiteAddrFromUrl( $url, $withScheme = false )
    31743313    {
     
    33043443    {
    33053444        $args = array();
    3306         @parse_str( $query, $args );
     3445        @parse_str( ( string )$query, $args );
    33073446        return( $args );
    33083447    }
     
    35123651        if( !isset( $args[ 'provider' ] ) )
    35133652            $args[ 'provider' ] = 'CURL';
    3514         if( !isset( $args[ 'useragent' ] ) )
    3515             $args[ 'useragent' ] = 'seraph-pds-Agent/2.16.14';
     3653        if( !isset( $args[ 'user-agent' ] ) )
     3654            $args[ 'user-agent' ] = 'seraph-pds-Agent/2.16.15';
    35163655        if( !isset( $args[ 'timeout' ] ) )
    35173656            $args[ 'timeout' ] = 5;
     
    35293668        if( $method === 'POST' )
    35303669            curl_setopt( $hCurl, CURLOPT_POST, true );
    3531         curl_setopt( $hCurl, CURLOPT_USERAGENT, $args[ 'useragent' ] );
     3670        curl_setopt( $hCurl, CURLOPT_USERAGENT, $args[ 'user-agent' ] );
    35323671        if( isset( $args[ 'referer' ] ) )
    35333672            curl_setopt( $hCurl, CURLOPT_REFERER, $args[ 'referer' ] );
     
    37893928    {
    37903929        if( !$children )
    3791             return( $children );
     3930            return( array() );
    37923931
    37933932        if( $children -> length !== 1 )
     
    39624101    }
    39634102
     4103    static function Append( $nd, $ndChild )
     4104    {
     4105        if( !$nd || !$ndChild )
     4106            return( false );
     4107
     4108        if( is_array( $ndChild ) )
     4109        {
     4110            foreach( $ndChild as $ndChildI )
     4111                $nd -> appendChild( $ndChildI );
     4112        }
     4113        else
     4114            $nd -> appendChild( $ndChild );
     4115
     4116        return( true );
     4117    }
     4118
    39644119    static function GetAttrNode( $nd, $name )
    39654120    {
     
    40164171            return( false );
    40174172
    4018         $val = HtmlNd::GetAttrClass( $nd );
    4019 
    4020         if( !is_array( $valClasses ) )
    4021             $valClasses = explode( ' ', @trim( $valClasses ) );
    4022 
    4023         if( !is_array( $valClassesRemove ) )
    4024             $valClassesRemove = explode( ' ', @trim( $valClassesRemove ) );
    4025 
    4026         foreach( $valClasses as $valClass )
    4027             if( strlen( ( string )$valClass ) && !in_array( $valClass, $val ) )
    4028                 $val[] = $valClass;
    4029 
    4030         foreach( $valClassesRemove as $valClassRemove )
    4031             while( ( $i = array_search( $valClassRemove, $val ) ) !== false )
    4032                 unset( $val[ $i ] );
    4033 
    4034         $val = implode( ' ', $val );
     4173        $val = Ui::AddRemoveAttrClass( $nd -> getAttribute( 'class' ), $valClasses, $valClassesRemove );
    40354174        if( strlen( $val ) )
    40364175            $nd -> setAttribute( 'class', $val );
     
    42444383        if( $aChildren )
    42454384            foreach( $aChildren as $child )
    4246                 $nd -> appendChild( $child );
     4385                if( $child )
     4386                    $nd -> appendChild( $child );
    42474387
    42484388        return( $nd );
     
    46254765                $bracketsLevel--;
    46264766                if( $bracketsLevel == 0 )
     4767                {
     4768                    $pos++;
    46274769                    break;
     4770                }
    46284771            }
    46294772
     
    46444787
    46454788        return( $res );
    4646     }
    4647 
    4648     static function File_SetDefineVal( $file, $name, $val )
    4649     {
    4650         if( !file_exists( $file ) )
    4651             return( Gen::E_NOT_FOUND );
    4652 
    4653         if( !is_writable( $file ) )
    4654             return( Gen::E_ACCESS_DENIED );
    4655 
    4656         $fileContent = file_get_contents( $file );
    4657         if( !$fileContent )
    4658             return( Gen::E_ACCESS_DENIED );
    4659 
    4660         if( !function_exists( 'token_get_all' ) )
    4661         {
    4662             if( !Gen::StrStartsWith( $fileContent, '<?php' ) )
    4663                 return( Gen::S_FALSE );
    4664 
    4665             $fileContent = "<?php\ndefine( '" . $name . "', " . var_export( $val, true ) . " );\n" . substr( $fileContent, 5 );
    4666         }
    4667         else if( !Php::Content_SetDefineVal( $fileContent, $name, $val ) )
    4668             return( Gen::S_FALSE );
    4669 
    4670         if( !is_integer( file_put_contents( $file, $fileContent, LOCK_EX ) ) )
    4671             return( Gen::E_FAIL );
    4672 
    4673         return( Gen::S_OK );
    4674     }
    4675 
    4676     static function Content_SetDefineVal( &$fileContent, $name, $val )
    4677     {
    4678         $tokens = Php::Tokens_GetFromContent( $fileContent );
    4679         if( $tokens === false )
    4680             return( false );
    4681 
    4682         if( !Php::Tokens_SetDefineVal( $tokens, $name, $val ) )
    4683             return( false );
    4684 
    4685         $fileContent = Php::Tokens_GetContent( $tokens );
    4686         return( true );
    4687     }
    4688 
    4689     static function Tokens_SetDefineVal( &$tokens, $name, $val )
    4690     {
    4691 
    4692         $firstInsertPos = Php::Tokens_Find( $tokens, T_OPEN_TAG );
    4693         if( $firstInsertPos === false )
    4694         {
    4695             $tokensInsert = array();
    4696             $tokensInsert[] = array( Php::TI_ID => T_OPEN_TAG, Php::TI_CONTENT => Php::T_OPEN_TAG_CONTENT );
    4697             $tokensInsert[] = array( Php::TI_ID => T_WHITESPACE, Php::TI_CONTENT => PHP_EOL . PHP_EOL );
    4698 
    4699             Php::Tokens_Insert( $tokens, count( $tokens ), $tokensInsert );
    4700 
    4701             $firstInsertPos = count( $tokens );
    4702         }
    4703         else
    4704         {
    4705             $firstInsertPos++;
    4706 
    4707             $firstInsertPos = Php::Tokens_Find( $tokens, array( 'e' => array( T_WHITESPACE ) ), null, $firstInsertPos );
    4708             if( $firstInsertPos === false )
    4709                 $firstInsertPos = count( $tokens );
    4710         }
    4711 
    4712         $defineValPos = false;
    4713         for( $i = $firstInsertPos; ; )
    4714         {
    4715             $i = Php::Tokens_Find( $tokens, T_STRING, 'define', $i );
    4716             if( $i === false )
    4717                 break;
    4718             $i++;
    4719 
    4720             $callArgs = Php::Tokens_GetCallArgs( $tokens, $i );
    4721             if( empty( $callArgs ) || count( $callArgs ) != 2 )
    4722                 continue;
    4723 
    4724             if( Php::Token_GetEncapsedStrVal( Php::Token_GetContent( Php::Tokens_CallArgs_GetSingleArg( $callArgs, 0 ), T_CONSTANT_ENCAPSED_STRING ) ) != $name )
    4725                 continue;
    4726 
    4727             Php::Tokens_CallArgs_GetSingleArg( $callArgs, 1, $defineValPos );
    4728             break;
    4729         }
    4730 
    4731         $changed = false;
    4732 
    4733         if( $defineValPos === false )
    4734         {
    4735             $tokensInsert = array();
    4736             $tokensInsert[] = array( Php::TI_ID => T_STRING, Php::TI_CONTENT => 'define' );
    4737             $tokensInsert[] = array( Php::TI_ID => T_ELEMENT, Php::TI_CONTENT => '(' );
    4738             $tokensInsert[] = array( Php::TI_ID => T_CONSTANT_ENCAPSED_STRING, Php::TI_CONTENT => '\'' . $name . '\'' );
    4739             $tokensInsert[] = array( Php::TI_ID => T_ELEMENT, Php::TI_CONTENT => ',' );
    4740             $tokensInsert[] = array( Php::TI_ID => T_WHITESPACE, Php::TI_CONTENT => ' ' );
    4741 
    4742             {
    4743                 $defineValPos = count( $tokensInsert );
    4744                 $tokensInsert[] = array( Php::TI_ID => T_CONSTANT_ENCAPSED_STRING, Php::TI_CONTENT => '\'\'' );
    4745             }
    4746 
    4747             $tokensInsert[] = array( Php::TI_ID => T_ELEMENT, Php::TI_CONTENT => ')' );
    4748             $tokensInsert[] = array( Php::TI_ID => T_ELEMENT, Php::TI_CONTENT => ';' );
    4749             $tokensInsert[] = array( Php::TI_ID => T_WHITESPACE, Php::TI_CONTENT => PHP_EOL . PHP_EOL );
    4750 
    4751             Php::Tokens_Insert( $tokens, $firstInsertPos, $tokensInsert );
    4752             $defineValPos += $firstInsertPos;
    4753 
    4754             $changed = true;
    4755         }
    4756 
    4757         {
    4758 
    4759             $tokenValNew = null;
    4760             switch( gettype( $val ) )
    4761             {
    4762             case 'string':
    4763                 $token = $tokens[ $defineValPos ];
    4764 
    4765                 $cQuote = null;
    4766                 if( $token[ Php::TI_ID ] == T_CONSTANT_ENCAPSED_STRING )
    4767                     $cQuote = substr( $token[ Php::TI_CONTENT ], 0, 1 );
    4768 
    4769                 if( empty( $cQuote ) )
    4770                     $cQuote = '\'';
    4771 
    4772                 $tokenValNew = array( Php::TI_ID => T_CONSTANT_ENCAPSED_STRING, Php::TI_CONTENT => $cQuote . $val . $cQuote );
    4773                 break;
    4774 
    4775             case 'boolean':
    4776                 $tokenValNew = array( Php::TI_ID => T_STRING, Php::TI_CONTENT => $val ? 'true' : 'false' );
    4777                 break;
    4778 
    4779             case 'integer':
    4780                 $tokenValNew = array( Php::TI_ID => T_LNUMBER, Php::TI_CONTENT => '' . $val );
    4781                 break;
    4782 
    4783             case 'double':
    4784                 $tokenValNew = array( Php::TI_ID => T_DNUMBER, Php::TI_CONTENT => '' . $val );
    4785                 break;
    4786 
    4787             default:
    4788                 return( false );
    4789                 break;
    4790             }
    4791 
    4792             if( $tokens[ $defineValPos ] != $tokenValNew )
    4793             {
    4794                 $tokens[ $defineValPos ] = $tokenValNew;
    4795                 $changed = true;
    4796             }
    4797         }
    4798 
    4799         return( true );
    48004789    }
    48014790}
     
    49884977    }
    49894978
    4990     static function GetSiteId( $mode = null )
    4991     {
    4992         if( $mode === 'OLD' )
     4979    static function GetSiteId( $ver = 2 )
     4980    {
     4981        if( $ver === null )
    49934982            $siteUrl = Wp::GetSiteWpRootUrl();
     4983        else if( $ver === 1 )
     4984            $siteUrl = Wp::GetSiteRootUrl( '', 'base' );
    49944985        else
    4995             $siteUrl = Wp::GetSiteRootUrl( '', 'base' );
     4986            $siteUrl = Wp::GetSiteRootUrl();
    49964987
    49974988        $siteUrlParts = @parse_url( $siteUrl );
     
    50915082
    50925083                $obj -> headers_sent = ( array )$headers;
    5093                 if( isset( $options[ 'useragent' ] ) )
    5094                     $obj -> headers_sent[ 'User-Agent' ] = $options[ 'useragent' ];
     5084                if( isset( $options[ 'user-agent' ] ) )
     5085                    $obj -> headers_sent[ 'User-Agent' ] = $options[ 'user-agent' ];
    50955086            };
    50965087
     
    65046495        return( get_home_path() );
    65056496    }
     6497
     6498    static function _Cfg_Tokens_SetDefineVal( &$tokens, $name, $val )
     6499    {
     6500
     6501        $firstInsertPos = Php::Tokens_Find( $tokens, T_OPEN_TAG );
     6502        if( $firstInsertPos === false )
     6503        {
     6504            $tokensInsert = array();
     6505            $tokensInsert[] = array( Php::TI_ID => T_OPEN_TAG, Php::TI_CONTENT => Php::T_OPEN_TAG_CONTENT );
     6506            $tokensInsert[] = array( Php::TI_ID => T_WHITESPACE, Php::TI_CONTENT => PHP_EOL . PHP_EOL );
     6507
     6508            Php::Tokens_Insert( $tokens, count( $tokens ), $tokensInsert );
     6509
     6510            $firstInsertPos = count( $tokens );
     6511
     6512            unset( $tokensInsert );
     6513        }
     6514        else
     6515        {
     6516            $firstInsertPos++;
     6517
     6518            $firstInsertPos = Php::Tokens_Find( $tokens, array( 'e' => array( T_WHITESPACE ) ), null, $firstInsertPos );
     6519            if( $firstInsertPos === false )
     6520                $firstInsertPos = count( $tokens );
     6521        }
     6522
     6523        $definePos = false;
     6524        $defineValPos = false;
     6525        for( $i = $firstInsertPos; ; )
     6526        {
     6527            $i = Php::Tokens_Find( $tokens, T_STRING, 'define', $i );
     6528            if( $i === false )
     6529                break;
     6530
     6531            $iDefine = $i;
     6532            $i++;
     6533
     6534            $callArgs = Php::Tokens_GetCallArgs( $tokens, $i );
     6535            $iEnd = Php::Tokens_Find( $tokens, T_ELEMENT, ';', $i );
     6536            if( $iEnd === false )
     6537                continue;
     6538
     6539            $i = $iEnd + 1;
     6540
     6541            if( empty( $callArgs ) || count( $callArgs ) != 2 )
     6542                continue;
     6543
     6544            if( Php::Token_GetEncapsedStrVal( Php::Token_GetContent( Php::Tokens_CallArgs_GetSingleArg( $callArgs, 0 ), T_CONSTANT_ENCAPSED_STRING ) ) != $name )
     6545                continue;
     6546
     6547            if( $defineValPos === false )
     6548            {
     6549                $definePos = array( $iDefine, $i - $iDefine );
     6550                Php::Tokens_CallArgs_GetSingleArg( $callArgs, 1, $defineValPos );
     6551                continue;
     6552            }
     6553
     6554            array_splice( $tokens, $iDefine, $i - $iDefine );
     6555            $i = $iDefine;
     6556        }
     6557
     6558        $changed = false;
     6559
     6560        if( $defineValPos === false )
     6561        {
     6562            $tokensInsert = array();
     6563            $tokensInsert[] = array( Php::TI_ID => T_STRING, Php::TI_CONTENT => 'define' );
     6564            $tokensInsert[] = array( Php::TI_ID => T_ELEMENT, Php::TI_CONTENT => '(' );
     6565            $tokensInsert[] = array( Php::TI_ID => T_CONSTANT_ENCAPSED_STRING, Php::TI_CONTENT => '\'' . $name . '\'' );
     6566            $tokensInsert[] = array( Php::TI_ID => T_ELEMENT, Php::TI_CONTENT => ',' );
     6567            $tokensInsert[] = array( Php::TI_ID => T_WHITESPACE, Php::TI_CONTENT => ' ' );
     6568
     6569            {
     6570                $defineValPos = count( $tokensInsert );
     6571                $tokensInsert[] = array( Php::TI_ID => T_CONSTANT_ENCAPSED_STRING, Php::TI_CONTENT => '\'\'' );
     6572            }
     6573
     6574            $tokensInsert[] = array( Php::TI_ID => T_ELEMENT, Php::TI_CONTENT => ')' );
     6575            $tokensInsert[] = array( Php::TI_ID => T_ELEMENT, Php::TI_CONTENT => ';' );
     6576            $tokensInsert[] = array( Php::TI_ID => T_WHITESPACE, Php::TI_CONTENT => PHP_EOL . PHP_EOL );
     6577
     6578            Php::Tokens_Insert( $tokens, $firstInsertPos, $tokensInsert );
     6579            $definePos = array( $firstInsertPos, count( $tokensInsert ) );
     6580            $defineValPos += $firstInsertPos;
     6581
     6582            unset( $tokensInsert );
     6583
     6584            $changed = true;
     6585        }
     6586
     6587        {
     6588
     6589            $tokenValNew = null;
     6590            switch( gettype( $val ) )
     6591            {
     6592            case 'string':
     6593                $token = $tokens[ $defineValPos ];
     6594
     6595                $cQuote = null;
     6596                if( $token[ Php::TI_ID ] == T_CONSTANT_ENCAPSED_STRING )
     6597                    $cQuote = substr( $token[ Php::TI_CONTENT ], 0, 1 );
     6598
     6599                if( empty( $cQuote ) )
     6600                    $cQuote = '\'';
     6601
     6602                $tokenValNew = array( Php::TI_ID => T_CONSTANT_ENCAPSED_STRING, Php::TI_CONTENT => $cQuote . $val . $cQuote );
     6603                break;
     6604
     6605            case 'boolean':
     6606                $tokenValNew = array( Php::TI_ID => T_STRING, Php::TI_CONTENT => $val ? 'true' : 'false' );
     6607                break;
     6608
     6609            case 'integer':
     6610                $tokenValNew = array( Php::TI_ID => T_LNUMBER, Php::TI_CONTENT => '' . $val );
     6611                break;
     6612
     6613            case 'double':
     6614                $tokenValNew = array( Php::TI_ID => T_DNUMBER, Php::TI_CONTENT => '' . $val );
     6615                break;
     6616
     6617            default:
     6618                return( false );
     6619                break;
     6620            }
     6621
     6622            if( $tokens[ $defineValPos ] != $tokenValNew )
     6623            {
     6624                $tokens[ $defineValPos ] = $tokenValNew;
     6625                $changed = true;
     6626            }
     6627        }
     6628
     6629        $inclPos = false;
     6630        for( $i = $firstInsertPos; ; )
     6631        {
     6632            $i = Php::Tokens_Find( $tokens, array( 'i' => array( T_REQUIRE, T_REQUIRE_ONCE, T_INCLUDE, T_INCLUDE_ONCE ) ), null, $i );
     6633            if( $i === false )
     6634                break;
     6635
     6636            $iInclude = $i;
     6637            $i++;
     6638
     6639            $iEnd = Php::Tokens_Find( $tokens, T_ELEMENT, ';', $i );
     6640            if( $iEnd === false )
     6641                continue;
     6642
     6643            $iArg = Php::Tokens_Find( $tokens, array( 'i' => array( T_CONSTANT_ENCAPSED_STRING ) ), array( '\'wp-settings.php\'' ), $i, $iEnd - $i );
     6644            if( $iEnd === false || $iArg > $iEnd )
     6645                continue;
     6646
     6647            $inclPos = array( $iInclude, $iEnd - $iInclude );
     6648            break;
     6649        }
     6650
     6651        if( $inclPos !== false && $inclPos[ 0 ] < $definePos[ 0 ] )
     6652        {
     6653            $tokensInsert = array_splice( $tokens, $definePos[ 0 ], $definePos[ 1 ] );
     6654            $tokensInsert[] = array( Php::TI_ID => T_WHITESPACE, Php::TI_CONTENT => PHP_EOL . PHP_EOL );
     6655            Php::Tokens_Insert( $tokens, $firstInsertPos, $tokensInsert );
     6656            unset( $tokensInsert );
     6657        }
     6658
     6659        return( true );
     6660    }
     6661
     6662    static function _Cfg_SetDefineValEx( &$fileContent, $name, $val )
     6663    {
     6664        $tokens = Php::Tokens_GetFromContent( $fileContent );
     6665        if( $tokens === false )
     6666        {
     6667
     6668            if( !Gen::StrStartsWith( $fileContent, '<?php' ) )
     6669                return( false );
     6670
     6671            $fileContent = "<?php\ndefine( '" . $name . "', " . var_export( $val, true ) . " );\n" . substr( $fileContent, 5 );
     6672            return( true );
     6673        }
     6674
     6675        if( !self::_Cfg_Tokens_SetDefineVal( $tokens, $name, $val ) )
     6676            return( false );
     6677
     6678        $fileContent = Php::Tokens_GetContent( $tokens );
     6679        return( true );
     6680    }
     6681
     6682    static function Cfg_SetDefineValEx( $file, $name, $val )
     6683    {
     6684        if( !file_exists( $file ) )
     6685            return( Gen::E_NOT_FOUND );
     6686
     6687        if( !is_writable( $file ) )
     6688            return( Gen::E_ACCESS_DENIED );
     6689
     6690        $fileContent = file_get_contents( $file );
     6691        if( !$fileContent )
     6692            return( Gen::E_ACCESS_DENIED );
     6693
     6694        if( !self::_Cfg_SetDefineValEx( $fileContent, $name, $val ) )
     6695            return( Gen::S_FALSE );
     6696
     6697        if( !is_integer( file_put_contents( $file, $fileContent, LOCK_EX ) ) )
     6698            return( Gen::E_FAIL );
     6699
     6700        return( Gen::S_OK );
     6701    }
    65066702}
    65076703
  • seraphinite-post-docx-source/trunk/Cmn/Img.php

    r3238125 r3461042  
    3434    {
    3535
    36         $data = @file_get_contents( $file );
     36        $data = Gen::FileGetContents( $file );
    3737        return( $data !== false ? Img::GetInfoFromData( $data, $ext ) : null );
    3838    }
     
    301301
    302302        $res = Gen::CallFunc( $fn, $args );
     303
    303304        if( !$fileIsTmp )
    304305        {
     
    329330            if( $hr == Gen::S_OK )
    330331            {
    331                 $res = @file_get_contents( $file );
     332                $res = Gen::FileGetContents( $file );
    332333                if( $res === false )
    333334                {
     
    428429    }
    429430
    430     static function CreateCopyResample( $h, $sizeDst, $rcSrc = null, $rcDst = null, $bgClr = null )
     431    static function CreateCopyScale( $h, $cx, $cy, $mode = IMG_BILINEAR_FIXED )
     432    {
     433        if( !$h || !$cx || !$cy )
     434            return( null );
     435
     436        $hNew = @imagescale( $h, $cx, $cy, $mode );
     437        if( $hNew === false && $mode != IMG_BILINEAR_FIXED )
     438            $hNew = @imagescale( $h, $cx, $cy, IMG_BILINEAR_FIXED );
     439        if( $hNew === false )
     440            return( null );
     441
     442        return( $hNew );
     443    }
     444
     445    static function CreateCopyResample( $h, $sizeDst, $rcSrc = null, $rcDst = null, $bgClr = null, $mode = IMG_BILINEAR_FIXED )
    431446    {
    432447        if( !$sizeDst[ 'cx' ] || !$sizeDst[ 'cy' ] )
     
    440455            $rcDst = array( 'x' => 0, 'y' => 0, 'cx' => $sizeDst[ 'cx' ], 'cy' => $sizeDst[ 'cy' ] );
    441456
     457        if( function_exists( 'imagesetinterpolation' ) )
     458            @imagesetinterpolation( $hNew, $mode );
    442459        @imagesavealpha( $hNew, true );
    443460
     
    724741            else if( $fileIsTmp )
    725742            {
    726                 $res = @file_get_contents( $file );
     743                $res = Gen::FileGetContents( $file );
    727744                if( $res === false )
    728745                {
     
    841858            else if( $fileIsTmp )
    842859            {
    843                 $res = @file_get_contents( $file );
     860                $res = Gen::FileGetContents( $file );
    844861                if( $res === false )
    845862                {
  • seraphinite-post-docx-source/trunk/Cmn/Plugin.php

    r3238125 r3461042  
    1111
    1212    static private $_cache = null;
     13    static private $_blogId = null;
    1314
    1415    static function Get( $ver, $name, $cbNs = '', $rawExtData = null )
    1516    {
    16         $data = Gen::GetArrField( self::$_cache, array( PluginOptions::GetMultiSitePrefix(), $name ) );
     17        $aKey = array( PluginOptions::GetMultiSitePrefix(), $name );
     18
     19        $data = Gen::GetArrField( self::$_cache, $aKey );
    1720        if( $data )
    1821            return( $data );
     
    6871        }
    6972
    70         self::$_cache[ $name ] = $data;
     73        Gen::SetArrField( self::$_cache, $aKey, $data );
    7174        return( $data );
    7275    }
     
    119122    static function GetMultiSitePrefix()
    120123    {
    121         if( is_multisite() )
    122             return( Plugin::IsInited() ? get_current_blog_id() : 0 );
    123         return( '' );
     124        return( is_multisite() ? PluginOptions::GetBlogId() : '' );
     125    }
     126
     127    static function SetBlogId( $id )
     128    {
     129        $idPrev = self::$_blogId;
     130        self::$_blogId = $id;
     131        return( $idPrev );
     132    }
     133
     134    static function GetBlogId()
     135    {
     136        if( self::$_blogId !== null )
     137            return( self::$_blogId );
     138        return( Plugin::IsInited() ? get_current_blog_id() : Gen::Constant( 'BLOG_ID_CURRENT_SITE', 0 ) );
    124139    }
    125140}
     
    292307            $args[ 'id' ] = 'wordpress-post-docx-source';
    293308            $args[ 'name' ] = 'Post%20.DOCX%20Source';
    294             $args[ 'v' ] = '2.16.14';
     309            $args[ 'v' ] = '2.16.15';
    295310            $args[ 'pk' ] = 'Base';
    296311            $args[ 'cfg' ] = '';
     
    314329            $lastCheckPackage = 'Base';
    315330
    316         if( $lastCheckVer !== '2.16.14' || $lastCheckPackage !== 'Base' )
     331        if( $lastCheckVer !== '2.16.15' || $lastCheckPackage !== 'Base' )
    317332        {
    318333            $state = Plugin::StateGet();
    319334
    320             if( $lastCheckVer !== '2.16.14' && !isset( $state[ 'changeVerCheck' ] ) )
     335            if( $lastCheckVer !== '2.16.15' && !isset( $state[ 'changeVerCheck' ] ) )
    321336            {
    322337                $state[ 'changeVerCheck' ] = $lastCheckVer !== null ? $lastCheckVer : '';
     
    335350        if( !$bForce )
    336351        {
    337             if( $bFirstTimeOnly && $lastCheckVer == '2.16.14' )
     352            if( $bFirstTimeOnly && $lastCheckVer == '2.16.15' )
    338353                return( Gen::S_FALSE );
    339354
     
    354369            $args[ 'id' ] = 'wordpress-post-docx-source';
    355370            $args[ 'name' ] = 'Post%20.DOCX%20Source';
    356             $args[ 'v' ] = '2.16.14';
     371            $args[ 'v' ] = '2.16.15';
    357372            $args[ 'pk' ] = 'Base';
    358373            $args[ 'cfg' ] = '';
     
    371386            {
    372387                $data[ 'updTime' ] = $curUpdTime;
    373                 $data[ 'plgVer' ] = '2.16.14';
     388                $data[ 'plgVer' ] = '2.16.15';
    374389                $data[ 'plgPk' ] = 'Base';
    375390
     
    388403        $data[ 'mdfTime' ] = $timeMdf;
    389404        $data[ 'updTime' ] = $curUpdTime;
    390         $data[ 'plgVer' ] = '2.16.14';
     405        $data[ 'plgVer' ] = '2.16.15';
    391406        $data[ 'plgPk' ] = 'Base';
    392407
     
    420435            return( 0 );
    421436
    422         return( @strtotime( wp_remote_retrieve_header( $requestRes, 'last-modified' ) ) );
     437        return( @strtotime( Net::GetHeaderFromWpRemoteRequestRes( $requestRes, 'last-modified' ) ) );
    423438    }
    424439
     
    637652        }
    638653
     654        Gen::SetTempDirFunc( 'seraph_pds\\Wp::GetTempDir' );
     655
    639656        Gen::CallFunc( 'seraph_pds\\OnInit', array( $isAdminMode ) );
    640657
     
    927944
    928945        $urlProductInfo = Plugin::RmtCfgFld_GetLoc( $rmtCfg, 'Links.UrlProductInfo' );
    929         $urlAboutPluginImg = file_exists( __DIR__ . '/../Images/ProductLogo.png' ) ? add_query_arg( array( 'v' => '2.16.14' ), Plugin::FileUri( '../Images/ProductLogo.png', __FILE__ ) ) : null;
     946        $urlAboutPluginImg = file_exists( __DIR__ . '/../Images/ProductLogo.png' ) ? add_query_arg( array( 'v' => '2.16.15' ), Plugin::FileUri( '../Images/ProductLogo.png', __FILE__ ) ) : null;
    930947        $urlAboutPluginDocs = Plugin::RmtCfgFld_GetLoc( $rmtCfg, 'Links.UrlProductDocs' );
    931948        $urlAboutPluginSupport = Plugin::RmtCfgFld_GetLoc( $rmtCfg, 'Links.UrlProductSupport' );
    932         $url3rdPartySoft = file_exists( __DIR__ . '/../third-party-software.html' ) ? add_query_arg( array( 'v' => '2.16.14' ), Plugin::FileUri( '../third-party-software.html', __FILE__ ) ) : null;
     949        $url3rdPartySoft = file_exists( __DIR__ . '/../third-party-software.html' ) ? add_query_arg( array( 'v' => '2.16.15' ), Plugin::FileUri( '../third-party-software.html', __FILE__ ) ) : null;
    933950
    934951        $urlEula = null;
     
    939956
    940957        {
    941             $version = esc_html( '2.16.14' );
     958            $version = esc_html( '2.16.15' );
    942959
    943960            $res .= Ui::TagOpen( 'div' );
     
    9881005        $rmtCfg = PluginRmtCfg::Get();
    9891006
    990         $urlAboutUsLogoImg = file_exists( __DIR__ . '/../Images/VendorLogo.png' ) ? add_query_arg( array( 'v' => '2.16.14' ), Plugin::FileUri( '../Images/VendorLogo.png', __FILE__ ) ) : null;
     1007        $urlAboutUsLogoImg = file_exists( __DIR__ . '/../Images/VendorLogo.png' ) ? add_query_arg( array( 'v' => '2.16.15' ), Plugin::FileUri( '../Images/VendorLogo.png', __FILE__ ) ) : null;
    9911008        $urlMorePlugins = Plugin::RmtCfgFld_GetLoc( $rmtCfg, 'Links.UrlMorePlugins' );
    9921009        $urlMoreInfo = Plugin::RmtCfgFld_GetLoc( $rmtCfg, 'Links.UrlMain' );
     
    11391156    }
    11401157
    1141     static function SettGet( $settRawExt = null )
    1142     {
     1158    static function SettGet( $settRawExt = null, $clearCache = false )
     1159    {
     1160        if( $clearCache )
     1161            Plugin::SettCacheClear();
    11431162        return( PluginOptions::Get( PLUGIN_SETT_VER, 'Sett', 'seraph_pds\\', $settRawExt ) );
    11441163    }
    11451164
    1146     static function SettGetGlobal( $settRawExt = null )
     1165    static function SettGetGlobal( $settRawExt = null, $clearCache = false )
    11471166    {
    11481167        if( !is_multisite() )
    1149             return( Plugin::SettGet( $settRawExt ) );
     1168            return( Plugin::SettGet( $settRawExt, $clearCache ) );
    11501169
    11511170        $restoreBlog = false;
     
    11561175        }
    11571176
    1158         $sett = Plugin::SettGet( $settRawExt );
     1177        $sett = Plugin::SettGet( $settRawExt, $clearCache );
    11591178
    11601179        if( $restoreBlog )
     
    15151534
    15161535            $verFrom = self::_PrevVer_GetInt( $plgVerPrev );
    1517             $verTo = self::_PrevVer_GetInt( '2.16.14' );
     1536            $verTo = self::_PrevVer_GetInt( '2.16.15' );
    15181537            if( $verTo < $verFrom )
    15191538                list( $verTo, $verFrom ) = array( $verFrom, $verTo );
     
    16401659                continue;
    16411660
    1642             wp_enqueue_style( Plugin::CmnScriptId( $id ), add_query_arg( Plugin::GetFileUrlPackageParams(), $fileUrl . '/' . $id . '.css' ), array(), '2.16.14' );
     1661            wp_enqueue_style( Plugin::CmnScriptId( $id ), add_query_arg( Plugin::GetFileUrlPackageParams(), $fileUrl . '/' . $id . '.css' ), array(), '2.16.15' );
    16431662
    16441663            self::$g_aAlreadyIncludedObj[ 'css' ][ $id ] = true;
     
    17071726            $scrHndId = Plugin::CmnScriptId( $id );
    17081727
    1709             wp_register_script( $scrHndId, add_query_arg( Plugin::GetFileUrlPackageParams(), $fileUrl . '/' . $id . '.js' ), $deps, '2.16.14' );
     1728            wp_register_script( $scrHndId, add_query_arg( Plugin::GetFileUrlPackageParams(), $fileUrl . '/' . $id . '.js' ), $deps, '2.16.15' );
    17101729            if( $id == 'Gen' )
    17111730                Plugin::Loc_ScriptLoad( $scrHndId );
     
    21522171                            var sendDataUrl = "<?php echo( Gen::GetArrField( $rmtCfg, 'Questionnaires.SendAnswerUrlTpl' ) ); ?>";
    21532172                            sendDataUrl = sendDataUrl.replace( "{EndPointId}",                  encodeURI( "<?php echo( Wp::GetSiteId() ); ?>" ) );
    2154                             sendDataUrl = sendDataUrl.replace( "{PluginVersion}",               encodeURI( "2.16.14" ) );
     2173                            sendDataUrl = sendDataUrl.replace( "{PluginVersion}",               encodeURI( "2.16.15" ) );
    21552174                            sendDataUrl = sendDataUrl.replace( "{PluginMode}",                  encodeURI( "base" ) );
    21562175                            sendDataUrl = sendDataUrl.replace( "{PluginPackage}",               encodeURI( "Base" ) );
     
    21842203    {
    21852204
    2186         Gen::CallFunc( 'seraph_pds\\OnActivate' );
     2205        Gen::CallFunc( 'seraph_pds\\OnActivate', array( Gen::Constant( 'WP_NETWORK_ADMIN' ) ) );
    21872206    }
    21882207
     
    21902209    {
    21912210
    2192         Gen::CallFunc( 'seraph_pds\\OnDeactivate' );
     2211        Gen::CallFunc( 'seraph_pds\\OnDeactivate', array( Gen::Constant( 'WP_NETWORK_ADMIN' ) ) );
    21932212    }
    21942213
  • seraphinite-post-docx-source/trunk/Cmn/Ui.php

    r3238125 r3461042  
    375375    }
    376376
     377    static function DeParseClassAttr( $v )
     378    {
     379        return( implode( ' ', $v ) );
     380    }
     381
     382    static function AddRemoveAttrClassEx( $val, $valClasses, $valClassesRemove = '' )
     383    {
     384        if( !is_array( $valClasses ) )
     385            $valClasses = $valClasses !== '' ? explode( ' ', @trim( $valClasses ) ) : array();
     386
     387        if( !is_array( $valClassesRemove ) )
     388            $valClassesRemove = $valClassesRemove !== '' ? explode( ' ', @trim( $valClassesRemove ) ) : array();
     389
     390        foreach( $valClasses as $valClass )
     391            if( strlen( ( string )$valClass ) && !in_array( $valClass, $val ) )
     392                $val[] = $valClass;
     393
     394        foreach( $valClassesRemove as $valClassRemove )
     395            while( ( $i = array_search( $valClassRemove, $val ) ) !== false )
     396                unset( $val[ $i ] );
     397
     398        return( $val );
     399    }
     400
     401    static function AddRemoveAttrClass( $val, $valClasses, $valClassesRemove = '' )
     402    {
     403        $val = Ui::ParseClassAttr( $val );
     404        $val = Ui::AddRemoveAttrClassEx( $val, $valClasses, $valClassesRemove );
     405        $val = Ui::DeParseClassAttr( $val );
     406        return( $val );
     407    }
     408
    377409    static function IsSrcAttrData( $v )
    378410    {
     
    410442
    411443        $res = array();
    412         $lastSrcData = null;
    413 
    414         foreach( explode( ',', $v ) as $args )
    415         {
    416             $args = array_map( 'trim', explode( ' ', Gen::StrReplaceWhileChanging( '  ', ' ', str_replace( array( "\t", "\r", "\n", "\0", "\x0B" ), ' ', trim( $args ) ) ) ) );
    417 
    418             if( Ui::IsSrcAttrData( $args[ 0 ] ) )
    419             {
    420                 $lastSrcData = $args[ 0 ];
    421                 continue;
    422             }
    423 
    424             if( $lastSrcData )
    425             {
    426                 $args[ 0 ] = $lastSrcData . ',' . $args[ 0 ];
    427                 $lastSrcData = null;
    428             }
    429 
    430             $res[] = $args;
    431         }
     444        while( preg_match( '@(?:\\s[\\d.]+[wx](,)|(,\\s))@S', $v, $m, PREG_OFFSET_CAPTURE ) )
     445        {
     446            if( $m[ 1 ][ 1 ] === -1 )
     447                $m[ 1 ] = $m[ 2 ];
     448            $res[] = substr( $v, 0, $m[ 1 ][ 1 ] );
     449            $v = substr( $v, $m[ 1 ][ 1 ] + strlen( $m[ 1 ][ 0 ] ) );
     450        }
     451        $res[] = $v;
     452
     453        $res = array_map(
     454            function( $resI )
     455            {
     456                return( array_map( 'trim', explode( ' ', Gen::StrReplaceWhileChanging( '  ', ' ', str_replace( array( "\t", "\r", "\n", "\0", "\x0B" ), ' ', trim( $resI ) ) ) ) ) );
     457            }
     458        , $res );
    432459
    433460        return( $res );
     
    746773    }
    747774
    748     static function TokensList_GetVal( $value, callable $cbItem = null, $unmask = false )
     775    static function TokensList_GetVal( $value, $cbItem = null, $unmask = false )
    749776    {
    750777        $value = @stripslashes( $value );
     
    9901017    }
    9911018
    992     static function PostBoxes( $title, $metaBoxes = array( 'body' => null ), array $callbacks = null, $callbacks_args = null, $blocksAttrs = null )
     1019    static function PostBoxes( $title, $metaBoxes = array( 'body' => null ), $callbacks = null, $callbacks_args = null, $blocksAttrs = null )
    9931020    {
    9941021        wp_enqueue_script( 'postbox' );
     
    13701397    }
    13711398
     1399    static function StyleMediaMinMax( $min, $max )
     1400    {
     1401        $res = '';
     1402
     1403        if( $min )
     1404            $res .= '(min-width: ' . ( string )$min . 'px)';
     1405
     1406        if( $min && $max )
     1407            $res .= ' and ';
     1408
     1409        if( $max )
     1410            $res .= '(max-width: ' . ( string )$max . 'px)';
     1411
     1412        return( $res );
     1413    }
     1414
    13721415    static function TagGetPos( $tag, $data, $offset = 0 )
    13731416    {
     
    13911434            $pos = $pos[ 0 ][ 1 ];
    13921435
    1393             if( $bSkipComments && substr( $data, $pos + 1, 1 ) == '!' )
     1436            if( $bSkipComments && substr( $data, $pos + 1, 2 ) == '!-' )
    13941437            {
    13951438                $offset = strpos( $data, '-->', $pos + 4 );
     
    14511494        $posEnd = $pos + $n;
    14521495        return( array( $pos, $posEnd, $n ) );
     1496    }
     1497
     1498    static function TagOffsetPos( &$tagPos, $offset = 0 )
     1499    {
     1500        if( $tagPos )
     1501        {
     1502            $tagPos[ 0 ] += $offset;
     1503            $tagPos[ 1 ] += $offset;
     1504        }
    14531505    }
    14541506
  • seraphinite-post-docx-source/trunk/common.php

    r3121524 r3461042  
    7373function _dublHdr( $requestRes, $tag )
    7474{
    75     $tagVal = wp_remote_retrieve_header( $requestRes, $tag );
     75    $tagVal = Net::GetHeaderFromWpRemoteRequestRes( $requestRes, $tag );
    7676    if( !empty( $tagVal ) )
    7777        header( $tag . ': ' . $tagVal );
  • seraphinite-post-docx-source/trunk/languages/seraphinite-post-docx-source-admin.pot

    r3238125 r3461042  
    77msgid ""
    88msgstr ""
    9 "#-#-#-#-#  cmn.admin.pot (seraphinite-post-docx-source 2.16.14)  #-#-#-#-#\n"
    10 "Project-Id-Version: seraphinite-post-docx-source 2.16.14\n"
     9"#-#-#-#-#  cmn.admin.pot (seraphinite-post-docx-source 2.16.15)  #-#-#-#-#\n"
     10"Project-Id-Version: seraphinite-post-docx-source 2.16.15\n"
    1111"Report-Msgid-Bugs-To: support@s-sols.com\n"
    1212"MIME-Version: 1.0\n"
    1313"Content-Type: text/plain; charset=UTF-8\n"
    1414"Content-Transfer-Encoding: 8bit\n"
    15 "#-#-#-#-#  main.admin.pot (seraphinite-post-docx-source 2.16.14)  #-#-#-#-#\n"
    16 "Project-Id-Version: seraphinite-post-docx-source 2.16.14\n"
     15"#-#-#-#-#  main.admin.pot (seraphinite-post-docx-source 2.16.15)  #-#-#-#-#\n"
     16"Project-Id-Version: seraphinite-post-docx-source 2.16.15\n"
    1717"Report-Msgid-Bugs-To: support@s-sols.com\n"
    1818"MIME-Version: 1.0\n"
  • seraphinite-post-docx-source/trunk/languages/seraphinite-post-docx-source.pot

    r3238125 r3461042  
    77msgid ""
    88msgstr ""
    9 "Project-Id-Version: seraphinite-post-docx-source 2.16.14\n"
     9"Project-Id-Version: seraphinite-post-docx-source 2.16.15\n"
    1010"Report-Msgid-Bugs-To: support@s-sols.com\n"
    1111"MIME-Version: 1.0\n"
  • seraphinite-post-docx-source/trunk/main.php

    r3238125 r3461042  
    2020        {
    2121            if( $formulasStylesLoadMode == 'Static' )
    22                 wp_enqueue_style( 'seraph-pds-MathJax-CHtml', Plugin::FileUrl( 'Ext/MathJax/CHtml.css', __FILE__ ), array(), '2.16.14' );
    23             wp_enqueue_script( Plugin::ScriptId( 'View' ), add_query_arg( Plugin::GetFileUrlPackageParams(), Plugin::FileUrl( 'View.js', __FILE__ ) ), array(), '2.16.14' );
     22                wp_enqueue_style( 'seraph-pds-MathJax-CHtml', Plugin::FileUrl( 'Ext/MathJax/CHtml.css', __FILE__ ), array(), '2.16.15' );
     23            wp_enqueue_script( Plugin::ScriptId( 'View' ), add_query_arg( Plugin::GetFileUrlPackageParams(), Plugin::FileUrl( 'View.js', __FILE__ ) ), array(), '2.16.15' );
    2424        }
    2525    }
    2626);
    2727
    28 function OnActivate()
    29 {
    30 }
    31 
    32 function OnDeactivate()
     28function OnActivate( $bAllMultisites )
     29{
     30}
     31
     32function OnDeactivate( $bAllMultisites )
    3333{
    3434}
     
    3939        add_options_page( Plugin::GetSettingsTitle(), Plugin::GetNavMenuTitle(), 'manage_options', 'seraph_pds_settings', $accepted ? 'seraph_pds\\_SettingsPage' : 'seraph_pds\\Plugin::OutputNotAcceptedPageContent' );
    4040    if( _UserCanUsePlugin() )
    41         add_menu_page( Plugin::GetPluginString( 'TitleLong' ), Plugin::GetNavMenuTitle(), 'publish_posts', 'seraph_pds_main', $accepted ? 'seraph_pds\\_UploadPage' : 'seraph_pds\\Plugin::OutputNotAcceptedPageContent', Plugin::FileUri( 'icon.png?v=2.16.14', __FILE__ ) );
     41        add_menu_page( Plugin::GetPluginString( 'TitleLong' ), Plugin::GetNavMenuTitle(), 'publish_posts', 'seraph_pds_main', $accepted ? 'seraph_pds\\_UploadPage' : 'seraph_pds\\Plugin::OutputNotAcceptedPageContent', Plugin::FileUri( 'icon.png?v=2.16.15', __FILE__ ) );
    4242}
    4343
     
    347347    _LoadScripts();
    348348
     349    if( _IsGutenbergActive() )
     350    {
     351        wp_enqueue_script( 'wp-block-library' );
     352        Wp::AddInlineScript( 'wp-block-library', 'jQuery( document ).on( "ready", function(){ wp.blockLibrary.registerCoreBlocks(); } )' );
     353    }
     354
    349355    Plugin::DisplayAdminFooterRateItContent();
    350356
     
    405411        return;
    406412
    407     wp_register_script( Plugin::ScriptId( 'editor' ), add_query_arg( Plugin::GetFileUrlPackageParams(), Plugin::FileUrl( 'editor.js', __FILE__ ) ), array_merge( array( 'jquery' ), Plugin::CmnScriptId( array( 'Cmn', 'Gen', 'Ui', 'Net' ) ) ), '2.16.14' );
     413    wp_register_script( Plugin::ScriptId( 'editor' ), add_query_arg( Plugin::GetFileUrlPackageParams(), Plugin::FileUrl( 'editor.js', __FILE__ ) ), array_merge( array( 'jquery' ), Plugin::CmnScriptId( array( 'Cmn', 'Gen', 'Ui', 'Net' ) ) ), '2.16.15' );
    408414    Plugin::Loc_ScriptLoad( Plugin::ScriptId( 'editor' ) );
    409415    wp_enqueue_script( Plugin::ScriptId( 'editor' ) );
  • seraphinite-post-docx-source/trunk/options.php

    r3207098 r3461042  
    560560            echo( \seraph_pds\Ui::SettBlock_ItemSubTbl_Begin() );
    561561            {
    562                 $fldId = 'docTypes/' . $postType . '/notexistLinksAction'; $radioGroupName = 'seraph_pds/' . $fldId; $fldVal = \seraph_pds\Gen::GetArrField( $sett, $fldId, 'CheckOnly', '/' );
     562                $fldId = 'docTypes/' . $postType . '/notexistLinksAction'; $radioGroupName = 'seraph_pds/' . $fldId; $fldVal = \seraph_pds\Gen::GetArrField( $sett, $fldId, 'No', '/' );
    563563
    564564?>
  • seraphinite-post-docx-source/trunk/readme.txt

    r3238125 r3461042  
    55Requires PHP: 5.4
    66Requires at least: 4.5
    7 Stable tag: 2.16.14
    8 Version: 2.16.14
     7Stable tag: 2.16.15
     8Version: 2.16.15
    99Tested up to: 6.7
    1010License: GPLv2 or later (if another license is not provided)
     
    107107== Changelog ==
    108108
     109= 2.16.15 =
     110
     111Improvements:
     112
     113* Plugin only one instance launch protection.
     114* Preventing license checking from wrong site ID.
     115
     116Fixes:
     117
     118* Activation on 'mystagingwebsite.com' with wrong site address.
     119* Asynchronous tasks execution: timestamp is wrong on some servers.
     120* Deprecation warning in 'TokensList_GetVal' of 'cbItem' parameter.
     121* Setting 'define' values in 'wp-config.php' doesnt matter if they are located after including of 'wp-settings.php'.
     122* When 'Use blocks (Gutenberg) formatting' is enabled, there is no content after adding via batch mode.
     123
    109124= 2.16.14 =
    110125
  • seraphinite-post-docx-source/trunk/seraphinite-post-docx-source.php

    r3238125 r3461042  
    66Text Domain: seraphinite-post-docx-source
    77Domain Path: /languages
    8 Version: 2.16.14
     8Version: 2.16.15
    99Author: Seraphinite Solutions
    1010Author URI: https://www.s-sols.com
     
    1616
    1717
    18 if( defined( 'SERAPH_PDS_VER' ) )
    19     return;
     18// #######################################################################
    2019
    21 define( 'SERAPH_PDS_VER', '2.16.14' );
     20if( !defined( 'SERAPH_PDS_PLUGIN_DIR' ) ) define( 'SERAPH_PDS_PLUGIN_DIR', __DIR__ ); else if( SERAPH_PDS_PLUGIN_DIR != __DIR__ ) return;
     21
     22// #######################################################################
    2223
    2324include( __DIR__ . '/main.php' );
Note: See TracChangeset for help on using the changeset viewer.